1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-31 09:43:46 +00:00

Conditions - Fixed a null check during value retreival

Test data model - Moved to right folder
This commit is contained in:
SpoinkyNL 2020-09-27 23:01:08 +02:00
parent e30e37e8e3
commit 7e8dea351b
8 changed files with 9 additions and 9 deletions

View File

@ -127,7 +127,7 @@ namespace Artemis.UI.Shared
if (PropertyInfo.GetGetMethod() == null) if (PropertyInfo.GetGetMethod() == null)
return null; return null;
return Parent == null ? null : PropertyInfo.GetValue(Parent.GetCurrentValue()); return Parent?.GetCurrentValue() == null ? null : PropertyInfo.GetValue(Parent.GetCurrentValue());
} }
catch (Exception) catch (Exception)
{ {

View File

@ -31,12 +31,12 @@
<StackPanel> <StackPanel>
<StackPanel.Resources> <StackPanel.Resources>
<DataTemplate DataType="{x:Type dataModel:DataModelPropertiesViewModel}"> <DataTemplate DataType="{x:Type dataModel:DataModelPropertiesViewModel}">
<TextBlock Text="{Binding PropertyDescription.Name}" ToolTip="{Binding PropertyDescription.Description}" /> <TextBlock Text="{Binding PropertyDescription.Name}" ToolTip="{Binding PropertyDescription.Description}" ToolTipService.ShowOnDisabled="True"/>
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type dataModel:DataModelListViewModel}"> <DataTemplate DataType="{x:Type dataModel:DataModelListViewModel}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Kind="FormatListBulleted" VerticalAlignment="Center" Margin="0 0 5 0" /> <materialDesign:PackIcon Kind="FormatListBulleted" VerticalAlignment="Center" Margin="0 0 5 0" />
<TextBlock Text="{Binding PropertyDescription.Name}" ToolTip="{Binding PropertyDescription.Description}" VerticalAlignment="Center" /> <TextBlock Text="{Binding PropertyDescription.Name}" ToolTip="{Binding PropertyDescription.Description}" ToolTipService.ShowOnDisabled="True" VerticalAlignment="Center" />
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type dataModel:DataModelPropertyViewModel}"> <DataTemplate DataType="{x:Type dataModel:DataModelPropertyViewModel}">
@ -54,12 +54,12 @@
<StackPanel> <StackPanel>
<StackPanel.Resources> <StackPanel.Resources>
<DataTemplate DataType="{x:Type dataModel:DataModelPropertiesViewModel}"> <DataTemplate DataType="{x:Type dataModel:DataModelPropertiesViewModel}">
<TextBlock Text="{Binding PropertyDescription.Name}" ToolTip="{Binding PropertyDescription.Description}" /> <TextBlock Text="{Binding PropertyDescription.Name}" ToolTip="{Binding PropertyDescription.Description}" ToolTipService.ShowOnDisabled="True"/>
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type dataModel:DataModelListViewModel}"> <DataTemplate DataType="{x:Type dataModel:DataModelListViewModel}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Kind="FormatListBulleted" VerticalAlignment="Center" Margin="0 0 5 0" /> <materialDesign:PackIcon Kind="FormatListBulleted" VerticalAlignment="Center" Margin="0 0 5 0" />
<TextBlock Text="{Binding PropertyDescription.Name}" ToolTip="{Binding PropertyDescription.Description}" VerticalAlignment="Center" /> <TextBlock Text="{Binding PropertyDescription.Name}" ToolTip="{Binding PropertyDescription.Description}" ToolTipService.ShowOnDisabled="True" VerticalAlignment="Center"/>
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type dataModel:DataModelPropertyViewModel}"> <DataTemplate DataType="{x:Type dataModel:DataModelPropertyViewModel}">
@ -70,7 +70,7 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!-- Value description --> <!-- Value description -->
<TextBlock Grid.Column="0" Text="{Binding PropertyDescription.Name}" ToolTip="{Binding PropertyDescription.Description}" /> <TextBlock Grid.Column="0" Text="{Binding PropertyDescription.Name}" ToolTip="{Binding PropertyDescription.Description}" ToolTipService.ShowOnDisabled="True"/>
<!-- Value display --> <!-- Value display -->
<StackPanel Grid.Column="1"> <StackPanel Grid.Column="1">

View File

@ -82,7 +82,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Artemis.Plugins.Modules.Ove
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataModelExpansions", "DataModelExpansions", "{5A5B55D7-F631-467A-A16F-B880DE4E8909}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataModelExpansions", "DataModelExpansions", "{5A5B55D7-F631-467A-A16F-B880DE4E8909}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artemis.Plugins.DataModelExpansions.TestData", "Artemis.Plugins.DataModelExpansions.TestData\Artemis.Plugins.DataModelExpansions.TestData.csproj", "{5353C9A2-2D9A-4051-8599-AFE56D54B882}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artemis.Plugins.DataModelExpansions.TestData", "Plugins\Artemis.Plugins.DataModelExpansions.TestData\Artemis.Plugins.DataModelExpansions.TestData.csproj", "{5353C9A2-2D9A-4051-8599-AFE56D54B882}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -24,7 +24,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj" /> <ProjectReference Include="..\..\Artemis.Core\Artemis.Core.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -8,7 +8,7 @@ namespace Artemis.Plugins.DataModelExpansions.TestData.DataModels
{ {
public PluginDataModel() public PluginDataModel()
{ {
PluginSubDataModel = new PluginSubDataModel(); // PluginSubDataModel = new PluginSubDataModel();
ListItems = new List<SomeListItem>(); ListItems = new List<SomeListItem>();
for (var i = 0; i < 20; i++) for (var i = 0; i < 20; i++)
ListItems.Add(new SomeListItem {ItemName = $"Item {i + 1}", Number = i}); ListItems.Add(new SomeListItem {ItemName = $"Item {i + 1}", Number = i});