From bcb41ad59987e3d9e4497dc8d1c9e8ad654c762b Mon Sep 17 00:00:00 2001 From: xxe Date: Tue, 15 Nov 2022 11:46:15 +0800 Subject: [PATCH] 1 --- HKCardOUT/Converter/TextForegroundConvert.cs | 27 ++++++++++++++++++++ HKCardOUT/Views/AdWindow.xaml | 3 ++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/HKCardOUT/Converter/TextForegroundConvert.cs b/HKCardOUT/Converter/TextForegroundConvert.cs index 5b046a1..e1ec79a 100644 --- a/HKCardOUT/Converter/TextForegroundConvert.cs +++ b/HKCardOUT/Converter/TextForegroundConvert.cs @@ -23,6 +23,33 @@ namespace Converter return default; } + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } + public class LocationConvert : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value != null) + { + if (value.ToString().Contains("6")) + return value.ToString().Replace("6", "1"); + else if (value.ToString().Contains("5")) + return value.ToString().Replace("5", "2"); + else if (value.ToString().Contains("4")) + return value.ToString().Replace("4", "3"); + else if (value.ToString().Contains("3")) + return value.ToString().Replace("3", "4"); + else if (value.ToString().Contains("2")) + return value.ToString().Replace("2", "5"); + else if (value.ToString().Contains("1")) + return value.ToString().Replace("1", "6"); + } + return default; + } + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); diff --git a/HKCardOUT/Views/AdWindow.xaml b/HKCardOUT/Views/AdWindow.xaml index d8cb8e5..964c39e 100644 --- a/HKCardOUT/Views/AdWindow.xaml +++ b/HKCardOUT/Views/AdWindow.xaml @@ -16,6 +16,7 @@ mc:Ignorable="d"> +