@@ -23,33 +23,6 @@ namespace Converter | |||||
return default; | 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) | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||||
{ | { | ||||
throw new NotImplementedException(); | throw new NotImplementedException(); | ||||
@@ -16,7 +16,6 @@ | |||||
mc:Ignorable="d"> | mc:Ignorable="d"> | ||||
<Window.Resources> | <Window.Resources> | ||||
<con:TextForegroundConvert x:Key="TextForegroundConvert" /> | <con:TextForegroundConvert x:Key="TextForegroundConvert" /> | ||||
<con:LocationConvert x:Key="LocationConvert" /> | |||||
<Style x:Key="Lbl" TargetType="TextBlock"> | <Style x:Key="Lbl" TargetType="TextBlock"> | ||||
<Setter Property="FontSize" Value="26" /> | <Setter Property="FontSize" Value="26" /> | ||||
<Setter Property="Margin" Value="0,5,0,10" /> | <Setter Property="Margin" Value="0,5,0,10" /> | ||||
@@ -70,7 +69,7 @@ | |||||
HorizontalAlignment="Center" | HorizontalAlignment="Center" | ||||
Foreground="#ddd" | Foreground="#ddd" | ||||
Style="{StaticResource Lbl}" | Style="{StaticResource Lbl}" | ||||
Text="{Binding LAdInfo.Gate, Converter={StaticResource LocationConvert}}" /> | |||||
Text="{Binding LAdInfo.Gate}" /> | |||||
</Grid> | </Grid> | ||||
<Grid Grid.Row="1" Margin="5"> | <Grid Grid.Row="1" Margin="5"> | ||||
@@ -43,9 +43,9 @@ namespace HKCardOUT.Views | |||||
if (BindScreen != -1) | if (BindScreen != -1) | ||||
{ | { | ||||
int[] NotchNum = new int[2]; | int[] NotchNum = new int[2]; | ||||
if (bindScreen == 0) { NotchNum[0] = 5; NotchNum[1] = 6; } | |||||
if (bindScreen == 0) { NotchNum[0] = 1; NotchNum[1] = 2; } | |||||
if (bindScreen == 1) { NotchNum[0] = 3; NotchNum[1] = 4; } | if (bindScreen == 1) { NotchNum[0] = 3; NotchNum[1] = 4; } | ||||
if (bindScreen == 2) { NotchNum[0] = 1; NotchNum[1] = 2; } | |||||
if (bindScreen == 2) { NotchNum[0] = 5; NotchNum[1] = 6; } | |||||
(this.DataContext as AdWindowViewModel).InitData(NotchNum); | (this.DataContext as AdWindowViewModel).InitData(NotchNum); | ||||
ThreadManage.GetInstance().StartLong(new Action(() => | ThreadManage.GetInstance().StartLong(new Action(() => | ||||