Skip to content

Commit

Permalink
Bump WPF-UI to 3.0.0-preview11
Browse files Browse the repository at this point in the history
  • Loading branch information
valnoxy committed Nov 24, 2023
1 parent 36e6449 commit ec4c37d
Show file tree
Hide file tree
Showing 23 changed files with 220 additions and 280 deletions.
4 changes: 2 additions & 2 deletions Dive/Dive.UI/Dive.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<AssemblyName>Dive</AssemblyName>
<Company>Exploitox</Company>
<Authors>valnoxy</Authors>
<Version>1.0.0.489</Version>
<Version>1.0.0.508</Version>
<Copyright>Copyright © 2018 - 2023 Exploitox. All rights reserved.</Copyright>
<PackageProjectUrl>https://github.com/valnoxy/dive</PackageProjectUrl>
<RepositoryUrl>https://github.com/valnoxy/dive</RepositoryUrl>
Expand Down Expand Up @@ -66,7 +66,7 @@
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Goblinfactory.Konsole" Version="6.2.2" />
<PackageReference Include="ModernWpfUI" Version="0.9.6" />
<PackageReference Include="WPF-UI" Version="3.0.0-preview.1" />
<PackageReference Include="WPF-UI" Version="3.0.0-preview.11" />
<PackageReference Include="XamlAnimatedGif" Version="2.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Management" Version="8.0.0" />
Expand Down
84 changes: 65 additions & 19 deletions Dive/Dive.UI/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
Title="Dive" Height="620" Width="800"
MinHeight="620" MinWidth="800"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:pages="clr-namespace:Dive.UI.Pages"
WindowStartupLocation="CenterScreen"
ExtendsContentIntoTitleBar="True"
WindowBackdropType="Mica"
WindowCornerPreference="Round"
ResizeMode="NoResize"
ContentRendered="MainWindow_OnLoaded">

<Grid AllowDrop="True" Drop="UIElement_OnDrop" DragEnter="UIElement_OnDragEnter">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
Expand All @@ -26,12 +28,49 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<ui:NavigationView
x:Name="RootNavigation"
Grid.Column="0"
Margin="6,0,6,0"
Loaded="RootNavigation_OnLoaded"
AllowDrop="True"/>
<ui:NavigationView x:Name="RootNavigation" PaneDisplayMode="Top" IsBackButtonVisible="Collapsed" Margin="6,0" Grid.Row="0">
<ui:NavigationView.MenuItems>
<ui:NavigationViewItem Content="{DynamicResource Home}" TargetPageType="{x:Type pages:Dashboard}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="Home24" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem Content="{DynamicResource Apply}" TargetPageType="{x:Type pages:ApplyContent}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="WindowApps24" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem Content="{DynamicResource Capture}" TargetPageType="{x:Type pages:CaptureContent}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="Copy24" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem Content="{DynamicResource Cloud}" TargetPageType="{x:Type pages:CloudContent}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="Cloud24" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem Content="{DynamicResource Tweaks}" TargetPageType="{x:Type pages:TweaksContent}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="Toolbox24" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
</ui:NavigationView.MenuItems>

<ui:NavigationView.FooterMenuItems>
<ui:NavigationViewItem Click="ThemeSwitch_Click">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="PaintBrush24" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem TargetPageType="{x:Type pages:AboutPage}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="QuestionCircle24" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
</ui:NavigationView.FooterMenuItems>
</ui:NavigationView>


<StatusBar
x:Name="RootStatusBar"
Expand All @@ -53,55 +92,62 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
</StatusBar.ItemsPanel>

<StatusBarItem>
<ui:SymbolIcon Foreground="{DynamicResource TextFillColorSecondaryBrush}" Symbol="Person24" />
<ui:SymbolIcon FontSize="14" Foreground="{DynamicResource TextFillColorSecondaryBrush}" Symbol="Person24" />
</StatusBarItem>
<StatusBarItem Grid.Column="1" Margin="0,0,4,0">
<TextBlock x:Name="UserName" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
</StatusBarItem>

