From 3875f67819e9ecee616183f8b94cf650d6018fd3 Mon Sep 17 00:00:00 2001 From: adam <1312adam@gmail.com> Date: Mon, 19 Oct 2026 16:18:05 +0200 Subject: [PATCH 1/6] More settings checkboxes into new user control --- client/Frontend/BoolToVisibilityConverter.cs | 25 ++++ client/Frontend/SettingsUserControl.xaml | 113 ++++++++++++++++++ client/Frontend/SettingsUserControl.xaml.cs | 80 +++++++++++++ client/Frontend/StartButtons.xaml | 115 ++----------------- client/Frontend/StartButtons.xaml.cs | 66 ----------- client/specify_client.csproj | 10 +- 6 files changed, 234 insertions(+), 175 deletions(-) create mode 100644 client/Frontend/BoolToVisibilityConverter.cs create mode 100644 client/Frontend/SettingsUserControl.xaml create mode 100644 client/Frontend/SettingsUserControl.xaml.cs diff --git a/client/Frontend/BoolToVisibilityConverter.cs b/client/Frontend/BoolToVisibilityConverter.cs new file mode 100644 index 0000000..1e2e439 --- /dev/null +++ b/client/Frontend/BoolToVisibilityConverter.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Data; + +namespace specify_client.Frontend +{ + [ValueConversion(typeof(bool), typeof(Visibility))] + public class BoolToVisibilityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return (bool)value ? Visibility.Visible : Visibility.Hidden; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/client/Frontend/SettingsUserControl.xaml b/client/Frontend/SettingsUserControl.xaml new file mode 100644 index 0000000..a4997b1 --- /dev/null +++ b/client/Frontend/SettingsUserControl.xaml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/Frontend/SettingsUserControl.xaml.cs b/client/Frontend/SettingsUserControl.xaml.cs new file mode 100644 index 0000000..81adb60 --- /dev/null +++ b/client/Frontend/SettingsUserControl.xaml.cs @@ -0,0 +1,80 @@ +using System.Windows; +using System.Windows.Controls; + +namespace specify_client.Frontend +{ + /// + /// Interaction logic for Settings.xaml + /// + public partial class SettingsUserControl : UserControl + { + public static readonly DependencyProperty DontUploadProperty = + DependencyProperty.Register( + name: "DontUpload", + propertyType: typeof(bool), + ownerType: typeof(SettingsUserControl), + typeMetadata: new FrameworkPropertyMetadata( + defaultValue: false, + flags: FrameworkPropertyMetadataOptions.AffectsRender, + new PropertyChangedCallback(DontUploadChanged))); + + public bool DontUpload + { + get => (bool)GetValue(DontUploadProperty); + set => SetValue(DontUploadProperty , value); + } + + public static void DontUploadChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + ((SettingsUserControl)d).DontUpload = (bool)e.NewValue; + Settings.DontUpload = (bool)e.NewValue; + } + + public SettingsUserControl() + { + InitializeComponent(); + } + + private void UsernameOn(object sender, RoutedEventArgs e) + { + Settings.RedactUsername = true; + Settings.RedactOneDriveCommercial = true; + } + + private void UsernameOff(object sender, RoutedEventArgs e) + { + Settings.RedactUsername = false; + Settings.RedactOneDriveCommercial = false; + } + + private void SerialNumberOn(object sender, RoutedEventArgs e) + { + Settings.RedactSerialNumber = true; + } + + private void SerialNumberOff(object sender, RoutedEventArgs e) + { + Settings.RedactSerialNumber = false; + } + + private void RedactNetworkingOn(object sender, RoutedEventArgs e) + { + Settings.RedactNetworking = true; + } + + private void RedactNetworkingOff(object sender, RoutedEventArgs e) + { + Settings.RedactNetworking = false; + } + + private void DebugLogToggleOn(object sender, RoutedEventArgs e) + { + Settings.EnableDebug = true; + } + + private void DebugLogToggleOff(object sender, RoutedEventArgs e) + { + Settings.EnableDebug = false; + } + } +} diff --git a/client/Frontend/StartButtons.xaml b/client/Frontend/StartButtons.xaml index 1b1d218..da34b3b 100644 --- a/client/Frontend/StartButtons.xaml +++ b/client/Frontend/StartButtons.xaml @@ -4,14 +4,17 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:specify_client" + xmlns:frontend="clr-namespace:specify_client.Frontend" mc:Ignorable="d" Title="Specify" Width="800" Height="400" MinWidth="800" MinHeight="400" d:Height="400" d:Width="800"> + + + - @@ -109,112 +112,8 @@ Background="#3b4252" Margin="5,5,5,5" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + Visibility="{Binding DontUpload, Converter={StaticResource boolToVisConverter}, ElementName=SettingsToggles}" Margin="0,4,0,8"> Careful! Disabling upload will prevent helpers from seeing the report. diff --git a/client/Frontend/StartButtons.xaml.cs b/client/Frontend/StartButtons.xaml.cs index e5489fb..8c9cec9 100644 --- a/client/Frontend/StartButtons.xaml.cs +++ b/client/Frontend/StartButtons.xaml.cs @@ -27,72 +27,6 @@ private void SettingsOff(object sender, RoutedEventArgs e) MainText.Visibility = Visibility.Visible; } - private void UploadOff(object sender, RoutedEventArgs e) - { - Settings.DontUpload = true; - WarningTextBlock.Visibility = Visibility.Visible; - } - - private void UploadOn(object sender, RoutedEventArgs e) - { - Settings.DontUpload = false; - WarningTextBlock.Visibility = Visibility.Hidden; - } - - private void UsernameOn(object sender, RoutedEventArgs e) - { - Settings.RedactUsername = true; - Settings.RedactOneDriveCommercial = true; - } - - private void UsernameOff(object sender, RoutedEventArgs e) - { - Settings.RedactUsername = false; - Settings.RedactOneDriveCommercial = false; - } - - private void SerialNumberOn(object sender, RoutedEventArgs e) - { - Settings.RedactSerialNumber = true; - } - - private void SerialNumberOff(object sender, RoutedEventArgs e) - { - Settings.RedactSerialNumber = false; - } - - private void RedactNetworkingOn(object sender, RoutedEventArgs e) - { - Settings.RedactNetworking = true; - } - - private void RedactNetworkingOff(object sender, RoutedEventArgs e) - { - Settings.RedactNetworking = false; - } - - private void DebugLogToggleOn(object sender, RoutedEventArgs e) - { - Settings.EnableDebug = true; - } - - private void DebugLogToggleOff(object sender, RoutedEventArgs e) - { - Settings.EnableDebug = false; - } - - private void UnlockUploadOn(object sender, RoutedEventArgs e) - { - DontUploadCheckbox.IsEnabled = true; - DontUploadCheckbox.Foreground = new SolidColorBrush(Colors.White); - WarningTextBlock.Visibility = Visibility.Visible; - } - private void UnlockUploadOff(object sender, RoutedEventArgs e) - { - DontUploadCheckbox.IsEnabled = false; - DontUploadCheckbox.Foreground = new SolidColorBrush(Colors.Gray); - WarningTextBlock.Visibility = Visibility.Hidden; - } private async void StartAction(object sender, RoutedEventArgs e) { try diff --git a/client/specify_client.csproj b/client/specify_client.csproj index d5e3bb9..97cec24 100644 --- a/client/specify_client.csproj +++ b/client/specify_client.csproj @@ -141,6 +141,10 @@ + + + SettingsUserControl.xaml + @@ -195,6 +199,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -270,4 +278,4 @@ - + \ No newline at end of file From 73e54aff214ad0dc624509aaabca7198ba699752 Mon Sep 17 00:00:00 2001 From: adam <1312adam@gmail.com> Date: Mon, 19 Oct 2026 17:13:03 +0200 Subject: [PATCH 2/6] Check if "OneDriveCommercial" key exists before redacting instead of relying on exception --- client/Monolith.cs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/client/Monolith.cs b/client/Monolith.cs index a76f1d9..e11f645 100644 --- a/client/Monolith.cs +++ b/client/Monolith.cs @@ -84,21 +84,12 @@ await DebugLog.LogFatalError( var serialized = m.Serialize(); await DebugLog.LogEventAsync("Monolith serialized"); - if (Settings.RedactOneDriveCommercial) - { - try + if (Settings.RedactOneDriveCommercial && Cache.UserVariables.Contains("OneDriveCommercial")) { var stringToRedact = (string)Cache.UserVariables["OneDriveCommercial"]; // The path containing the Commercial OneDrive stringToRedact = stringToRedact.Replace(@"\", @"\\"); // Changing a single \ to two \\ as that is how it shows up in the generated json serialized = serialized.Replace(stringToRedact, "[REDACTED]"); - } - catch (Exception e) - { - await DebugLog.LogEventAsync("Commercial OneDrive redaction failed. Serialization restarts." + e, DebugLog.Region.Misc, DebugLog.EventType.ERROR); - Settings.RedactOneDriveCommercial = false; - await Specificialize(); - return; - } + await DebugLog.LogEventAsync("Commercial OneDrive label redacted from report"); } From 6fa89e06c02cde2bb4d84732fa8a3314dc8072cb Mon Sep 17 00:00:00 2001 From: adam <1312adam@gmail.com> Date: Mon, 19 Oct 2026 17:15:35 +0200 Subject: [PATCH 3/6] Merge OneDrive redaction into redacting username option --- client/Frontend/App.xaml.cs | 4 ---- client/Frontend/SettingsUserControl.xaml.cs | 2 -- client/Monolith.cs | 12 ++++++------ client/Settings.cs | 4 +++- client/data/Methods/System.cs | 8 -------- 5 files changed, 9 insertions(+), 21 deletions(-) diff --git a/client/Frontend/App.xaml.cs b/client/Frontend/App.xaml.cs index cbedd5b..15df963 100644 --- a/client/Frontend/App.xaml.cs +++ b/client/Frontend/App.xaml.cs @@ -60,10 +60,6 @@ private async void Application_Startup(object sender, StartupEventArgs e) Settings.RedactSerialNumber = true; break; - case "-redact-odc": - Settings.RedactOneDriveCommercial = true; - break; - case "-redact-networking": Settings.RedactNetworking = true; break; diff --git a/client/Frontend/SettingsUserControl.xaml.cs b/client/Frontend/SettingsUserControl.xaml.cs index 81adb60..22b4ed2 100644 --- a/client/Frontend/SettingsUserControl.xaml.cs +++ b/client/Frontend/SettingsUserControl.xaml.cs @@ -38,13 +38,11 @@ public SettingsUserControl() private void UsernameOn(object sender, RoutedEventArgs e) { Settings.RedactUsername = true; - Settings.RedactOneDriveCommercial = true; } private void UsernameOff(object sender, RoutedEventArgs e) { Settings.RedactUsername = false; - Settings.RedactOneDriveCommercial = false; } private void SerialNumberOn(object sender, RoutedEventArgs e) diff --git a/client/Monolith.cs b/client/Monolith.cs index e11f645..2078261 100644 --- a/client/Monolith.cs +++ b/client/Monolith.cs @@ -84,11 +84,11 @@ await DebugLog.LogFatalError( var serialized = m.Serialize(); await DebugLog.LogEventAsync("Monolith serialized"); - if (Settings.RedactOneDriveCommercial && Cache.UserVariables.Contains("OneDriveCommercial")) - { - var stringToRedact = (string)Cache.UserVariables["OneDriveCommercial"]; // The path containing the Commercial OneDrive - stringToRedact = stringToRedact.Replace(@"\", @"\\"); // Changing a single \ to two \\ as that is how it shows up in the generated json - serialized = serialized.Replace(stringToRedact, "[REDACTED]"); + if (Settings.RedactUsername && Cache.UserVariables.Contains("OneDriveCommercial")) + { + var stringToRedact = (string)Cache.UserVariables["OneDriveCommercial"]; // The path containing the Commercial OneDrive + stringToRedact = stringToRedact.Replace(@"\", @"\\"); // Changing a single \ to two \\ as that is how it shows up in the generated json + serialized = serialized.Replace(stringToRedact, "[REDACTED]"); await DebugLog.LogEventAsync("Commercial OneDrive label redacted from report"); } @@ -221,7 +221,7 @@ public static void ProgramDone(ProgramDoneState state) Console.WriteLine("Specify is done."); Console.WriteLine("Specify has uploaded the result to spec-ify.com, the link should be in your clipboard."); } - break; + break; case ProgramDoneState.NoUpload: if (!Settings.Headless) diff --git a/client/Settings.cs b/client/Settings.cs index 8f98f19..f1a7c5e 100644 --- a/client/Settings.cs +++ b/client/Settings.cs @@ -2,9 +2,11 @@ public static class Settings { + /// + /// Redacts Windows username and OneDrive commercial account name + /// public static bool RedactUsername { get; set; } = false; public static bool RedactSerialNumber { get; set; } = false; - public static bool RedactOneDriveCommercial { get; set; } = false; public static bool RedactNetworking { get; set; } = false; public static bool DontUpload { get; set; } = false; public static bool Headless { get; set; } = false; diff --git a/client/data/Methods/System.cs b/client/data/Methods/System.cs index 49ec51b..d18a7ec 100644 --- a/client/data/Methods/System.cs +++ b/client/data/Methods/System.cs @@ -837,18 +837,10 @@ private static async Task CheckCommercialOneDrive() { if (!ODFound) { - if (Settings.RedactOneDriveCommercial) - { - Settings.RedactOneDriveCommercial = false; - await LogEventAsync("OneDriveCommercial variable not found. Corresponding internal setting disabled.", Region.System); - } - else - { await LogEventAsync("OneDriveCommercial variable not found.", Region.System); } } } - } private static void GetScheduledTasks() { From 20e8bcaadcb8d4668e0854f0230f6da7429d1d6c Mon Sep 17 00:00:00 2001 From: adam <1312adam@gmail.com> Date: Mon, 19 Oct 2026 17:31:26 +0200 Subject: [PATCH 4/6] Make EnableDebug as property, exclude it from debug log --- client/DebugLog.cs | 2 +- client/Settings.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/DebugLog.cs b/client/DebugLog.cs index 6cb157f..976e895 100644 --- a/client/DebugLog.cs +++ b/client/DebugLog.cs @@ -344,7 +344,7 @@ private static string CreateDebugString(string message, Region region, EventType private static async Task LogSettings() { var properties = typeof(Settings).GetProperties(); - foreach (PropertyInfo property in properties) + foreach (PropertyInfo property in properties.Where(x => x.Name != "EnableDebug")) { await LogEventAsync($"{property.Name}: {property.GetValue(null)}"); } diff --git a/client/Settings.cs b/client/Settings.cs index f1a7c5e..c926081 100644 --- a/client/Settings.cs +++ b/client/Settings.cs @@ -11,5 +11,5 @@ public static class Settings public static bool DontUpload { get; set; } = false; public static bool Headless { get; set; } = false; public static bool LocalCulture { get; set; } = false; - public static bool EnableDebug = false; // Deliberately not a property. + public static bool EnableDebug { get; set; } = false; } \ No newline at end of file From cd80b90f9cc638ab0318a9786a4a1cd41224308c Mon Sep 17 00:00:00 2001 From: adam <1312adam@gmail.com> Date: Mon, 19 Oct 2026 17:56:59 +0200 Subject: [PATCH 5/6] Change settings class into a singleton object, adjust other classes and views --- client/DebugLog.cs | 5 +- client/Frontend/App.xaml.cs | 1 + client/Frontend/SettingsUserControl.xaml | 15 +++-- client/Frontend/SettingsUserControl.xaml.cs | 62 --------------------- client/Frontend/StartButtons.xaml | 2 +- client/Monolith.cs | 1 + client/Settings.cs | 18 +++--- client/data/Methods/Network.cs | 2 + 8 files changed, 28 insertions(+), 78 deletions(-) diff --git a/client/DebugLog.cs b/client/DebugLog.cs index 976e895..10b286e 100644 --- a/client/DebugLog.cs +++ b/client/DebugLog.cs @@ -12,7 +12,8 @@ namespace specify_client; public static class DebugLog { - + private static Settings Settings => Settings.Instance; + public static string LogText; public static readonly int[] ErrorCount = new int[7]; private static bool Started = false; @@ -346,7 +347,7 @@ private static async Task LogSettings() var properties = typeof(Settings).GetProperties(); foreach (PropertyInfo property in properties.Where(x => x.Name != "EnableDebug")) { - await LogEventAsync($"{property.Name}: {property.GetValue(null)}"); + await LogEventAsync($"{property.Name}: {property.GetValue(Settings.Instance)}"); } } diff --git a/client/Frontend/App.xaml.cs b/client/Frontend/App.xaml.cs index 15df963..2fa3010 100644 --- a/client/Frontend/App.xaml.cs +++ b/client/Frontend/App.xaml.cs @@ -11,6 +11,7 @@ namespace specify_client; /// public partial class App : Application { + private static Settings Settings => Settings.Instance; [DllImport("Kernel32.dll")] public static extern bool AllocConsole(); diff --git a/client/Frontend/SettingsUserControl.xaml b/client/Frontend/SettingsUserControl.xaml index a4997b1..71604ea 100644 --- a/client/Frontend/SettingsUserControl.xaml +++ b/client/Frontend/SettingsUserControl.xaml @@ -4,8 +4,13 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:specify_client.Frontend" + xmlns:sfy="clr-namespace:specify_client" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> + + + + @@ -50,7 +55,7 @@ @@ -67,7 +72,7 @@ @@ -102,7 +107,7 @@ diff --git a/client/Frontend/SettingsUserControl.xaml.cs b/client/Frontend/SettingsUserControl.xaml.cs index 22b4ed2..71c83d3 100644 --- a/client/Frontend/SettingsUserControl.xaml.cs +++ b/client/Frontend/SettingsUserControl.xaml.cs @@ -8,71 +8,9 @@ namespace specify_client.Frontend /// public partial class SettingsUserControl : UserControl { - public static readonly DependencyProperty DontUploadProperty = - DependencyProperty.Register( - name: "DontUpload", - propertyType: typeof(bool), - ownerType: typeof(SettingsUserControl), - typeMetadata: new FrameworkPropertyMetadata( - defaultValue: false, - flags: FrameworkPropertyMetadataOptions.AffectsRender, - new PropertyChangedCallback(DontUploadChanged))); - - public bool DontUpload - { - get => (bool)GetValue(DontUploadProperty); - set => SetValue(DontUploadProperty , value); - } - - public static void DontUploadChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - ((SettingsUserControl)d).DontUpload = (bool)e.NewValue; - Settings.DontUpload = (bool)e.NewValue; - } - public SettingsUserControl() { InitializeComponent(); } - - private void UsernameOn(object sender, RoutedEventArgs e) - { - Settings.RedactUsername = true; - } - - private void UsernameOff(object sender, RoutedEventArgs e) - { - Settings.RedactUsername = false; - } - - private void SerialNumberOn(object sender, RoutedEventArgs e) - { - Settings.RedactSerialNumber = true; - } - - private void SerialNumberOff(object sender, RoutedEventArgs e) - { - Settings.RedactSerialNumber = false; - } - - private void RedactNetworkingOn(object sender, RoutedEventArgs e) - { - Settings.RedactNetworking = true; - } - - private void RedactNetworkingOff(object sender, RoutedEventArgs e) - { - Settings.RedactNetworking = false; - } - - private void DebugLogToggleOn(object sender, RoutedEventArgs e) - { - Settings.EnableDebug = true; - } - - private void DebugLogToggleOff(object sender, RoutedEventArgs e) - { - Settings.EnableDebug = false; - } } } diff --git a/client/Frontend/StartButtons.xaml b/client/Frontend/StartButtons.xaml index da34b3b..09376b4 100644 --- a/client/Frontend/StartButtons.xaml +++ b/client/Frontend/StartButtons.xaml @@ -153,7 +153,7 @@ TextWrapping="Wrap" VerticalAlignment="Top" HorizontalAlignment="Center" - Visibility="{Binding DontUpload, Converter={StaticResource boolToVisConverter}, ElementName=SettingsToggles}" Margin="0,4,0,8"> + Visibility="{Binding DontUpload, Source={x:Static local:Settings.Instance}, Converter={StaticResource boolToVisConverter}}" Margin="0,4,0,8"> Careful! Disabling upload will prevent helpers from seeing the report. diff --git a/client/Monolith.cs b/client/Monolith.cs index 2078261..0705000 100644 --- a/client/Monolith.cs +++ b/client/Monolith.cs @@ -25,6 +25,7 @@ namespace specify_client; [Serializable] public class Monolith { + private static Settings Settings => Settings.Instance; // it will say these are never used, but they are serialized public string Version; diff --git a/client/Settings.cs b/client/Settings.cs index c926081..cfdc8fc 100644 --- a/client/Settings.cs +++ b/client/Settings.cs @@ -1,15 +1,17 @@ namespace specify_client; -public static class Settings +public class Settings { + public static Settings Instance { get; set; } = new Settings(); + /// /// Redacts Windows username and OneDrive commercial account name /// - public static bool RedactUsername { get; set; } = false; - public static bool RedactSerialNumber { get; set; } = false; - public static bool RedactNetworking { get; set; } = false; - public static bool DontUpload { get; set; } = false; - public static bool Headless { get; set; } = false; - public static bool LocalCulture { get; set; } = false; - public static bool EnableDebug { get; set; } = false; + public bool RedactUsername { get; set; } = false; + public bool RedactSerialNumber { get; set; } = false; + public bool RedactNetworking { get; set; } = false; + public bool DontUpload { get; set; } = false; + public bool Headless { get; set; } = false; + public bool LocalCulture { get; set; } = false; + public bool EnableDebug { get; set; } = false; } \ No newline at end of file diff --git a/client/data/Methods/Network.cs b/client/data/Methods/Network.cs index 396afea..82d1334 100644 --- a/client/data/Methods/Network.cs +++ b/client/data/Methods/Network.cs @@ -14,6 +14,8 @@ namespace specify_client.data; public static partial class Cache { + private static Settings Settings => Settings.Instance; + public static async Task MakeNetworkData() { try From 6bb1a5369413dcb2148f06fe58fa236f9968543f Mon Sep 17 00:00:00 2001 From: adam <1312adam@gmail.com> Date: Mon, 19 Oct 2026 19:38:38 +0200 Subject: [PATCH 6/6] Slightly redesign switch buttons, minor style adjustments in start view. --- client/Frontend/App.xaml | 17 ++-- client/Frontend/CheckboxUserControl.xaml | 28 ++++++ client/Frontend/CheckboxUserControl.xaml.cs | 54 ++++++++++ client/Frontend/SettingsUserControl.xaml | 105 ++++---------------- client/Frontend/StartButtons.xaml | 12 +-- client/specify_client.csproj | 7 ++ 6 files changed, 125 insertions(+), 98 deletions(-) create mode 100644 client/Frontend/CheckboxUserControl.xaml create mode 100644 client/Frontend/CheckboxUserControl.xaml.cs diff --git a/client/Frontend/App.xaml b/client/Frontend/App.xaml index 2184258..2399c3a 100644 --- a/client/Frontend/App.xaml +++ b/client/Frontend/App.xaml @@ -108,14 +108,19 @@ - - - + + + + + + - + - - + + diff --git a/client/Frontend/CheckboxUserControl.xaml b/client/Frontend/CheckboxUserControl.xaml new file mode 100644 index 0000000..2c639da --- /dev/null +++ b/client/Frontend/CheckboxUserControl.xaml @@ -0,0 +1,28 @@ + + + + + + + + + + diff --git a/client/Frontend/CheckboxUserControl.xaml.cs b/client/Frontend/CheckboxUserControl.xaml.cs new file mode 100644 index 0000000..e973f8c --- /dev/null +++ b/client/Frontend/CheckboxUserControl.xaml.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace specify_client.Frontend +{ + /// + /// Interaction logic for CheckboxUserControl.xaml + /// + public partial class CheckboxUserControl : UserControl + { + public static readonly DependencyProperty IsCheckedProperty = + DependencyProperty.Register( + name: "IsChecked", + propertyType: typeof(bool), + ownerType: typeof(CheckboxUserControl), + typeMetadata: new FrameworkPropertyMetadata( + defaultValue: false, + flags: FrameworkPropertyMetadataOptions.BindsTwoWayByDefault)); + + public static readonly DependencyProperty ContentProperty = + DependencyProperty.Register( + name: "Content", + propertyType: typeof(object), + ownerType: typeof(CheckboxUserControl)); + + public bool IsChecked + { + get => (bool)GetValue(IsCheckedProperty); + set => SetValue(IsCheckedProperty, value); + } + public object Content + { + get => GetValue(ContentProperty); + set => SetValue(ContentProperty, value); + } + + public CheckboxUserControl() + { + InitializeComponent(); + } + } +} diff --git a/client/Frontend/SettingsUserControl.xaml b/client/Frontend/SettingsUserControl.xaml index 71604ea..5ccc743 100644 --- a/client/Frontend/SettingsUserControl.xaml +++ b/client/Frontend/SettingsUserControl.xaml @@ -7,15 +7,14 @@ xmlns:sfy="clr-namespace:specify_client" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> - + - - + @@ -28,91 +27,25 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + diff --git a/client/Frontend/StartButtons.xaml b/client/Frontend/StartButtons.xaml index 09376b4..5834c52 100644 --- a/client/Frontend/StartButtons.xaml +++ b/client/Frontend/StartButtons.xaml @@ -17,18 +17,18 @@ - + - + + - - + - + @@ -115,7 +115,7 @@ - + + + CheckboxUserControl.xaml + SettingsUserControl.xaml @@ -171,6 +174,10 @@ UploadFail.xaml + + Designer + MSBuild:Compile + MSBuild:Compile Designer