Skip to content

Commit

Permalink
Adjusted Equipment upgrade edit form display (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jebzou authored Mar 27, 2024
1 parent 5f984ab commit edad079
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion ElectronicObserver/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ private static Tracker JotTracker()
.Property(w => w.ViewModel.Filters.DisplayFinished)
.Property(w => w.ViewModel.Filters.SelectAllDay)
.Property(w => w.ViewModel.Filters.SelectToday)
.Property(w => w.ViewModel.CompactMode)
.Property(w => w.ViewModel.EquipmentUpgradePlanManager.CompactMode)
.Property(w => w.ViewModel.PlanListWidth)
.Property(w => w.ViewModel.PlannedUpgradesPager.ItemsPerPage);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public partial class EquipmentUpgradePlanItemViewModel : WindowViewModelBase, IE
public bool AllowToChangeDesiredUpgradeLevel => Parent is null;
public bool AllowToChangeEquipment => Parent is null;

private EquipmentUpgradePlanManager EquipmentUpgradePlanManager { get; }
public EquipmentUpgradePlanManager EquipmentUpgradePlanManager { get; }

public EquipmentUpgradePlanItemViewModel(EquipmentUpgradePlanItemModel plan)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@
</Grid.ColumnDefinitions>

<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<local:EquipmentUpgradePlanItemControl
Grid.ColumnSpan="2"
CompactMode="False"
ReadOnly="False"
/>

<ScrollViewer Grid.ColumnSpan="2">
<local:EquipmentUpgradePlanItemControl CompactMode="{Binding EquipmentUpgradePlanManager.CompactMode}" ReadOnly="False" />
</ScrollViewer>

<StackPanel
Grid.Row="1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public class EquipmentUpgradePlanManager
public event EventHandler? PlanCostUpdated;
public event EventHandler? PlanEquipmentMasterUpdated;

public bool CompactMode { get; set; } = false;

public EquipmentUpgradePlanManager()
{
SubscribeToApi();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ public partial class EquipmentUpgradePlannerViewModel : WindowViewModelBase
public EquipmentUpgradePlannerTranslationViewModel EquipmentUpgradePlanner { get; }

private EquipmentPickerService EquipmentPicker { get; }
private EquipmentUpgradePlanManager EquipmentUpgradePlanManager { get; }

public EquipmentUpgradePlanManager EquipmentUpgradePlanManager { get; }

public EquipmentUpgradePlanCostViewModel TotalCost { get; private set; } = new(new());

public GridLength PlanListWidth { get; set; } = new(350, GridUnitType.Pixel);

public EquipmentUpgradeFilterViewModel Filters { get; set; } = new();

public bool CompactMode { get; set; } = false;

public EquipmentUpgradePlannerViewModel()
{
PlannedUpgradesPager = new();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<CheckBox
Margin="10 0 0 0"
Content="{Binding EquipmentUpgradePlanner.CompactMode}"
IsChecked="{Binding CompactMode}"
IsChecked="{Binding EquipmentUpgradePlanManager.CompactMode}"
/>

<CheckBox
Expand Down Expand Up @@ -166,7 +166,7 @@
</StackPanel>

<local:EquipmentUpgradePlanItemControl
CompactMode="{Binding DataContext.CompactMode, RelativeSource={RelativeSource AncestorType=local:EquipmentUpgradePlannerWindow}}"
CompactMode="{Binding DataContext.EquipmentUpgradePlanManager.CompactMode, RelativeSource={RelativeSource AncestorType=local:EquipmentUpgradePlannerWindow}}"
DataContext="{Binding}"
ReadOnly="True"
/>
Expand Down

0 comments on commit edad079

Please sign in to comment.