<StatusBarItem Grid.Column="2" Margin="4,0,0,0">
<ui:SymbolIcon Foreground="{DynamicResource TextFillColorSecondaryBrush}" Symbol="BranchFork24" />
<ui:SymbolIcon FontSize="14" Foreground="{DynamicResource TextFillColorSecondaryBrush}" Symbol="BranchFork24" />
</StatusBarItem>
<StatusBarItem Grid.Column="3" Margin="0,0,4,0">
<TextBlock x:Name="Branch" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
</StatusBarItem>

<StatusBarItem Grid.Column="4" Margin="4,0,0,0">
<ui:SymbolIcon Foreground="{DynamicResource TextFillColorSecondaryBrush}" Symbol="Info12" />
<ui:SymbolIcon FontSize="14" Foreground="{DynamicResource TextFillColorSecondaryBrush}" Symbol="Info24" />
</StatusBarItem>
<StatusBarItem Grid.Column="5" Margin="0,0,4,0">
<TextBlock x:Name="Version" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
</StatusBarItem>

<StatusBarItem Grid.Column="6" Margin="4,0,0,0">
<ui:SymbolIcon Foreground="{DynamicResource TextFillColorSecondaryBrush}" Symbol="CalendarLtr12" />
<StatusBarItem Grid.Column="6" Margin="4,0,0,0" MouseDoubleClick="CommandLine_Click">
<ui:SymbolIcon FontSize="14" Foreground="{DynamicResource TextFillColorSecondaryBrush}" Symbol="WindowConsole20" />
</StatusBarItem>

<StatusBarItem Grid.Column="7" Margin="4,0,0,0">
<ui:SymbolIcon FontSize="14" Foreground="{DynamicResource TextFillColorSecondaryBrush}" Symbol="CalendarLtr16" />
</StatusBarItem>
<StatusBarItem Grid.Column="7" Margin="0,0,4,0">
<StatusBarItem Grid.Column="8" Margin="0,0,4,0">
<TextBlock x:Name="Date" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
</StatusBarItem>

<StatusBarItem Grid.Column="8" Margin="4,0,0,0">
<ui:SymbolIcon Foreground="{DynamicResource TextFillColorSecondaryBrush}" Symbol="Clock12" />
<StatusBarItem Grid.Column="9" Margin="4,0,0,0">
<ui:SymbolIcon FontSize="14" Foreground="{DynamicResource TextFillColorSecondaryBrush}" Symbol="Clock16" />
</StatusBarItem>
<StatusBarItem Grid.Column="9" Margin="0,0,4,0">
<StatusBarItem Grid.Column="10" Margin="0,0,4,0">
<TextBlock x:Name="Time" Foreground="{DynamicResource TextFillColorSecondaryBrush}" />
</StatusBarItem>

</StatusBar>
</Grid>

<ui:TitleBar
Title="Dive - Deployment is very easy"
ShowMaximize="False"
Icon="pack://application:,,,/Dive.ico"
ShowMinimize="False"
Grid.Row="0"/>
ShowMaximize="False"
Grid.Row="0">
<ui:TitleBar.Icon>
<ui:ImageIcon Source="pack://application:,,,/dive.ico" />
</ui:TitleBar.Icon>
</ui:TitleBar>

<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
Expand Down
100 changes: 7 additions & 93 deletions Dive/Dive.UI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
using System.Security.Principal;
using System.Windows;
using System.Windows.Threading;
using Wpf.Ui.Common;
using Wpf.Ui.Controls;
using Wpf.Ui.Controls.Navigation;

