From ddac7fe9a1b4c2a6d2e7690f572aaef499555134 Mon Sep 17 00:00:00 2001 From: Nguyen Duy Date: Tue, 11 Mar 2025 09:26:30 +0700 Subject: [PATCH] fix(ui): update visual, fix xaml logic --- app/App.xaml | 19 +++++++++++ app/Components/Button.xaml | 59 ++++++++++++++++----------------- app/Components/Button.xaml.cs | 5 ++- app/Components/CustomPage.xaml | 20 +++++------ app/Components/DisplayItem.xaml | 28 ++++++++++------ app/MainWindow.xaml | 47 +++++--------------------- app/Tray.cs | 6 ++-- 7 files changed, 89 insertions(+), 95 deletions(-) diff --git a/app/App.xaml b/app/App.xaml index 21b93c6..92377ad 100644 --- a/app/App.xaml +++ b/app/App.xaml @@ -9,6 +9,25 @@ + + 4 + 8 + + + \ No newline at end of file diff --git a/app/Components/Button.xaml b/app/Components/Button.xaml index 5e43b8d..866ff38 100644 --- a/app/Components/Button.xaml +++ b/app/Components/Button.xaml @@ -6,38 +6,8 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:ParsecVDisplay.Components" mc:Ignorable="d" - d:DesignHeight="120" d:DesignWidth="216" - d:Background="Black" + d:DesignHeight="40" d:DesignWidth="120" > - - - + + + \ No newline at end of file diff --git a/app/Components/Button.xaml.cs b/app/Components/Button.xaml.cs index 3eb78c7..b157bef 100644 --- a/app/Components/Button.xaml.cs +++ b/app/Components/Button.xaml.cs @@ -7,7 +7,10 @@ namespace ParsecVDisplay.Components public partial class Button : UserControl { public event EventHandler Click; - public object Children { get; set; } + public new object Content { get; set; } + + public static readonly new DependencyProperty ContentProperty = + DependencyProperty.Register("Content", typeof(object), typeof(Button), new PropertyMetadata(null)); public Button() { diff --git a/app/Components/CustomPage.xaml b/app/Components/CustomPage.xaml index 41a4eea..a979284 100644 --- a/app/Components/CustomPage.xaml +++ b/app/Components/CustomPage.xaml @@ -89,17 +89,15 @@ - - - - - - - - - - - + + + + + + + + + diff --git a/app/Components/DisplayItem.xaml b/app/Components/DisplayItem.xaml index f121612..78b98c5 100644 --- a/app/Components/DisplayItem.xaml +++ b/app/Components/DisplayItem.xaml @@ -6,24 +6,31 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:ParsecVDisplay.Components" mc:Ignorable="d" - Width="160" Height="100" + Width="180" Height="110" d:Background="Black" > - - - - - - - - - + + + + + + + + @@ -53,4 +60,5 @@ + \ No newline at end of file diff --git a/app/MainWindow.xaml b/app/MainWindow.xaml index 67ac7ec..e43db5b 100644 --- a/app/MainWindow.xaml +++ b/app/MainWindow.xaml @@ -32,60 +32,29 @@ - - - - + + - - - - - + + - - - + - - - + - + - + diff --git a/app/Tray.cs b/app/Tray.cs index 39661a6..9774868 100644 --- a/app/Tray.cs +++ b/app/Tray.cs @@ -257,9 +257,9 @@ namespace ParsecVDisplay var caption = $"{Program.AppName} v{Program.AppVersion}"; MessageBox.Show(Owner, - $"{Vdd.Core.ADAPTER}\n" + - $"Version: {version}\n" + - $"{App.GetTranslation("t_msg_driver_status")}: {status}", + $"{Vdd.Core.ADAPTER}\n\n" + + $"- Version: {version}\n" + + $"- {App.GetTranslation("t_msg_driver_status")}: {status}", caption, MessageBoxButtons.OK, MessageBoxIcon.Information); }