From 4114175c3cac7dc23222b46192d1ff93a7cd053d Mon Sep 17 00:00:00 2001 From: JT Date: Wed, 24 May 2023 16:48:03 -0700 Subject: [PATCH] Converted to WPF-UI from WinUI 3 --- StabilityMatrix.sln | 36 ++------ StabilityMatrix/App.xaml | 19 ++--- StabilityMatrix/App.xaml.cs | 50 ++--------- StabilityMatrix/AssemblyInfo.cs | 10 +++ StabilityMatrix/InstallPage.xaml | 50 +++++------ StabilityMatrix/InstallPage.xaml.cs | 8 +- StabilityMatrix/LaunchPage.xaml | 24 +++--- StabilityMatrix/LaunchPage.xaml.cs | 26 ++---- StabilityMatrix/MainWindow.xaml | 82 +++++++++++++------ StabilityMatrix/MainWindow.xaml.cs | 78 +++++------------- StabilityMatrix/StabilityMatrix.csproj | 64 +++------------ .../ViewModels/InstallerViewModel.cs | 7 +- 12 files changed, 167 insertions(+), 287 deletions(-) create mode 100644 StabilityMatrix/AssemblyInfo.cs diff --git a/StabilityMatrix.sln b/StabilityMatrix.sln index 9a01a278..7ca54ed3 100644 --- a/StabilityMatrix.sln +++ b/StabilityMatrix.sln @@ -1,43 +1,25 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 -VisualStudioVersion = 17.4.33213.308 +VisualStudioVersion = 17.6.33717.318 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StabilityMatrix", "StabilityMatrix\StabilityMatrix.csproj", "{FB37844E-2B59-4AA2-A140-B230F095218B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StabilityMatrix", "StabilityMatrix\StabilityMatrix.csproj", "{7CA2E862-B121-495D-8CCC-2D6EF56A3312}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM64 = Debug|ARM64 - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|ARM64 = Release|ARM64 - Release|x64 = Release|x64 - Release|x86 = Release|x86 + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {FB37844E-2B59-4AA2-A140-B230F095218B}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {FB37844E-2B59-4AA2-A140-B230F095218B}.Debug|ARM64.Build.0 = Debug|ARM64 - {FB37844E-2B59-4AA2-A140-B230F095218B}.Debug|ARM64.Deploy.0 = Debug|ARM64 - {FB37844E-2B59-4AA2-A140-B230F095218B}.Debug|x64.ActiveCfg = Debug|x64 - {FB37844E-2B59-4AA2-A140-B230F095218B}.Debug|x64.Build.0 = Debug|x64 - {FB37844E-2B59-4AA2-A140-B230F095218B}.Debug|x64.Deploy.0 = Debug|x64 - {FB37844E-2B59-4AA2-A140-B230F095218B}.Debug|x86.ActiveCfg = Debug|x86 - {FB37844E-2B59-4AA2-A140-B230F095218B}.Debug|x86.Build.0 = Debug|x86 - {FB37844E-2B59-4AA2-A140-B230F095218B}.Debug|x86.Deploy.0 = Debug|x86 - {FB37844E-2B59-4AA2-A140-B230F095218B}.Release|ARM64.ActiveCfg = Release|ARM64 - {FB37844E-2B59-4AA2-A140-B230F095218B}.Release|ARM64.Build.0 = Release|ARM64 - {FB37844E-2B59-4AA2-A140-B230F095218B}.Release|ARM64.Deploy.0 = Release|ARM64 - {FB37844E-2B59-4AA2-A140-B230F095218B}.Release|x64.ActiveCfg = Release|x64 - {FB37844E-2B59-4AA2-A140-B230F095218B}.Release|x64.Build.0 = Release|x64 - {FB37844E-2B59-4AA2-A140-B230F095218B}.Release|x64.Deploy.0 = Release|x64 - {FB37844E-2B59-4AA2-A140-B230F095218B}.Release|x86.ActiveCfg = Release|x86 - {FB37844E-2B59-4AA2-A140-B230F095218B}.Release|x86.Build.0 = Release|x86 - {FB37844E-2B59-4AA2-A140-B230F095218B}.Release|x86.Deploy.0 = Release|x86 + {7CA2E862-B121-495D-8CCC-2D6EF56A3312}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7CA2E862-B121-495D-8CCC-2D6EF56A3312}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7CA2E862-B121-495D-8CCC-2D6EF56A3312}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7CA2E862-B121-495D-8CCC-2D6EF56A3312}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {46EBF17D-F7E8-465B-94F1-26FC5BDEF80B} + SolutionGuid = {97DDAF21-661E-4E36-ABC3-BF2052415919} EndGlobalSection EndGlobal diff --git a/StabilityMatrix/App.xaml b/StabilityMatrix/App.xaml index 78057bc6..50d605a8 100644 --- a/StabilityMatrix/App.xaml +++ b/StabilityMatrix/App.xaml @@ -1,18 +1,15 @@ - - - - + - - + + - diff --git a/StabilityMatrix/App.xaml.cs b/StabilityMatrix/App.xaml.cs index d806e2ef..961b1f2d 100644 --- a/StabilityMatrix/App.xaml.cs +++ b/StabilityMatrix/App.xaml.cs @@ -1,51 +1,17 @@ -using Microsoft.UI.Xaml; -using System; -using System.Diagnostics; -using Windows.ApplicationModel.Core; -using Windows.UI.ViewManagement; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; namespace StabilityMatrix { /// - /// Provides application-specific behavior to supplement the default Application class. + /// Interaction logic for App.xaml /// public partial class App : Application { - /// - /// Initializes the singleton application object. This is the first line of authored code - /// executed, and as such is the logical equivalent of main() or WinMain(). - /// - public App() - { - CoreApplication.UnhandledErrorDetected += UnhandledError; - InitializeComponent(); - DebugSettings.IsBindingTracingEnabled = true; - DebugSettings.BindingFailed += (sender, args) => Debug.WriteLine(args.Message); - } - - /// - /// Invoked when the application is launched. - /// - /// Details about the launch request and process. - protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) - { - mainWindow = new MainWindow(); - mainWindow.Activate(); - } - - private static void UnhandledError(object sender, UnhandledErrorDetectedEventArgs eventArgs) - { - try - { - eventArgs.UnhandledError.Propagate(); - } - catch (Exception e) - { - Debug.WriteLine("Error: {0}", e); - throw; - } - } - - private Window mainWindow; } } diff --git a/StabilityMatrix/AssemblyInfo.cs b/StabilityMatrix/AssemblyInfo.cs new file mode 100644 index 00000000..8b5504ec --- /dev/null +++ b/StabilityMatrix/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/StabilityMatrix/InstallPage.xaml b/StabilityMatrix/InstallPage.xaml index 4ee64a36..da198199 100644 --- a/StabilityMatrix/InstallPage.xaml +++ b/StabilityMatrix/InstallPage.xaml @@ -1,53 +1,47 @@ - + xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" + xmlns:models="clr-namespace:StabilityMatrix.Models" + xmlns:viewModels="clr-namespace:StabilityMatrix.ViewModels" + d:DesignHeight="700" + d:DesignWidth="1100" + ui:Design.Background="#202020" + mc:Ignorable="d"> - + - - - - - - - - - - + + + + - - - - - + + + + - + - + @@ -55,7 +49,7 @@ + Maximum="100" Width="500"/> diff --git a/StabilityMatrix/InstallPage.xaml.cs b/StabilityMatrix/InstallPage.xaml.cs index 1a1bbfe1..9b7f6c54 100644 --- a/StabilityMatrix/InstallPage.xaml.cs +++ b/StabilityMatrix/InstallPage.xaml.cs @@ -1,9 +1,7 @@ -// Copyright (c) Microsoft Corporation and Contributors. -// Licensed under the MIT License. - -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls; +using System.Windows; +using System.Windows.Controls; using StabilityMatrix.ViewModels; +using Wpf.Ui.Controls; // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. diff --git a/StabilityMatrix/LaunchPage.xaml b/StabilityMatrix/LaunchPage.xaml index c4744f77..99e0393f 100644 --- a/StabilityMatrix/LaunchPage.xaml +++ b/StabilityMatrix/LaunchPage.xaml @@ -1,17 +1,13 @@ - - - + - -