namespace Dive.UI
{
Expand All @@ -25,7 +23,7 @@ public partial class MainWindow
public MainWindow()
{
InitializeComponent();

#if DEBUG
DebugString.Visibility = Visibility.Visible;
DebugString.Text = "Debug build - This is not a production ready build.";
Expand Down Expand Up @@ -58,95 +56,6 @@ private void UpdateTimeAndDate_Tick(object sender, EventArgs e)
Date.Text = DateTime.Now.ToShortDateString();
}

private void RootNavigation_OnLoaded(object sender, RoutedEventArgs e)
{
// Build navigation menu

var navItems = new List<INavigationViewItem>
{
new NavigationViewItem
{
Content = Common.LocalizationManager.LocalizeValue("Home"),
Icon = new SymbolIcon
{
Symbol = SymbolRegular.Home24
},
TargetPageTag = "dashboard",
TargetPageType = new TypeDelegator(typeof(Pages.Dashboard)),

},
new NavigationViewItem
{
Content = Common.LocalizationManager.LocalizeValue("Apply"),
Icon = new SymbolIcon
{
Symbol = SymbolRegular.WindowApps24
},
TargetPageTag = "apply",
TargetPageType = new TypeDelegator(typeof(Pages.ApplyContent))
},
new NavigationViewItem
{
Content = Common.LocalizationManager.LocalizeValue("Capture"),
Icon = new SymbolIcon
{
Symbol = SymbolRegular.Copy24
},
TargetPageTag = "capture",
TargetPageType = new TypeDelegator(typeof(Pages.CaptureContent))
},
new NavigationViewItem
{
Content = Common.LocalizationManager.LocalizeValue("Cloud"),
Icon = new SymbolIcon
{
Symbol = SymbolRegular.Cloud24
},
TargetPageTag = "cloud",
TargetPageType = new TypeDelegator(typeof(Pages.CloudContent))
},
new NavigationViewItem
{
Content = Common.LocalizationManager.LocalizeValue("Tweaks"),
Icon = new SymbolIcon
{
Symbol = SymbolRegular.Toolbox24
},
TargetPageTag = "tweaks",
TargetPageType = new TypeDelegator(typeof(Pages.TweaksContent))
}
};
var footerNavItems = new List<INavigationViewItem>();
var consoleItem = new NavigationViewItem
{
Content = Common.LocalizationManager.LocalizeValue("Console"),
Icon = new SymbolIcon
{
Symbol = SymbolRegular.WindowConsole20
},
TargetPageTag = "console",
};
footerNavItems.Add(consoleItem);
consoleItem.Click += CommandLine_Click;
footerNavItems.Add(new NavigationViewItem
{
Content = Common.LocalizationManager.LocalizeValue("About"),
Icon = new SymbolIcon
{
Symbol = SymbolRegular.QuestionCircle24
},
TargetPageTag = "about",
TargetPageType = new TypeDelegator(typeof(Pages.AboutPage))
});

RootNavigation.MenuItems = navItems;
RootNavigation.FooterMenuItems = footerNavItems;

RootNavigation.PaneDisplayMode = NavigationViewPaneDisplayMode.Top;
RootNavigation.IsBackButtonVisible = NavigationViewBackButtonVisible.Collapsed;
RootNavigation.Navigate(new TypeDelegator(typeof(Pages.AboutPage)));
}

private void CommandLine_Click(object sender, RoutedEventArgs e)
{
var handle = App.GetConsoleWindow();
Expand All @@ -165,7 +74,7 @@ private void CommandLine_Click(object sender, RoutedEventArgs e)

private void MainWindow_OnLoaded(object? sender, EventArgs eventArgs)
{
RootNavigation.Navigate("dashboard"); // Workaround
RootNavigation.Navigate(typeof(Pages.Dashboard));
}

private void UIElement_OnDrop(object sender, DragEventArgs e)
Expand All @@ -177,5 +86,10 @@ private void UIElement_OnDragEnter(object sender, DragEventArgs e)
{
Common.Debug.WriteLine("DragEnter");
}

private void ThemeSwitch_Click(object sender, RoutedEventArgs e)
{
WindowBackdropType = WindowBackdropType == WindowBackdropType.Mica ? WindowBackdropType.Tabbed : WindowBackdropType.Mica;
}
}
}
16 changes: 8 additions & 8 deletions Dive/Dive.UI/Pages/AboutPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</Grid>

