Microscopic Traffic Simulator
FromUICultureNameToItemChecked.cs
Go to the documentation of this file.
1 using System;
2 using System.Globalization;
3 using System.Windows.Data;
4 
5 namespace Microscopic_Traffic_Simulator.Converters
6 {
10  class FromUICultureNameToItemChecked : IValueConverter
11  {
21  public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
22  {
23  if ((string)value == (string)parameter)
24  return true;
25  else
26  return false;
27  }
28 
38  public object ConvertBack(object value, Type targetType, object parameter,
39  CultureInfo culture)
40  {
41  return null;
42  }
43  }
44 }
Converter from UICulture name string to checked status of checkbox item.
object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Convert UICulture name string to status of checkbox item.
object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Convert status of checkbox item to UI culture string. Should not be used.