From 7b90808b43da615c91912f7cfad088bf386e0f71 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Sat, 19 Nov 2022 16:09:39 -0600 Subject: [PATCH] Use Converter to transform format to actual display --- .../DateTimeFormatToNowConverter.cs | 19 + Flow.Launcher/SettingWindow.xaml | 1666 +++++++++-------- Flow.Launcher/SettingWindow.xaml.cs | 24 - .../ViewModel/SettingWindowViewModel.cs | 99 +- 4 files changed, 920 insertions(+), 888 deletions(-) create mode 100644 Flow.Launcher/Converters/DateTimeFormatToNowConverter.cs diff --git a/Flow.Launcher/Converters/DateTimeFormatToNowConverter.cs b/Flow.Launcher/Converters/DateTimeFormatToNowConverter.cs new file mode 100644 index 000000000..3c46fd01a --- /dev/null +++ b/Flow.Launcher/Converters/DateTimeFormatToNowConverter.cs @@ -0,0 +1,19 @@ +using System; +using System.Globalization; +using System.Windows.Data; + +namespace Flow.Launcher.Converters +{ + public class DateTimeFormatToNowConverter : IValueConverter + { + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return value is not string format ? null : DateTime.Now.ToString(format); + } + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index bc0ff1ce4..5b841978f 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -1,5 +1,4 @@ - - + - + - + @@ -44,12 +47,15 @@ - + + - + @@ -59,127 +65,172 @@ - - - - - - - - - - - - - - - - - - - - - + @@ -606,13 +717,11 @@ - - - + @@ -628,25 +738,24 @@ - + - - - - + - + - @@ -672,10 +781,10 @@ - + - @@ -685,13 +794,14 @@ - + - + - @@ -702,24 +812,26 @@ - - + + - - + - + - - - + + - @@ -752,14 +865,16 @@ - + - - + + - - + - + - @@ -789,11 +905,12 @@ - - + + - @@ -803,52 +920,46 @@ - - - - + - - - - - + - - - - - + - - + - - + - -