<Grid Grid.Row="2">
<ui:Card Height="203">
<ui:Card Height="170">
<StackPanel>
<Label x:Name="LabelTitle"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Expand Down Expand Up @@ -77,7 +77,6 @@
HorizontalAlignment="Left"
Margin="0,-5,0,0"
FontFamily="Segoe UI Variable Display"/>
<Label x:Name="ValueCopyright" Foreground="{DynamicResource TextFillColorPrimaryBrush}" Content="Copyright © Exploitox." FontSize="15" VerticalAlignment="Top" HorizontalAlignment="Left" FontFamily="Segoe UI Variable Display"/>
<TextBlock x:Name="LicenseText" Foreground="{DynamicResource TextFillColorTertiaryBrush}" VerticalAlignment="Top" FontSize="15" TextWrapping="WrapWithOverflow" FontFamily="Segoe UI Variable Display" Height="100">
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -97,13 +96,14 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" VerticalAlignment="Center">
<TextBlock
FontSize="13"
FontWeight="Medium"
Text="Dive is up-to-date!" />
<StackPanel Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Orientation="Horizontal">
<ui:Image Source="pack://application:,,,/Dive.ico" Width="30" Margin="0,0,10,0"/>
<StackPanel>
<Label Foreground="{DynamicResource TextFillColorPrimaryBrush}" Content="Dive" FontSize="15" Margin="0,0,0,-5"/>
<Label x:Name="ValueCopyright" Foreground="{DynamicResource TextFillColorPrimaryBrush}" Content="Copyright © Exploitox." FontSize="15" FontFamily="Segoe UI Variable Display"/>
</StackPanel>
</StackPanel>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<StackPanel Grid.Column="1" Orientation="Horizontal">
<ui:Button Margin="0,0,8,0"
Content="Website"
Click="Homepage_OnClick"/>
Expand Down
2 changes: 1 addition & 1 deletion Dive/Dive.UI/Pages/ApplyPages/CloudSelectStep.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
Click="ReloadBtn_Clicked"
HorizontalAlignment="Right"
Content="{DynamicResource ReloadBtn}"
Icon="ArrowReset24"
Icon="{ui:SymbolIcon ArrowReset24}"
Margin="0,0,0,0"/>
</Grid>

Expand Down
6 changes: 1 addition & 5 deletions Dive/Dive.UI/Pages/ApplyPages/DeploymentSettingsStep.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<UserControl x:Class="Dive.UI.Pages.ApplyPages.DeploymentSettingsStep"
<UserControl x:Class="Dive.UI.Pages.ApplyPages.DeploymentSettingsStepNew"
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"
Expand Down Expand Up @@ -35,10 +35,6 @@
<ScrollViewer VerticalScrollBarVisibility="Auto" Margin="0">

</ScrollViewer>
<ui:Snackbar
x:Name="RootSnackbar"
MaxWidth="600"
Timeout="15000" />
</Grid>
</Grid>
</UserControl>
4 changes: 2 additions & 2 deletions Dive/Dive.UI/Pages/ApplyPages/DeploymentSettingsStep.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ namespace Dive.UI.Pages.ApplyPages
/// <summary>
/// Interaktionslogik für DeploymentSettingsStep.xaml
/// </summary>
public partial class DeploymentSettingsStep : UserControl
public partial class DeploymentSettingsStepNew : UserControl
{
public DeploymentSettingsStep()
public DeploymentSettingsStepNew()
{
InitializeComponent();
}
Expand Down
Loading

0 comments on commit ec4c37d

Please sign in to comment.