xxe 2 lat temu
rodzic
commit
bcb41ad599
2 zmienionych plików z 29 dodań i 1 usunięć
  1. +27
    -0
      HKCardOUT/Converter/TextForegroundConvert.cs
  2. +2
    -1
      HKCardOUT/Views/AdWindow.xaml

+ 27
- 0
HKCardOUT/Converter/TextForegroundConvert.cs Wyświetl plik

@@ -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();


+ 2
- 1
HKCardOUT/Views/AdWindow.xaml Wyświetl plik

@@ -16,6 +16,7 @@
mc:Ignorable="d">
<Window.Resources>
<con:TextForegroundConvert x:Key="TextForegroundConvert" />
<con:LocationConvert x:Key="LocationConvert" />
<Style x:Key="Lbl" TargetType="TextBlock">
<Setter Property="FontSize" Value="26" />
<Setter Property="Margin" Value="0,5,0,10" />
@@ -69,7 +70,7 @@
HorizontalAlignment="Center"
Foreground="#ddd"
Style="{StaticResource Lbl}"
Text="{Binding LAdInfo.Gate}" />
Text="{Binding LAdInfo.Gate, Converter={StaticResource LocationConvert}}" />
</Grid>

<Grid Grid.Row="1" Margin="5">


Ładowanie…
Anuluj
Zapisz