JT
2 years ago
12 changed files with 167 additions and 287 deletions
@ -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 |
||||
|
@ -1,18 +1,15 @@
|
||||
<!-- Copyright (c) Microsoft Corporation and Contributors. --> |
||||
<!-- Licensed under the MIT License. --> |
||||
|
||||
<Application |
||||
x:Class="StabilityMatrix.App" |
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
xmlns:local="using:StabilityMatrix"> |
||||
<Application x:Class="StabilityMatrix.App" |
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
xmlns:local="clr-namespace:StabilityMatrix" |
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" |
||||
StartupUri="MainWindow.xaml"> |
||||
<Application.Resources> |
||||
<ResourceDictionary> |
||||
<ResourceDictionary.MergedDictionaries> |
||||
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" /> |
||||
<!-- Other merged dictionaries here --> |
||||
<ui:ThemesDictionary Theme="Dark" /> |
||||
<ui:ControlsDictionary /> |
||||
</ResourceDictionary.MergedDictionaries> |
||||
<!-- Other app resources here --> |
||||
</ResourceDictionary> |
||||
</Application.Resources> |
||||
</Application> |
||||
|
@ -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 |
||||
{ |
||||
/// <summary> |
||||
/// Provides application-specific behavior to supplement the default Application class. |
||||
/// Interaction logic for App.xaml |
||||
/// </summary> |
||||
public partial class App : Application |
||||
{ |
||||
/// <summary> |
||||
/// 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(). |
||||
/// </summary> |
||||
public App() |
||||
{ |
||||
CoreApplication.UnhandledErrorDetected += UnhandledError; |
||||
InitializeComponent(); |
||||
DebugSettings.IsBindingTracingEnabled = true; |
||||
DebugSettings.BindingFailed += (sender, args) => Debug.WriteLine(args.Message); |
||||
} |
||||
|
||||
/// <summary> |
||||
/// Invoked when the application is launched. |
||||
/// </summary> |
||||
/// <param name="args">Details about the launch request and process.</param> |
||||
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; |
||||
} |
||||
} |
||||
|
@ -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) |
||||
)] |
@ -1,17 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Page |
||||
x:Class="StabilityMatrix.LaunchPage" |
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
xmlns:local="using:StabilityMatrix" |
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
||||
mc:Ignorable="d" |
||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> |
||||
|
||||
<Page x:Class="StabilityMatrix.LaunchPage" |
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" |
||||
xmlns:local="clr-namespace:StabilityMatrix" |
||||
mc:Ignorable="d" |
||||
Title="LaunchPage" d:DesignHeight="700" d:DesignWidth="1100"> |
||||
<Grid> |
||||
|
||||
<Button x:Name="LaunchButton" Content="Launch" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Click="LaunchButton_OnClick"/> |
||||
|
||||
<ui:Button x:Name="LaunchButton" Content="Launch" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top"/> |
||||
</Grid> |
||||
</Page> |
||||
|
@ -1,25 +1,13 @@
|
||||
using Microsoft.UI.Xaml; |
||||
using Microsoft.UI.Xaml.Controls; |
||||
using System; |
||||
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. |
||||
namespace StabilityMatrix; |
||||
|
||||
namespace StabilityMatrix |
||||
public partial class LaunchPage : Page |
||||
{ |
||||
/// <summary> |
||||
/// An empty page that can be used on its own or navigated to within a Frame. |
||||
/// </summary> |
||||
public sealed partial class LaunchPage : Page |
||||
public LaunchPage() |
||||
{ |
||||
public LaunchPage() |
||||
{ |
||||
this.InitializeComponent(); |
||||
} |
||||
|
||||
private void LaunchButton_OnClick(object sender, RoutedEventArgs e) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
InitializeComponent(); |
||||
} |
||||
} |
||||
|
@ -1,29 +1,57 @@
|
||||
<Window |
||||
x:Class="StabilityMatrix.MainWindow" |
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
xmlns:local="using:StabilityMatrix" |
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
||||
mc:Ignorable="d"> |
||||
|
||||
<NavigationView |
||||
x:Name="MainNavigationView" |
||||
Loaded="MainNavigationView_OnLoaded" |
||||
SelectionChanged="MainNavigationView_OnSelectionChanged" |
||||
Header="Stability Matrix"> |
||||
|
||||
<NavigationView.HeaderTemplate> |
||||
<DataTemplate> |
||||
<TextBlock Text="{Binding}" Margin="0,0,0,8"/> |
||||
</DataTemplate> |
||||
</NavigationView.HeaderTemplate> |
||||
<ui:FluentWindow x:Class="StabilityMatrix.MainWindow" |
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
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:StabilityMatrix" |
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" |
||||
mc:Ignorable="d" |
||||
Background="{DynamicResource ApplicationBackgroundBrush}" |
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}" |
||||
ExtendsContentIntoTitleBar="True" |
||||
WindowBackdropType="Mica" |
||||
Loaded="MainWindow_OnLoaded" |
||||
Title="Stability Matrix" Height="700" Width="1100"> |
||||
<Grid> |
||||
<Grid.RowDefinitions> |
||||
<RowDefinition Height="Auto" /> |
||||
<RowDefinition Height="*" /> |
||||
</Grid.RowDefinitions> |
||||
|
||||
<NavigationView.MenuItems> |
||||
<NavigationViewItem Content="Launch" Tag="LaunchPage" /> |
||||
<NavigationViewItem Content="Install" Tag="InstallPage" /> |
||||
</NavigationView.MenuItems> |
||||
<ui:TitleBar Foreground="White" Background="#191919"> |
||||
<ui:TitleBar.Header> |
||||
<TextBlock Text="Stability Matrix" Margin="16,8" /> |
||||
</ui:TitleBar.Header> |
||||
</ui:TitleBar> |
||||
|
||||
<Frame x:Name="ContentFrame"/> |
||||
</NavigationView> |
||||
</Window> |
||||
<ui:NavigationView |
||||
Grid.Row="1" x:Name="RootNavigation" |
||||
IsBackButtonVisible="Collapsed"> |
||||
<ui:NavigationView.Header> |
||||
<ui:BreadcrumbBar |
||||
Margin="42,32,0,0" |
||||
FontSize="28" |
||||
FontWeight="DemiBold" /> |
||||
</ui:NavigationView.Header> |
||||
<ui:NavigationView.MenuItems> |
||||
<ui:NavigationViewItem Content="Launch" IsActive="true" TargetPageType="{x:Type local:LaunchPage}"> |
||||
<ui:NavigationViewItem.Icon> |
||||
<ui:SymbolIcon Symbol="Rocket24" /> |
||||
</ui:NavigationViewItem.Icon> |
||||
</ui:NavigationViewItem> |
||||
<ui:NavigationViewItem Content="Install" TargetPageType="{x:Type local:InstallPage}"> |
||||
<ui:NavigationViewItem.Icon> |
||||
<ui:SymbolIcon Symbol="Wrench24" /> |
||||
</ui:NavigationViewItem.Icon> |
||||
</ui:NavigationViewItem> |
||||
</ui:NavigationView.MenuItems> |
||||
<ui:NavigationView.FooterMenuItems> |
||||
<ui:NavigationViewItem Content="Settings"> |
||||
<ui:NavigationViewItem.Icon> |
||||
<ui:SymbolIcon Symbol="Settings24" /> |
||||
</ui:NavigationViewItem.Icon> |
||||
</ui:NavigationViewItem> |
||||
</ui:NavigationView.FooterMenuItems> |
||||
</ui:NavigationView> |
||||
</Grid> |
||||
</ui:FluentWindow> |
||||
|
@ -1,71 +1,37 @@
|
||||
using Microsoft.UI.Xaml; |
||||
using Microsoft.UI.Xaml.Controls; |
||||
using System; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Diagnostics; |
||||
using System.Linq; |
||||
using Windows.UI.ViewManagement; |
||||
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; |
||||
using Wpf.Ui.Controls; |
||||
using Wpf.Ui.Controls.Window; |
||||
|
||||
namespace StabilityMatrix |
||||
{ |
||||
/// <summary> |
||||
/// An empty window that can be used on its own or navigated to within a Frame. |
||||
/// Interaction logic for MainWindow.xaml |
||||
/// </summary> |
||||
public sealed partial class MainWindow : Window |
||||
public partial class MainWindow : FluentWindow |
||||
{ |
||||
public MainWindow() |
||||
{ |
||||
this.InitializeComponent(); |
||||
SetupWindowSize(); |
||||
InitializeComponent(); |
||||
RootNavigation.Navigating += (_, _) => Debug.WriteLine("Navigating"); |
||||
} |
||||
|
||||
|
||||
private void ButtonNavInstallPage_OnClick(object sender, RoutedEventArgs e) |
||||
{ |
||||
ContentFrame.Navigate(typeof(InstallPage)); |
||||
} |
||||
|
||||
private void ButtonNavLaunchPage_OnClick(object sender, RoutedEventArgs e) |
||||
{ |
||||
ContentFrame.Navigate(typeof(LaunchPage)); |
||||
} |
||||
|
||||
private void MainNavigationView_OnLoaded(object sender, RoutedEventArgs e) |
||||
{ |
||||
var home = MainNavigationView.MenuItems.OfType<NavigationViewItem>().First(); |
||||
SetCurrentNavigationViewItem(home); |
||||
} |
||||
|
||||
private void MainNavigationView_OnSelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args) |
||||
{ |
||||
SetCurrentNavigationViewItem(args.SelectedItemContainer as NavigationViewItem); |
||||
} |
||||
|
||||
private void SetCurrentNavigationViewItem(NavigationViewItem item) |
||||
{ |
||||
if (item == null || item.Tag == null) return; |
||||
|
||||
var tag = item.Tag.ToString(); |
||||
switch (tag) |
||||
{ |
||||
case "InstallPage": |
||||
ContentFrame.Navigate(typeof(InstallPage)); |
||||
break; |
||||
case "LaunchPage": |
||||
ContentFrame.Navigate(typeof(LaunchPage)); |
||||
break; |
||||
default: |
||||
throw new ArgumentException($"Invalid tag: {tag}"); |
||||
} |
||||
|
||||
MainNavigationView.Header = item.Content; |
||||
MainNavigationView.SelectedItem = item; |
||||
} |
||||
|
||||
private void SetupWindowSize() |
||||
private void MainWindow_OnLoaded(object sender, RoutedEventArgs e) |
||||
{ |
||||
IntPtr hWnd = WinRT.Interop.WindowNative.GetWindowHandle(this); |
||||
var windowId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(hWnd); |
||||
var appWindow = Microsoft.UI.Windowing.AppWindow.GetFromWindowId(windowId); |
||||
appWindow.Resize(new Windows.Graphics.SizeInt32 { Width = 1100, Height = 700 }); |
||||
RootNavigation.Navigate(typeof(LaunchPage)); |
||||
} |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue