Data model debugger - Fixed dictionaries causing the debugger to fail

Data model debugger - Added realtime updating (can be disabled)
This commit is contained in:
Robert committed 2021-02-27 23:26:56 +01:00
1 parent 3c29c3aeeb
commit 41b8038b74
4 files changed
+75 -30

No files matched your search

@@ -19,6 +19,10 @@
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid Grid.Row="0" Margin="0 0 0 5">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
@@ -48,6 +52,17 @@
IsEnabled="{Binding IsModuleFilterEnabled}"
SelectedItem="{Binding SelectedModule}"
ItemsSource="{Binding Modules}" />
<StackPanel Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="2"
Orientation="Horizontal"
Margin="0 10 0 0"
ToolTip="Check to update values every half second instead of realtime">
<TextBlock VerticalAlignment="Center">Slow updates</TextBlock>
<ToggleButton VerticalAlignment="Center" Margin="5 0" Style="{StaticResource MaterialDesignSwitchToggleButton}" IsChecked="{Binding SlowUpdates}" />
</StackPanel>
</Grid>
<TreeView Grid.Row="1" ItemsSource="{Binding MainDataModel.Children}" HorizontalContentAlignment="Stretch">
<TreeView.Resources>
@@ -20,12 +20,13 @@ namespace Artemis.UI.Screens.Settings.Debug.Tabs
private DataModelPropertiesViewModel _mainDataModel;
private string _propertySearch;
private Module _selectedModule;
private bool _slowUpdates;
public DataModelDebugViewModel(IDataModelUIService dataModelUIService, IPluginManagementService pluginManagementService)
{
_dataModelUIService = dataModelUIService;
_pluginManagementService = pluginManagementService;
_updateTimer = new Timer(500);
_updateTimer = new Timer(25);
DisplayName = "Data model";
Modules = new BindableCollection<Module>();
@@ -43,6 +44,16 @@ namespace Artemis.UI.Screens.Settings.Debug.Tabs
set => SetAndNotify(ref _propertySearch, value);
}
public bool SlowUpdates
{
get => _slowUpdates;
set
{
SetAndNotify(ref _slowUpdates, value);
_updateTimer.Interval = _slowUpdates ? 500 : 25;
}
}
public BindableCollection<Module> Modules { get; }
public Module SelectedModule