From 1c1f7a4a465bb0547be491b8fa7403187c91bb6c Mon Sep 17 00:00:00 2001 From: jtheisen Date: Wed, 25 Jan 2023 22:04:46 +0100 Subject: [PATCH] Move concurrent list, fix nesting level issue --- .../Misc => SampleApp.AspNetMvc}/ConcurrentList.cs | 0 SampleApp.Wpf/Job.xaml | 2 +- SampleApp.Wpf/NestingLevelConverter.cs | 11 +++-------- 3 files changed, 4 insertions(+), 9 deletions(-) rename {Moldinium/Misc => SampleApp.AspNetMvc}/ConcurrentList.cs (100%) diff --git a/Moldinium/Misc/ConcurrentList.cs b/SampleApp.AspNetMvc/ConcurrentList.cs similarity index 100% rename from Moldinium/Misc/ConcurrentList.cs rename to SampleApp.AspNetMvc/ConcurrentList.cs diff --git a/SampleApp.Wpf/Job.xaml b/SampleApp.Wpf/Job.xaml index 914577b..d6bf59b 100644 --- a/SampleApp.Wpf/Job.xaml +++ b/SampleApp.Wpf/Job.xaml @@ -10,7 +10,7 @@ > - + diff --git a/SampleApp.Wpf/NestingLevelConverter.cs b/SampleApp.Wpf/NestingLevelConverter.cs index 0fc74dd..7025858 100644 --- a/SampleApp.Wpf/NestingLevelConverter.cs +++ b/SampleApp.Wpf/NestingLevelConverter.cs @@ -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)