From 07bd52ef643997785d60fde3f5ef1acefe69adcc Mon Sep 17 00:00:00 2001 From: OctaAcid Date: Sat, 8 Apr 2023 22:50:03 +0800 Subject: [PATCH 1/4] Chore:PlayerNumber selection/remapped login gui --- installer/Installer/Common.cs | 32 +++++++ installer/Installer/MainWindow.xaml | 67 +++++++++----- installer/Installer/Model.cs | 12 ++- installer/Installer/ViewModel.cs | 134 +++++++++++++++++++++------- 4 files changed, 188 insertions(+), 57 deletions(-) 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 @@ -