diff --git a/installer/Installer/Common.cs b/installer/Installer/Common.cs index 6fe5377..fc3a554 100644 --- a/installer/Installer/Common.cs +++ b/installer/Installer/Common.cs @@ -1,6 +1,8 @@ using System.ComponentModel; using System; using System.Windows.Input; +using System.Globalization; +using System.Windows.Data; namespace starter.viewmodel.common { @@ -66,4 +68,34 @@ namespace starter.viewmodel.common } } } + + public class RadioConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value == null || parameter == null) + { + return false; + } + string checkvalue = value.ToString(); + string targetvalue = parameter.ToString(); + bool r = checkvalue.Equals(targetvalue); + return r; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value == null || parameter == null) + { + return null; + } + + if ((bool)value) + { + return parameter.ToString(); + } + return null; + } + } + } diff --git a/installer/Installer/MainWindow.xaml b/installer/Installer/MainWindow.xaml index cb43e6d..993efaa 100644 --- a/installer/Installer/MainWindow.xaml +++ b/installer/Installer/MainWindow.xaml @@ -3,9 +3,12 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:local="clr-namespace:Installer" + xmlns:local="clr-namespace:Installer" xmlns:c="clr-namespace:starter.viewmodel.common" mc:Ignorable="d" Title="Installer" Window.SizeToContent="WidthAndHeight"> + + + @@ -34,14 +37,14 @@ -