Skip to content

Commit

Permalink
Move concurrent list, fix nesting level issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jtheisen committed Jan 25, 2023
1 parent ef0dd78 commit 1c1f7a4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion SampleApp.Wpf/Job.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
>
<StackPanel Orientation="Vertical">
<Grid Margin="0,2">
<TextBlock Margin="{Binding NestingLevel.Level, Converter={StaticResource NestingLevelConverter}}" Text="{Binding StatusString, Converter={StaticResource UpperCaseConverter}}" Style="{StaticResource MaterialDesignButtonTextBlock}" d:Text="qwer" />
<TextBlock Margin="{Binding NestingLevel, Converter={StaticResource NestingLevelConverter}}" Text="{Binding StatusString, Converter={StaticResource UpperCaseConverter}}" Style="{StaticResource MaterialDesignButtonTextBlock}" d:Text="qwer" />
</Grid>
<ContentControl Content="{Binding}">
<ContentControl.ContentTemplateSelector>
Expand Down
11 changes: 3 additions & 8 deletions SampleApp.Wpf/NestingLevelConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,9 @@ public class NestingLevelConverter : IValueConverter

public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value is Int32 nestingLevel)
{
return new Thickness(Offset + Factor * nestingLevel, 0, 0, 0);
}
else
{
return DefaultMargin;
}
var level = value is JobNestingLevel nestingLevel ? nestingLevel.Level : 0;

return new Thickness(Offset + Factor * level, 0, 0, 0);
}

public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
Expand Down

0 comments on commit 1c1f7a4

Please sign in to comment.