From da742d15631ee67132750ed93a18ab8a3b572f77 Mon Sep 17 00:00:00 2001 From: Richasy Date: Tue, 24 Sep 2024 11:31:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=88=B0=20WinAppSDK=201.6?= =?UTF-8?q?=20(#74)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update * Fix * Update --- src/App.ruleset | 12 ++ .../RodelAudio.Console.csproj | 10 +- .../RodelChat.Console.csproj | 8 +- .../RodelDraw.Console.csproj | 60 ++++---- .../RodelTranslate.Console.csproj | 6 +- .../RodelAgent.Context.csproj | 6 +- .../RodelAgent.Models.csproj | 6 +- .../RodelAgent.Statics.csproj | 2 +- .../RodelAudio.Models.csproj | 4 +- src/Core/RodelChat.Core/RodelChat.Core.csproj | 2 +- .../RodelChat.Models/RodelChat.Models.csproj | 4 +- .../RodelDraw.Models/RodelDraw.Models.csproj | 4 +- .../RodelTranslate.Core.csproj | 2 +- .../RodelTranslate.Interfaces.csproj | 2 +- .../RodelTranslate.Models.csproj | 4 +- .../Constants/SettingNames.cs | 1 + .../RodelAgent.UI.ResourceGenerator.csproj | 4 +- src/Desktop/RodelAgent.UI/App.xaml | 2 + src/Desktop/RodelAgent.UI/App.xaml.cs | 72 ++++++---- .../Controls/Audio/AudioHistorySection.xaml | 4 +- .../Audio/AudioSessionItemControl.xaml | 8 +- .../Audio/AudioSessionItemControl.xaml.cs | 12 +- .../Controls/Chat/ChatGroupHistory.xaml.cs | 6 +- .../Controls/Chat/ChatGroupInput.xaml.cs | 6 +- .../Chat/ChatMessageItemControl.xaml.cs | 4 +- .../Chat/ChatProviderOptionPanel.xaml.cs | 62 ++++----- .../Controls/Chat/ChatSessionHistory.xaml.cs | 6 +- .../Controls/Chat/ChatSessionInput.xaml.cs | 6 +- .../Controls/Chat/PresetDetailPanel.xaml | 2 +- .../Controls/Chat/PresetGroupPanel.xaml.cs | 2 +- .../Controls/Chat/PresetModelPanel.xaml.cs | 2 +- .../Chat/SystemInstructionPanel.xaml.cs | 4 +- .../Controls/Draw/DrawHistorySection.xaml | 4 +- .../Controls/Draw/DrawSessionItemControl.xaml | 8 +- .../Draw/DrawSessionItemControl.xaml.cs | 16 +-- .../Draw/DrawSessionPresenter.xaml.cs | 6 +- .../Settings/AboutSettingSection.xaml | 18 +-- .../AliTranslateConfigSettingSection.xaml | 22 +-- .../AliTranslateConfigSettingSection.xaml.cs | 4 +- .../Settings/AppLogSettingSection.xaml | 10 +- .../AzureOpenAIAudioConfigSettingSection.xaml | 26 ++-- ...ureOpenAIAudioConfigSettingSection.xaml.cs | 4 +- .../AzureOpenAIChatConfigSettingSection.xaml | 30 ++-- ...zureOpenAIChatConfigSettingSection.xaml.cs | 4 +- .../AzureOpenAIDrawConfigSettingSection.xaml | 30 ++-- ...zureOpenAIDrawConfigSettingSection.xaml.cs | 4 +- .../AzureSpeechConfigSettingSection.xaml | 22 +-- .../AzureSpeechConfigSettingSection.xaml.cs | 4 +- .../AzureTranslateConfigSettingSection.xaml | 22 +-- ...AzureTranslateConfigSettingSection.xaml.cs | 4 +- .../DouBaoChatConfigSettingSection.xaml | 22 +-- .../DouBaoChatConfigSettingSection.xaml.cs | 4 +- .../HunYuanChatConfigSettingSection.xaml | 30 ++-- .../HunYuanChatConfigSettingSection.xaml.cs | 4 +- .../HunYuanDrawConfigSettingSection.xaml | 30 ++-- .../HunYuanDrawConfigSettingSection.xaml.cs | 4 +- .../Settings/LanguageSettingSection.xaml | 10 +- .../Settings/LibrarySettingSection.xaml | 10 +- .../ModelClientConfigSettingSection.xaml | 26 ++-- .../ModelClientConfigSettingSection.xaml.cs | 4 +- ...delClientEndpointConfigSettingSection.xaml | 30 ++-- ...ClientEndpointConfigSettingSection.xaml.cs | 4 +- .../OpenAIAudioConfigSettingSection.xaml | 30 ++-- .../OpenAIAudioConfigSettingSection.xaml.cs | 4 +- .../OpenAIChatConfigSettingSection.xaml | 34 ++--- .../OpenAIChatConfigSettingSection.xaml.cs | 4 +- .../OpenAIDrawConfigSettingSection.xaml | 34 ++--- .../OpenAIDrawConfigSettingSection.xaml.cs | 4 +- .../QianFanChatConfigSettingSection.xaml | 30 ++-- .../QianFanChatConfigSettingSection.xaml.cs | 4 +- .../QianFanDrawConfigSettingSection.xaml | 30 ++-- .../QianFanDrawConfigSettingSection.xaml.cs | 4 +- .../SparkDeskChatConfigSettingSection.xaml | 34 ++--- .../SparkDeskChatConfigSettingSection.xaml.cs | 4 +- .../SparkDeskDrawConfigSettingSection.xaml | 34 ++--- .../SparkDeskDrawConfigSettingSection.xaml.cs | 4 +- .../TencentTranslateConfigSettingSection.xaml | 22 +-- ...ncentTranslateConfigSettingSection.xaml.cs | 4 +- .../Settings/ThemeSettingSection.xaml | 18 +-- ...ranslateAppClientConfigSettingSection.xaml | 22 +-- ...slateAppClientConfigSettingSection.xaml.cs | 4 +- .../TranslateRecordSettingSection.xaml | 10 +- .../VolcanoTranslateConfigSettingSection.xaml | 22 +-- ...lcanoTranslateConfigSettingSection.xaml.cs | 4 +- .../Audio/AudioClientConfigSection.xaml.cs | 4 +- .../AudioClientEndpointConfigSection.xaml.cs | 4 +- .../Audio/AudioConfigurationSection.xaml.cs | 4 +- .../AzureOpenAIAudioConfigSection.xaml.cs | 4 +- .../AzureSpeechAudioConfigSection.xaml.cs | 4 +- .../Audio/OpenAIAudioConfigSection.xaml.cs | 4 +- .../Chat/AzureOpenAIChatConfigSection.xaml.cs | 4 +- .../Chat/ChatClientConfigSection.xaml.cs | 4 +- .../ChatClientEndpointConfigSection.xaml.cs | 4 +- .../Chat/ChatConfigurationSection.xaml.cs | 4 +- .../Chat/DouBaoChatConfigSection.xaml.cs | 4 +- .../Chat/HunYuanChatConfigSection.xaml.cs | 4 +- .../Chat/OpenAIChatConfigSection.xaml.cs | 4 +- .../Chat/QianFanChatConfigSection.xaml.cs | 4 +- .../Chat/SparkDeskChatConfigSection.xaml.cs | 4 +- .../Draw/AzureOpenAIDrawConfigSection.xaml.cs | 4 +- .../Draw/DrawClientConfigSection.xaml.cs | 4 +- .../DrawClientEndpointConfigSection.xaml.cs | 4 +- .../Draw/DrawConfigurationSection.xaml.cs | 4 +- .../Draw/HunYuanDrawConfigSection.xaml.cs | 4 +- .../Draw/OpenAIDrawConfigSection.xaml.cs | 4 +- .../Draw/QianFanDrawConfigSection.xaml.cs | 4 +- .../Draw/SparkDeskDrawConfigSection.xaml.cs | 4 +- .../AliTranslateConfigSection.xaml.cs | 4 +- .../AzureTranslateConfigSection.xaml.cs | 4 +- .../TencentTranslateConfigSection.xaml.cs | 4 +- .../TranslateAppClientConfigSection.xaml.cs | 4 +- .../TranslateClientConfigSection.xaml.cs | 4 +- .../TranslateConfigurationSection.xaml.cs | 4 +- .../VolcanoTranslateConfigSection.xaml.cs | 4 +- .../Translation/SourceTextSection.xaml.cs | 6 +- .../TranslateSessionItemControl.xaml | 8 +- .../TranslateSessionItemControl.xaml.cs | 13 +- .../Translation/TranslationServiceHeader.xaml | 3 +- .../RodelAgent.UI/Package.appxmanifest | 5 + .../RodelAgent.UI/Pages/AudioServicePage.xaml | 4 +- .../RodelAgent.UI/Pages/ChatServicePage.xaml | 2 +- .../RodelAgent.UI/Pages/DrawServicePage.xaml | 4 +- .../Pages/Internal/PromptTestPage.xaml | 13 ++ .../Pages/Internal/PromptTestPage.xaml.cs | 14 ++ .../Resources/en-US/Resources.resw | 3 + .../Resources/zh-Hans-CN/Resources.resw | 3 + .../RodelAgent.UI/RodelAgent.UI.csproj | 45 +++--- .../ChatSessionViewModel.Properties.cs | 5 + .../ChatSessionViewModel.cs | 1 + .../Components/NavigationViewModel.cs | 27 ++-- .../ViewModels/Items/AudioSessionViewModel.cs | 19 +++ .../Items/DrawSessionItemViewModel.cs | 19 +++ .../Items/TranslateSessionItemViewModel.cs | 19 +++ .../AudioServicePageViewModel.Properties.cs | 3 +- .../AudioServicePageViewModel.Services.cs | 14 +- .../DrawServicePageViewModel.Properties.cs | 3 +- .../DrawServicePageViewModel.Services.cs | 14 +- ...ranslateServicePageViewModel.Properties.cs | 3 +- .../TranslateServicePageViewModel.Services.cs | 7 +- src/Directory.Build.props | 5 +- src/Directory.Packages.props | 131 ++++++++++++++++++ src/Libs/WinUI.Share | 2 +- src/RodelAgent.sln | 4 +- .../RodelAgent.Samples.Plugin.csproj | 4 +- 144 files changed, 948 insertions(+), 686 deletions(-) create mode 100644 src/Desktop/RodelAgent.UI/Pages/Internal/PromptTestPage.xaml create mode 100644 src/Desktop/RodelAgent.UI/Pages/Internal/PromptTestPage.xaml.cs create mode 100644 src/Desktop/RodelAgent.UI/ViewModels/Items/AudioSessionViewModel.cs create mode 100644 src/Desktop/RodelAgent.UI/ViewModels/Items/DrawSessionItemViewModel.cs create mode 100644 src/Desktop/RodelAgent.UI/ViewModels/Items/TranslateSessionItemViewModel.cs create mode 100644 src/Directory.Packages.props diff --git a/src/App.ruleset b/src/App.ruleset index 68d91f4e..1f87eb35 100644 --- a/src/App.ruleset +++ b/src/App.ruleset @@ -89,6 +89,18 @@ + + + + + + + + + + + + diff --git a/src/Console/RodelAudio.Console/RodelAudio.Console.csproj b/src/Console/RodelAudio.Console/RodelAudio.Console.csproj index 3a3131ef..810c97ea 100644 --- a/src/Console/RodelAudio.Console/RodelAudio.Console.csproj +++ b/src/Console/RodelAudio.Console/RodelAudio.Console.csproj @@ -7,11 +7,11 @@ enable - - - - - + + + + + diff --git a/src/Console/RodelChat.Console/RodelChat.Console.csproj b/src/Console/RodelChat.Console/RodelChat.Console.csproj index a21c37e9..aa42976c 100644 --- a/src/Console/RodelChat.Console/RodelChat.Console.csproj +++ b/src/Console/RodelChat.Console/RodelChat.Console.csproj @@ -8,10 +8,10 @@ - - - - + + + + diff --git a/src/Console/RodelDraw.Console/RodelDraw.Console.csproj b/src/Console/RodelDraw.Console/RodelDraw.Console.csproj index 04a1272f..4c61c468 100644 --- a/src/Console/RodelDraw.Console/RodelDraw.Console.csproj +++ b/src/Console/RodelDraw.Console/RodelDraw.Console.csproj @@ -7,39 +7,39 @@ enable - - - - - + + + + + - - - - - - - + + + + + + + - - - True - True - DrawService.resx - - + + + True + True + DrawService.resx + + - - - ResXFileCodeGenerator - DrawService.Designer.cs - - + + + ResXFileCodeGenerator + DrawService.Designer.cs + + - - - PreserveNewest - - + + + PreserveNewest + + diff --git a/src/Console/RodelTranslate.Console/RodelTranslate.Console.csproj b/src/Console/RodelTranslate.Console/RodelTranslate.Console.csproj index 62b9e477..2e2b0bbe 100644 --- a/src/Console/RodelTranslate.Console/RodelTranslate.Console.csproj +++ b/src/Console/RodelTranslate.Console/RodelTranslate.Console.csproj @@ -8,9 +8,9 @@ - - - + + + diff --git a/src/Core/RodelAgent.Context/RodelAgent.Context.csproj b/src/Core/RodelAgent.Context/RodelAgent.Context.csproj index 5d228764..cf02fff3 100644 --- a/src/Core/RodelAgent.Context/RodelAgent.Context.csproj +++ b/src/Core/RodelAgent.Context/RodelAgent.Context.csproj @@ -7,12 +7,12 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Core/RodelAgent.Models/RodelAgent.Models.csproj b/src/Core/RodelAgent.Models/RodelAgent.Models.csproj index d7768097..3614f47b 100644 --- a/src/Core/RodelAgent.Models/RodelAgent.Models.csproj +++ b/src/Core/RodelAgent.Models/RodelAgent.Models.csproj @@ -7,8 +7,8 @@ - - - + + + diff --git a/src/Core/RodelAgent.Statics/RodelAgent.Statics.csproj b/src/Core/RodelAgent.Statics/RodelAgent.Statics.csproj index bbf25784..f413337c 100644 --- a/src/Core/RodelAgent.Statics/RodelAgent.Statics.csproj +++ b/src/Core/RodelAgent.Statics/RodelAgent.Statics.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/Core/RodelAudio.Models/RodelAudio.Models.csproj b/src/Core/RodelAudio.Models/RodelAudio.Models.csproj index df3c8d08..53aa2b27 100644 --- a/src/Core/RodelAudio.Models/RodelAudio.Models.csproj +++ b/src/Core/RodelAudio.Models/RodelAudio.Models.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/src/Core/RodelChat.Core/RodelChat.Core.csproj b/src/Core/RodelChat.Core/RodelChat.Core.csproj index ffeb5fe2..e603c5a4 100644 --- a/src/Core/RodelChat.Core/RodelChat.Core.csproj +++ b/src/Core/RodelChat.Core/RodelChat.Core.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - SKEXP0110;SKEXP0010;SKEXP0001 + $(NoWarn);SKEXP0110 diff --git a/src/Core/RodelChat.Models/RodelChat.Models.csproj b/src/Core/RodelChat.Models/RodelChat.Models.csproj index 76f89943..bce8e538 100644 --- a/src/Core/RodelChat.Models/RodelChat.Models.csproj +++ b/src/Core/RodelChat.Models/RodelChat.Models.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/src/Core/RodelDraw.Models/RodelDraw.Models.csproj b/src/Core/RodelDraw.Models/RodelDraw.Models.csproj index 46927b52..4eda58cf 100644 --- a/src/Core/RodelDraw.Models/RodelDraw.Models.csproj +++ b/src/Core/RodelDraw.Models/RodelDraw.Models.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/src/Core/RodelTranslate.Core/RodelTranslate.Core.csproj b/src/Core/RodelTranslate.Core/RodelTranslate.Core.csproj index b82d14e7..f10cf88f 100644 --- a/src/Core/RodelTranslate.Core/RodelTranslate.Core.csproj +++ b/src/Core/RodelTranslate.Core/RodelTranslate.Core.csproj @@ -19,6 +19,6 @@ - + diff --git a/src/Core/RodelTranslate.Interfaces/RodelTranslate.Interfaces.csproj b/src/Core/RodelTranslate.Interfaces/RodelTranslate.Interfaces.csproj index 0788afc4..2ea0a8d7 100644 --- a/src/Core/RodelTranslate.Interfaces/RodelTranslate.Interfaces.csproj +++ b/src/Core/RodelTranslate.Interfaces/RodelTranslate.Interfaces.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/Core/RodelTranslate.Models/RodelTranslate.Models.csproj b/src/Core/RodelTranslate.Models/RodelTranslate.Models.csproj index c54b6b7d..b84ad885 100644 --- a/src/Core/RodelTranslate.Models/RodelTranslate.Models.csproj +++ b/src/Core/RodelTranslate.Models/RodelTranslate.Models.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/src/Desktop/RodelAgent.UI.Models/Constants/SettingNames.cs b/src/Desktop/RodelAgent.UI.Models/Constants/SettingNames.cs index b67279ab..edac954e 100644 --- a/src/Desktop/RodelAgent.UI.Models/Constants/SettingNames.cs +++ b/src/Desktop/RodelAgent.UI.Models/Constants/SettingNames.cs @@ -48,5 +48,6 @@ public enum SettingNames IsDrawHistoryColumnManualHide, IsAudioHistoryColumnManualHide, LastSelectedFeaturePage, + IsInternalPromptTest, } #pragma warning restore CS1591 // 缺少对公共可见类型或成员的 XML 注释 diff --git a/src/Desktop/RodelAgent.UI.ResourceGenerator/RodelAgent.UI.ResourceGenerator.csproj b/src/Desktop/RodelAgent.UI.ResourceGenerator/RodelAgent.UI.ResourceGenerator.csproj index ef71f220..ddf1ca07 100644 --- a/src/Desktop/RodelAgent.UI.ResourceGenerator/RodelAgent.UI.ResourceGenerator.csproj +++ b/src/Desktop/RodelAgent.UI.ResourceGenerator/RodelAgent.UI.ResourceGenerator.csproj @@ -7,10 +7,10 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Desktop/RodelAgent.UI/App.xaml b/src/Desktop/RodelAgent.UI/App.xaml index a8382e64..160f7971 100644 --- a/src/Desktop/RodelAgent.UI/App.xaml +++ b/src/Desktop/RodelAgent.UI/App.xaml @@ -54,6 +54,8 @@ + 850 + diff --git a/src/Desktop/RodelAgent.UI/App.xaml.cs b/src/Desktop/RodelAgent.UI/App.xaml.cs index d8109afa..a7c363ca 100644 --- a/src/Desktop/RodelAgent.UI/App.xaml.cs +++ b/src/Desktop/RodelAgent.UI/App.xaml.cs @@ -1,5 +1,6 @@ // Copyright (c) Rodel. All rights reserved. +using System.Web; using H.NotifyIcon; using Microsoft.UI.Dispatching; using Microsoft.Windows.AppLifecycle; @@ -126,47 +127,60 @@ private void InitializeTrayIcon() private async Task LaunchWindowAsync(IActivatedEventArgs args = default) { + var instance = AppInstance.FindOrRegisterForKey(Id); if (args is IProtocolActivatedEventArgs protocolArgs && !string.IsNullOrEmpty(protocolArgs.Uri.Host)) { - // 处理协议启动. + if (protocolArgs.Uri.Host == "internal") + { + var query = protocolArgs.Uri.Query; + var queryItems = HttpUtility.ParseQueryString(query); + var feature = queryItems["feature"]?.ToLower() ?? string.Empty; + if (!string.IsNullOrEmpty(feature)) + { + if (feature == "prompt-test") + { + SettingsToolkit.WriteLocalSetting(SettingNames.IsInternalPromptTest, true); + } + else if(feature == "clear") + { + SettingsToolkit.WriteLocalSetting(SettingNames.IsInternalPromptTest, false); + } + } + } } - else + + // If the current instance is not the previously registered instance + if (!instance.IsCurrent) { - var instance = AppInstance.FindOrRegisterForKey(Id); + var activatedArgs = AppInstance.GetCurrent().GetActivatedEventArgs(); - // If the current instance is not the previously registered instance - if (!instance.IsCurrent) - { - var activatedArgs = AppInstance.GetCurrent().GetActivatedEventArgs(); + // Redirect to the existing instance + await instance.RedirectActivationToAsync(activatedArgs); - // Redirect to the existing instance - await instance.RedirectActivationToAsync(activatedArgs); + // Kill the current instance + Current.Exit(); + return; + } - // Kill the current instance - Current.Exit(); - return; - } + var shouldSkipStartup = SettingsToolkit.ReadLocalSetting(SettingNames.ShouldSkipStartup, false); + if (!shouldSkipStartup) + { + var window = new StartupWindow(); + window.Activate(); + } + else + { + _window = new MainWindow(); + _window.Closed += OnMainWindowClosedAsync; - var shouldSkipStartup = SettingsToolkit.ReadLocalSetting(SettingNames.ShouldSkipStartup, false); - if (!shouldSkipStartup) + HandleCloseEvents = SettingsToolkit.ReadLocalSetting(SettingNames.HideWhenCloseWindow, true); + if (HandleCloseEvents) { - var window = new StartupWindow(); - window.Activate(); + InitializeTrayIcon(); } - else - { - _window = new MainWindow(); - _window.Closed += OnMainWindowClosedAsync; - HandleCloseEvents = SettingsToolkit.ReadLocalSetting(SettingNames.HideWhenCloseWindow, true); - if (HandleCloseEvents) - { - InitializeTrayIcon(); - } - - _window.Activate(); - } + _window.Activate(); } } diff --git a/src/Desktop/RodelAgent.UI/Controls/Audio/AudioHistorySection.xaml b/src/Desktop/RodelAgent.UI/Controls/Audio/AudioHistorySection.xaml index e92aff60..91b99433 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Audio/AudioHistorySection.xaml +++ b/src/Desktop/RodelAgent.UI/Controls/Audio/AudioHistorySection.xaml @@ -3,10 +3,10 @@ x:Class="RodelAgent.UI.Controls.Audio.AudioHistorySection" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:client="using:RodelAudio.Models.Client" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ext="using:RodelAgent.UI.Extensions" xmlns:ic="using:FluentIcons.WinUI" + xmlns:items="using:RodelAgent.UI.ViewModels.Items" xmlns:local="using:RodelAgent.UI.Controls.Audio" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> @@ -63,7 +63,7 @@ - + diff --git a/src/Desktop/RodelAgent.UI/Controls/Audio/AudioSessionItemControl.xaml b/src/Desktop/RodelAgent.UI/Controls/Audio/AudioSessionItemControl.xaml index 4d121fe3..ab3f8210 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Audio/AudioSessionItemControl.xaml +++ b/src/Desktop/RodelAgent.UI/Controls/Audio/AudioSessionItemControl.xaml @@ -38,11 +38,11 @@ Foreground="{ThemeResource TextFillColorSecondaryBrush}" MaxLines="2" Style="{StaticResource CaptionTextBlockStyle}" - Text="{x:Bind ViewModel.Text, Mode=OneWay}" + Text="{x:Bind ViewModel.Data.Text, Mode=OneWay}" TextTrimming="CharacterEllipsis" TextWrapping="Wrap"> - + + Text="{x:Bind ViewModel.Data.Voice, Mode=OneWay}" /> @@ -68,7 +68,7 @@ VerticalAlignment="Center" AvatarPadding="4" IsAvatar="True" - Provider="{x:Bind ViewModel.Provider, Mode=OneWay}" /> + Provider="{x:Bind ViewModel.Data.Provider, Mode=OneWay}" /> InitializeComponent(); /// - protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e) + protected override void OnViewModelChanged(AudioSessionItemViewModel? oldValue, AudioSessionItemViewModel? newValue) => Initialize(); /// @@ -35,9 +35,9 @@ private void Initialize() return; } - var time = !ViewModel.Time.HasValue + var time = !ViewModel.Data.Time.HasValue ? "-/-" - : ViewModel.Time.Value.ToString("yyyy-MM-dd HH:mm:ss"); + : ViewModel.Data.Time.Value.ToString("yyyy-MM-dd HH:mm:ss"); DateBlock.Text = time; } @@ -45,7 +45,7 @@ private void OnSessionClick(object sender, RoutedEventArgs e) => GetSessionViewModel().LoadSessionCommand.Execute(ViewModel); private void OnOpenItemClick(object sender, RoutedEventArgs e) - => GetSessionViewModel().OpenAudioCommand.Execute(AppToolkit.GetSpeechPath(ViewModel.Id)); + => GetSessionViewModel().OpenAudioCommand.Execute(AppToolkit.GetSpeechPath(ViewModel.Data.Id)); private void OnDeleteItemClick(object sender, RoutedEventArgs e) { @@ -57,6 +57,6 @@ private void OnDeleteItemClick(object sender, RoutedEventArgs e) /// /// 会话项控件基类. /// -public abstract class AudioSessionItemControlBase : LayoutUserControlBase +public abstract class AudioSessionItemControlBase : LayoutUserControlBase { } diff --git a/src/Desktop/RodelAgent.UI/Controls/Chat/ChatGroupHistory.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Chat/ChatGroupHistory.xaml.cs index b2caf611..f8f6911a 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Chat/ChatGroupHistory.xaml.cs +++ b/src/Desktop/RodelAgent.UI/Controls/Chat/ChatGroupHistory.xaml.cs @@ -15,14 +15,14 @@ public sealed partial class ChatGroupHistory : ChatGroupControlBase public ChatGroupHistory() => InitializeComponent(); /// - protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e) + protected override void OnViewModelChanged(ChatGroupViewModel? oldValue, ChatGroupViewModel? newValue) { - if (e.OldValue is ChatGroupViewModel oldVm) + if (oldValue is ChatGroupViewModel oldVm) { oldVm.RequestScrollToBottom -= OnRequestScrollToBottomAsync; } - if (e.NewValue is ChatGroupViewModel newVm) + if (newValue is ChatGroupViewModel newVm) { newVm.RequestScrollToBottom += OnRequestScrollToBottomAsync; } diff --git a/src/Desktop/RodelAgent.UI/Controls/Chat/ChatGroupInput.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Chat/ChatGroupInput.xaml.cs index efb0a9d8..9243a823 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Chat/ChatGroupInput.xaml.cs +++ b/src/Desktop/RodelAgent.UI/Controls/Chat/ChatGroupInput.xaml.cs @@ -18,14 +18,14 @@ public sealed partial class ChatGroupInput : ChatGroupControlBase public ChatGroupInput() => InitializeComponent(); /// - protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e) + protected override void OnViewModelChanged(ChatGroupViewModel? oldValue, ChatGroupViewModel? newValue) { - if (e.OldValue is ChatGroupViewModel oldVm) + if (oldValue is ChatGroupViewModel oldVm) { oldVm.RequestFocusInput -= OnRequestFocusInput; } - if (e.NewValue is ChatGroupViewModel newVm) + if (newValue is ChatGroupViewModel newVm) { newVm.RequestFocusInput += OnRequestFocusInput; } diff --git a/src/Desktop/RodelAgent.UI/Controls/Chat/ChatMessageItemControl.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Chat/ChatMessageItemControl.xaml.cs index ce601d4e..7effca69 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Chat/ChatMessageItemControl.xaml.cs +++ b/src/Desktop/RodelAgent.UI/Controls/Chat/ChatMessageItemControl.xaml.cs @@ -15,9 +15,9 @@ public sealed partial class ChatMessageItemControl : ChatMessageItemControlBase public ChatMessageItemControl() => InitializeComponent(); /// - protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e) + protected override void OnViewModelChanged(ChatMessageItemViewModel? oldValue, ChatMessageItemViewModel? newValue) { - if (e.NewValue is ChatMessageItemViewModel vm) + if (newValue is ChatMessageItemViewModel vm) { _ = vm.IsUser ? VisualStateManager.GoToState(this, nameof(MyState), false) diff --git a/src/Desktop/RodelAgent.UI/Controls/Chat/ChatProviderOptionPanel.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Chat/ChatProviderOptionPanel.xaml.cs index 3722ed65..78dd984f 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Chat/ChatProviderOptionPanel.xaml.cs +++ b/src/Desktop/RodelAgent.UI/Controls/Chat/ChatProviderOptionPanel.xaml.cs @@ -4,7 +4,7 @@ using RodelAgent.Interfaces; using RodelAgent.Models.Abstractions; using RodelAgent.Models.Constants; -using RodelChat.Models.Client; +using RodelAgent.UI.ViewModels.Items; namespace RodelAgent.UI.Controls.Chat; @@ -41,7 +41,7 @@ public bool IsMaxRoundEnabled } /// - protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e) + protected override void OnViewModelChanged(ChatPresetItemViewModel? oldValue, ChatPresetItemViewModel? newValue) { _isInitialized = false; if (IsLoaded) @@ -56,15 +56,15 @@ protected override void OnControlLoaded() private void Initialize() { - if (ViewModel?.Parameters == null) + if (ViewModel?.Data.Parameters == null) { return; } - StreamOutputSwitch.IsOn = ViewModel.UseStreamOutput; - MaxTurnSlider.Value = ViewModel.MaxRounds; + StreamOutputSwitch.IsOn = ViewModel.Data.UseStreamOutput; + MaxTurnSlider.Value = ViewModel.Data.MaxRounds; CustomPanel.Children.Clear(); - var properties = ViewModel.Parameters.GetType().GetProperties(); + var properties = ViewModel.Data.Parameters.GetType().GetProperties(); for (var i = 0; i < properties.Length; i++) { var property = properties[i]; @@ -107,7 +107,7 @@ private void Initialize() private FrameworkElement CreateBooleanElement(BaseFieldAttribute attr, PropertyInfo property) { var boolAttr = attr as BooleanFieldAttribute; - var value = property.GetValue(ViewModel.Parameters) as bool?; + var value = property.GetValue(ViewModel.Data.Parameters) as bool?; var toggleSwitch = new ToggleSwitch { IsOn = value ?? false, @@ -116,8 +116,8 @@ private FrameworkElement CreateBooleanElement(BaseFieldAttribute attr, PropertyI toggleSwitch.Toggled += (s, e) => { - property.SetValue(ViewModel.Parameters, toggleSwitch.IsOn); - ViewModel.Parameters.ToDictionary(); + property.SetValue(ViewModel.Data.Parameters, toggleSwitch.IsOn); + ViewModel.Data.Parameters.ToDictionary(); PropertyChanged?.Invoke(this, EventArgs.Empty); }; @@ -131,7 +131,7 @@ private FrameworkElement CreateBooleanElement(BaseFieldAttribute attr, PropertyI private FrameworkElement CreateRangeFloatElement(BaseFieldAttribute attr, PropertyInfo property) { var rangeAttr = attr as RangeFloatFieldAttribute; - var value = property.GetValue(ViewModel.Parameters) as double?; + var value = property.GetValue(ViewModel.Data.Parameters) as double?; var min = rangeAttr.Minimum; var max = rangeAttr.Maximum; @@ -152,8 +152,8 @@ private FrameworkElement CreateRangeFloatElement(BaseFieldAttribute attr, Proper numberBox.ValueChanged += (s, e) => { - property.SetValue(ViewModel.Parameters, numberBox.Value); - ViewModel.Parameters.ToDictionary(); + property.SetValue(ViewModel.Data.Parameters, numberBox.Value); + ViewModel.Data.Parameters.ToDictionary(); PropertyChanged?.Invoke(this, EventArgs.Empty); }; @@ -172,8 +172,8 @@ private FrameworkElement CreateRangeFloatElement(BaseFieldAttribute attr, Proper slider.ValueChanged += (s, e) => { - property.SetValue(ViewModel.Parameters, slider.Value); - ViewModel.Parameters.ToDictionary(); + property.SetValue(ViewModel.Data.Parameters, slider.Value); + ViewModel.Data.Parameters.ToDictionary(); PropertyChanged?.Invoke(this, EventArgs.Empty); }; @@ -189,7 +189,7 @@ private FrameworkElement CreateRangeFloatElement(BaseFieldAttribute attr, Proper private FrameworkElement CreateRangeIntElement(BaseFieldAttribute attr, PropertyInfo property) { var rangeAttr = attr as RangeIntFieldAttribute; - var value = property.GetValue(ViewModel.Parameters) as int?; + var value = property.GetValue(ViewModel.Data.Parameters) as int?; var min = rangeAttr.Minimum; var max = rangeAttr.Maximum; object innerElement = null; @@ -210,8 +210,8 @@ private FrameworkElement CreateRangeIntElement(BaseFieldAttribute attr, Property numberBox.ValueChanged += (s, e) => { - property.SetValue(ViewModel.Parameters, Convert.ToInt32(numberBox.Value)); - ViewModel.Parameters.ToDictionary(); + property.SetValue(ViewModel.Data.Parameters, Convert.ToInt32(numberBox.Value)); + ViewModel.Data.Parameters.ToDictionary(); PropertyChanged?.Invoke(this, EventArgs.Empty); }; @@ -230,8 +230,8 @@ private FrameworkElement CreateRangeIntElement(BaseFieldAttribute attr, Property slider.ValueChanged += (s, e) => { - property.SetValue(ViewModel.Parameters, (int)slider.Value); - ViewModel.Parameters.ToDictionary(); + property.SetValue(ViewModel.Data.Parameters, (int)slider.Value); + ViewModel.Data.Parameters.ToDictionary(); PropertyChanged?.Invoke(this, EventArgs.Empty); }; @@ -247,7 +247,7 @@ private FrameworkElement CreateRangeIntElement(BaseFieldAttribute attr, Property private FrameworkElement CreateRangeLongElement(BaseFieldAttribute attr, PropertyInfo property) { var rangeAttr = attr as RangeLongFieldAttribute; - var value = property.GetValue(ViewModel.Parameters) as long?; + var value = property.GetValue(ViewModel.Data.Parameters) as long?; var min = rangeAttr.Minimum; var max = rangeAttr.Maximum; var numberBox = new NumberBox @@ -263,8 +263,8 @@ private FrameworkElement CreateRangeLongElement(BaseFieldAttribute attr, Propert numberBox.ValueChanged += (s, e) => { - property.SetValue(ViewModel.Parameters, Convert.ToInt64(numberBox.Value)); - ViewModel.Parameters.ToDictionary(); + property.SetValue(ViewModel.Data.Parameters, Convert.ToInt64(numberBox.Value)); + ViewModel.Data.Parameters.ToDictionary(); PropertyChanged?.Invoke(this, EventArgs.Empty); }; @@ -277,7 +277,7 @@ private FrameworkElement CreateRangeLongElement(BaseFieldAttribute attr, Propert private FrameworkElement CreateSelectionElement(BaseFieldAttribute attr, PropertyInfo property) { var selectionAttr = attr as SelectionFieldAttribute; - var value = property.GetValue(ViewModel.Parameters) as string; + var value = property.GetValue(ViewModel.Data.Parameters) as string; var comboBox = new ComboBox { ItemsSource = selectionAttr.Options, @@ -287,8 +287,8 @@ private FrameworkElement CreateSelectionElement(BaseFieldAttribute attr, Propert comboBox.SelectionChanged += (s, e) => { - property.SetValue(ViewModel.Parameters, comboBox.SelectedItem); - ViewModel.Parameters.ToDictionary(); + property.SetValue(ViewModel.Data.Parameters, comboBox.SelectedItem); + ViewModel.Data.Parameters.ToDictionary(); PropertyChanged?.Invoke(this, EventArgs.Empty); }; @@ -300,15 +300,15 @@ private FrameworkElement CreateSelectionElement(BaseFieldAttribute attr, Propert private FrameworkElement CreateTextElement(BaseFieldAttribute attr, PropertyInfo property) { - var value = property.GetValue(ViewModel.Parameters) as string; + var value = property.GetValue(ViewModel.Data.Parameters) as string; var panel = TextTemplate.LoadContent() as StackPanel; var box = panel.Children.OfType().First(); box.Text = value; box.TextChanged += (s, e) => { - property.SetValue(ViewModel.Parameters, box.Text); - ViewModel.Parameters.ToDictionary(); + property.SetValue(ViewModel.Data.Parameters, box.Text); + ViewModel.Data.Parameters.ToDictionary(); PropertyChanged?.Invoke(this, EventArgs.Empty); }; @@ -323,7 +323,7 @@ private void OnStreamOutputChanged(object sender, RoutedEventArgs e) return; } - ViewModel.UseStreamOutput = StreamOutputSwitch.IsOn; + ViewModel.Data.UseStreamOutput = StreamOutputSwitch.IsOn; PropertyChanged?.Invoke(this, EventArgs.Empty); } @@ -351,7 +351,7 @@ private void OnChatTruenChanged(object sender, RangeBaseValueChangedEventArgs e) return; } - ViewModel.MaxRounds = Convert.ToInt32(MaxTurnSlider.Value); + ViewModel.Data.MaxRounds = Convert.ToInt32(MaxTurnSlider.Value); PropertyChanged?.Invoke(this, EventArgs.Empty); } } @@ -359,6 +359,6 @@ private void OnChatTruenChanged(object sender, RangeBaseValueChangedEventArgs e) /// /// 聊天服务选项面板基类. /// -public abstract class ChatProviderOptionPanelBase : LayoutUserControlBase +public abstract class ChatProviderOptionPanelBase : LayoutUserControlBase { } diff --git a/src/Desktop/RodelAgent.UI/Controls/Chat/ChatSessionHistory.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Chat/ChatSessionHistory.xaml.cs index 203b3592..9da7d8f7 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Chat/ChatSessionHistory.xaml.cs +++ b/src/Desktop/RodelAgent.UI/Controls/Chat/ChatSessionHistory.xaml.cs @@ -15,14 +15,14 @@ public sealed partial class ChatSessionHistory : ChatSessionControlBase public ChatSessionHistory() => InitializeComponent(); /// - protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e) + protected override void OnViewModelChanged(ChatSessionViewModel? oldValue, ChatSessionViewModel? newValue) { - if (e.OldValue is ChatSessionViewModel oldVm) + if (oldValue is ChatSessionViewModel oldVm) { oldVm.RequestScrollToBottom -= OnRequestScrollToBottomAsync; } - if (e.NewValue is ChatSessionViewModel newVm) + if (newValue is ChatSessionViewModel newVm) { newVm.RequestScrollToBottom += OnRequestScrollToBottomAsync; } diff --git a/src/Desktop/RodelAgent.UI/Controls/Chat/ChatSessionInput.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Chat/ChatSessionInput.xaml.cs index 03cfbc70..fc49a821 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Chat/ChatSessionInput.xaml.cs +++ b/src/Desktop/RodelAgent.UI/Controls/Chat/ChatSessionInput.xaml.cs @@ -22,14 +22,14 @@ public ChatSessionInput() } /// - protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e) + protected override void OnViewModelChanged(ChatSessionViewModel? oldValue, ChatSessionViewModel? newValue) { - if (e.OldValue is ChatSessionViewModel oldVm) + if (oldValue is ChatSessionViewModel oldVm) { oldVm.RequestFocusInput -= OnRequestFocusInput; } - if (e.NewValue is ChatSessionViewModel newVm) + if (newValue is ChatSessionViewModel newVm) { newVm.RequestFocusInput += OnRequestFocusInput; } diff --git a/src/Desktop/RodelAgent.UI/Controls/Chat/PresetDetailPanel.xaml b/src/Desktop/RodelAgent.UI/Controls/Chat/PresetDetailPanel.xaml index ec94fe11..493cc637 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Chat/PresetDetailPanel.xaml +++ b/src/Desktop/RodelAgent.UI/Controls/Chat/PresetDetailPanel.xaml @@ -23,7 +23,7 @@ - + @@ -15,7 +17,7 @@ public sealed partial class SystemInstructionPanel : ChatSessionControlBase public SystemInstructionPanel() => InitializeComponent(); /// - protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e) + protected override void OnViewModelChanged(ChatSessionViewModel? oldValue, ChatSessionViewModel? newValue) => UpdateInstruction(); /// diff --git a/src/Desktop/RodelAgent.UI/Controls/Draw/DrawHistorySection.xaml b/src/Desktop/RodelAgent.UI/Controls/Draw/DrawHistorySection.xaml index c49e137c..ea22c74e 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Draw/DrawHistorySection.xaml +++ b/src/Desktop/RodelAgent.UI/Controls/Draw/DrawHistorySection.xaml @@ -3,10 +3,10 @@ x:Class="RodelAgent.UI.Controls.Draw.DrawHistorySection" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:client="using:RodelDraw.Models.Client" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ext="using:RodelAgent.UI.Extensions" xmlns:ic="using:FluentIcons.WinUI" + xmlns:items="using:RodelAgent.UI.ViewModels.Items" xmlns:local="using:RodelAgent.UI.Controls.Draw" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> @@ -63,7 +63,7 @@ - + diff --git a/src/Desktop/RodelAgent.UI/Controls/Draw/DrawSessionItemControl.xaml b/src/Desktop/RodelAgent.UI/Controls/Draw/DrawSessionItemControl.xaml index ca3d2beb..f70ed991 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Draw/DrawSessionItemControl.xaml +++ b/src/Desktop/RodelAgent.UI/Controls/Draw/DrawSessionItemControl.xaml @@ -43,11 +43,11 @@ Foreground="{ThemeResource TextFillColorSecondaryBrush}" MaxLines="2" Style="{StaticResource CaptionTextBlockStyle}" - Text="{x:Bind ViewModel.Request.Prompt, Mode=OneWay}" + Text="{x:Bind ViewModel.Data.Request.Prompt, Mode=OneWay}" TextTrimming="CharacterEllipsis" TextWrapping="Wrap"> - + @@ -69,7 +69,7 @@ VerticalAlignment="Center" AvatarPadding="4" IsAvatar="True" - Provider="{x:Bind ViewModel.Provider, Mode=OneWay}" /> + Provider="{x:Bind ViewModel.Data.Provider, Mode=OneWay}" /> InitializeComponent(); /// - protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e) + protected override void OnViewModelChanged(DrawSessionItemViewModel? oldValue, DrawSessionItemViewModel? newValue) => Initialize(); /// @@ -37,13 +37,13 @@ private void Initialize() return; } - var time = !ViewModel.Time.HasValue + var time = !ViewModel.Data.Time.HasValue ? "-/-" - : ViewModel.Time.Value.ToString("yyyy-MM-dd HH:mm:ss"); + : ViewModel.Data.Time.Value.ToString("yyyy-MM-dd HH:mm:ss"); DateBlock.Text = time; _xi = 1; - var sp = ViewModel.Request.Size.Split("x"); + var sp = ViewModel.Data.Request.Size.Split("x"); if (sp.Length == 2) { var width = double.Parse(sp[0]); @@ -79,10 +79,10 @@ private void OnSessionClick(object sender, RoutedEventArgs e) => GetSessionViewModel().LoadSessionCommand.Execute(ViewModel); private void OnCopyItemClick(object sender, RoutedEventArgs e) - => GetSessionViewModel().CopyImageCommand.Execute(AppToolkit.GetDrawPicturePath(ViewModel.Id)); + => GetSessionViewModel().CopyImageCommand.Execute(AppToolkit.GetDrawPicturePath(ViewModel.Data.Id)); private void OnOpenItemClick(object sender, RoutedEventArgs e) - => GetSessionViewModel().OpenImageCommand.Execute(AppToolkit.GetDrawPicturePath(ViewModel.Id)); + => GetSessionViewModel().OpenImageCommand.Execute(AppToolkit.GetDrawPicturePath(ViewModel.Data.Id)); private void OnDeleteItemClick(object sender, RoutedEventArgs e) { @@ -94,6 +94,6 @@ private void OnDeleteItemClick(object sender, RoutedEventArgs e) /// /// 会话项控件基类. /// -public abstract class DrawSessionItemControlBase : LayoutUserControlBase +public abstract class DrawSessionItemControlBase : LayoutUserControlBase { } diff --git a/src/Desktop/RodelAgent.UI/Controls/Draw/DrawSessionPresenter.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Draw/DrawSessionPresenter.xaml.cs index 763f452a..0ac0d0ac 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Draw/DrawSessionPresenter.xaml.cs +++ b/src/Desktop/RodelAgent.UI/Controls/Draw/DrawSessionPresenter.xaml.cs @@ -21,14 +21,14 @@ public DrawSessionPresenter() } /// - protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e) + protected override void OnViewModelChanged(DrawSessionViewModel? oldValue, DrawSessionViewModel? newValue) { - if (e.OldValue is DrawSessionViewModel oldViewModel) + if (oldValue is DrawSessionViewModel oldViewModel) { oldViewModel.DataChanged -= OnDataChanged; } - if (e.NewValue is DrawSessionViewModel newViewModel) + if (newValue is DrawSessionViewModel newViewModel) { newViewModel.DataChanged += OnDataChanged; } diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/AboutSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/AboutSettingSection.xaml index 1bb62eeb..cfd715c7 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/AboutSettingSection.xaml +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/AboutSettingSection.xaml @@ -3,20 +3,20 @@ x:Class="RodelAgent.UI.Controls.Settings.AboutSettingSection" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:community="using:CommunityToolkit.WinUI.Controls" + xmlns:base="using:Richasy.WinUI.Share.Base" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ext="using:RodelAgent.UI.Extensions" xmlns:local="using:RodelAgent.UI.Controls.Settings" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> - - + + - + - - + + - - - + + + diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/AliTranslateConfigSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/AliTranslateConfigSettingSection.xaml index 0a812fd0..bdf2483d 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/AliTranslateConfigSettingSection.xaml +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/AliTranslateConfigSettingSection.xaml @@ -3,7 +3,7 @@ x:Class="RodelAgent.UI.Controls.Settings.AliTranslateConfigSettingSection" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:community="using:CommunityToolkit.WinUI.Controls" + xmlns:base="using:Richasy.WinUI.Share.Base" xmlns:controls="using:RodelAgent.UI.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ext="using:RodelAgent.UI.Extensions" @@ -12,15 +12,15 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> - - + + - - - + + @@ -30,20 +30,20 @@ AutomationProperties.Name="{ext:Locale Name=AccessKey}" Loaded="OnKeyBoxLoaded" PasswordChanged="OnKeyBoxPasswordChanged" /> - - + + - - + + - + diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/AliTranslateConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/AliTranslateConfigSettingSection.xaml.cs index 457f8fce..88509114 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/AliTranslateConfigSettingSection.xaml.cs +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/AliTranslateConfigSettingSection.xaml.cs @@ -16,9 +16,9 @@ public sealed partial class AliTranslateConfigSettingSection : TranslateServiceC public AliTranslateConfigSettingSection() => InitializeComponent(); /// - protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e) + protected override void OnViewModelChanged(TranslateServiceItemViewModel? oldValue, TranslateServiceItemViewModel? newValue) { - if (e.NewValue is not TranslateServiceItemViewModel newVM) + if (newValue is not TranslateServiceItemViewModel newVM) { return; } diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/AppLogSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/AppLogSettingSection.xaml index 65b19017..3d26381e 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/AppLogSettingSection.xaml +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/AppLogSettingSection.xaml @@ -3,7 +3,7 @@ x:Class="RodelAgent.UI.Controls.Settings.AppLogSettingSection" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:community="using:CommunityToolkit.WinUI.Controls" + xmlns:base="using:Richasy.WinUI.Share.Base" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ext="using:RodelAgent.UI.Extensions" xmlns:ic="using:FluentIcons.WinUI" @@ -11,14 +11,14 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> - - + - - + + diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIAudioConfigSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIAudioConfigSettingSection.xaml index 968dbbcd..e26df33c 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIAudioConfigSettingSection.xaml +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIAudioConfigSettingSection.xaml @@ -3,7 +3,7 @@ x:Class="RodelAgent.UI.Controls.Settings.AzureOpenAIAudioConfigSettingSection" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:community="using:CommunityToolkit.WinUI.Controls" + xmlns:base="using:Richasy.WinUI.Share.Base" xmlns:controls="using:RodelAgent.UI.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ext="using:RodelAgent.UI.Extensions" @@ -13,12 +13,12 @@ xmlns:startup="using:RodelAgent.UI.Controls.Startup" mc:Ignorable="d"> - - + + - - - + + @@ -28,8 +28,8 @@ AutomationProperties.Name="{ext:Locale Name=AccessKey}" Loaded="OnKeyBoxLoaded" PasswordChanged="OnKeyBoxPasswordChanged" /> - - + @@ -39,8 +39,8 @@ AutomationProperties.Name="{ext:Locale Name=Endpoint}" PlaceholderText="https://example.openai.azure.com" TextChanged="OnEndpointBoxTextChanged" /> - - + @@ -51,13 +51,13 @@ - - + + - + diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIAudioConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIAudioConfigSettingSection.xaml.cs index 97dff44e..6f9dc74e 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIAudioConfigSettingSection.xaml.cs +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIAudioConfigSettingSection.xaml.cs @@ -20,9 +20,9 @@ public AzureOpenAIAudioConfigSettingSection() } /// - protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e) + protected override void OnViewModelChanged(AudioServiceItemViewModel? oldValue, AudioServiceItemViewModel? newValue) { - if (e.NewValue is not AudioServiceItemViewModel newVM) + if (newValue is not AudioServiceItemViewModel newVM) { return; } diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIChatConfigSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIChatConfigSettingSection.xaml index d347adf4..093a5842 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIChatConfigSettingSection.xaml +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIChatConfigSettingSection.xaml @@ -3,7 +3,7 @@ x:Class="RodelAgent.UI.Controls.Settings.AzureOpenAIChatConfigSettingSection" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:community="using:CommunityToolkit.WinUI.Controls" + xmlns:base="using:Richasy.WinUI.Share.Base" xmlns:controls="using:RodelAgent.UI.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ext="using:RodelAgent.UI.Extensions" @@ -13,12 +13,12 @@ xmlns:startup="using:RodelAgent.UI.Controls.Startup" mc:Ignorable="d"> - - + + - - - + + @@ -28,8 +28,8 @@ AutomationProperties.Name="{ext:Locale Name=AccessKey}" Loaded="OnKeyBoxLoaded" PasswordChanged="OnKeyBoxPasswordChanged" /> - - + @@ -39,8 +39,8 @@ AutomationProperties.Name="{ext:Locale Name=Endpoint}" PlaceholderText="https://example.openai.azure.com" TextChanged="OnEndpointBoxTextChanged" /> - - + @@ -56,9 +56,9 @@ - - - + + + - + - + diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIChatConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIChatConfigSettingSection.xaml.cs index e2bcb72c..db0c350c 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIChatConfigSettingSection.xaml.cs +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIChatConfigSettingSection.xaml.cs @@ -23,9 +23,9 @@ public AzureOpenAIChatConfigSettingSection() } /// - protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e) + protected override void OnViewModelChanged(ChatServiceItemViewModel? oldValue, ChatServiceItemViewModel? newValue) { - if (e.NewValue is not ChatServiceItemViewModel newVM) + if (newValue is not ChatServiceItemViewModel newVM) { return; } diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIDrawConfigSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIDrawConfigSettingSection.xaml index 26c33efb..4b917243 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIDrawConfigSettingSection.xaml +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIDrawConfigSettingSection.xaml @@ -3,7 +3,7 @@ x:Class="RodelAgent.UI.Controls.Settings.AzureOpenAIDrawConfigSettingSection" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:community="using:CommunityToolkit.WinUI.Controls" + xmlns:base="using:Richasy.WinUI.Share.Base" xmlns:controls="using:RodelAgent.UI.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ext="using:RodelAgent.UI.Extensions" @@ -13,12 +13,12 @@ xmlns:startup="using:RodelAgent.UI.Controls.Startup" mc:Ignorable="d"> - - + + - - - + + @@ -28,8 +28,8 @@ AutomationProperties.Name="{ext:Locale Name=AccessKey}" Loaded="OnKeyBoxLoaded" PasswordChanged="OnKeyBoxPasswordChanged" /> - - + @@ -39,8 +39,8 @@ AutomationProperties.Name="{ext:Locale Name=Endpoint}" PlaceholderText="https://example.openai.azure.com" TextChanged="OnEndpointBoxTextChanged" /> - - + @@ -56,9 +56,9 @@ - - - + + + - + - + diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIDrawConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIDrawConfigSettingSection.xaml.cs index ebeb8906..3d559826 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIDrawConfigSettingSection.xaml.cs +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/AzureOpenAIDrawConfigSettingSection.xaml.cs @@ -23,9 +23,9 @@ public AzureOpenAIDrawConfigSettingSection() } /// - protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e) + protected override void OnViewModelChanged(DrawServiceItemViewModel? oldValue, DrawServiceItemViewModel? newValue) { - if (e.NewValue is not DrawServiceItemViewModel newVM) + if (newValue is not DrawServiceItemViewModel newVM) { return; } diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/AzureSpeechConfigSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/AzureSpeechConfigSettingSection.xaml index ce9479d2..c4ffeace 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/AzureSpeechConfigSettingSection.xaml +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/AzureSpeechConfigSettingSection.xaml @@ -3,7 +3,7 @@ x:Class="RodelAgent.UI.Controls.Settings.AzureSpeechConfigSettingSection" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:community="using:CommunityToolkit.WinUI.Controls" + xmlns:base="using:Richasy.WinUI.Share.Base" xmlns:controls="using:RodelAgent.UI.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ext="using:RodelAgent.UI.Extensions" @@ -12,12 +12,12 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> - - + + - - - + + @@ -27,8 +27,8 @@ AutomationProperties.Name="{ext:Locale Name=AccessKey}" Loaded="OnKeyBoxLoaded" PasswordChanged="OnKeyBoxPasswordChanged" /> - - + @@ -38,13 +38,13 @@ AutomationProperties.Name="{ext:Locale Name=Region}" PlaceholderText="eastus" TextChanged="OnRegionBoxTextChanged" /> - - + + - + diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/AzureSpeechConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/AzureSpeechConfigSettingSection.xaml.cs index 6ac60726..1af9b5f4 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/AzureSpeechConfigSettingSection.xaml.cs +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/AzureSpeechConfigSettingSection.xaml.cs @@ -16,9 +16,9 @@ public sealed partial class AzureSpeechConfigSettingSection : AudioServiceConfig public AzureSpeechConfigSettingSection() => InitializeComponent(); /// - protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e) + protected override void OnViewModelChanged(AudioServiceItemViewModel? oldValue, AudioServiceItemViewModel? newValue) { - if (e.NewValue is not AudioServiceItemViewModel newVM) + if (newValue is not AudioServiceItemViewModel newVM) { return; } diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/AzureTranslateConfigSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/AzureTranslateConfigSettingSection.xaml index 19d8c21b..a94c5d80 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/AzureTranslateConfigSettingSection.xaml +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/AzureTranslateConfigSettingSection.xaml @@ -3,7 +3,7 @@ x:Class="RodelAgent.UI.Controls.Settings.AzureTranslateConfigSettingSection" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:community="using:CommunityToolkit.WinUI.Controls" + xmlns:base="using:Richasy.WinUI.Share.Base" xmlns:controls="using:RodelAgent.UI.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ext="using:RodelAgent.UI.Extensions" @@ -12,12 +12,12 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> - - + + - - - + + @@ -27,8 +27,8 @@ AutomationProperties.Name="{ext:Locale Name=AccessKey}" Loaded="OnKeyBoxLoaded" PasswordChanged="OnKeyBoxPasswordChanged" /> - - + @@ -38,13 +38,13 @@ AutomationProperties.Name="{ext:Locale Name=Region}" PlaceholderText="eastus" TextChanged="OnRegionBoxTextChanged" /> - - + + - + diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/AzureTranslateConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/AzureTranslateConfigSettingSection.xaml.cs index 0f04ca6d..a2b25e73 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/AzureTranslateConfigSettingSection.xaml.cs +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/AzureTranslateConfigSettingSection.xaml.cs @@ -16,9 +16,9 @@ public sealed partial class AzureTranslateConfigSettingSection : TranslateServic public AzureTranslateConfigSettingSection() => InitializeComponent(); /// - protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e) + protected override void OnViewModelChanged(TranslateServiceItemViewModel? oldValue, TranslateServiceItemViewModel? newValue) { - if (e.NewValue is not TranslateServiceItemViewModel newVM) + if (newValue is not TranslateServiceItemViewModel newVM) { return; } diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/DouBaoChatConfigSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/DouBaoChatConfigSettingSection.xaml index 42c8d26a..f6154ec8 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/DouBaoChatConfigSettingSection.xaml +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/DouBaoChatConfigSettingSection.xaml @@ -3,7 +3,7 @@ x:Class="RodelAgent.UI.Controls.Settings.DouBaoChatConfigSettingSection" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:community="using:CommunityToolkit.WinUI.Controls" + xmlns:base="using:Richasy.WinUI.Share.Base" xmlns:controls="using:RodelAgent.UI.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ext="using:RodelAgent.UI.Extensions" @@ -13,21 +13,21 @@ xmlns:startup="using:RodelAgent.UI.Controls.Startup" mc:Ignorable="d"> - - + + - - - + + + - - - + + + - + - + diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/DouBaoChatConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/DouBaoChatConfigSettingSection.xaml.cs index 3f28fe93..bc7ce267 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/DouBaoChatConfigSettingSection.xaml.cs +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/DouBaoChatConfigSettingSection.xaml.cs @@ -17,9 +17,9 @@ public sealed partial class DouBaoChatConfigSettingSection : ChatServiceConfigCo public DouBaoChatConfigSettingSection() => InitializeComponent(); /// - protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e) + protected override void OnViewModelChanged(ChatServiceItemViewModel? oldValue, ChatServiceItemViewModel? newValue) { - if (e.NewValue is not ChatServiceItemViewModel newVM) + if (newValue is not ChatServiceItemViewModel newVM) { return; } diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/HunYuanChatConfigSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/HunYuanChatConfigSettingSection.xaml index 7a9d098a..0a4f7810 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/HunYuanChatConfigSettingSection.xaml +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/HunYuanChatConfigSettingSection.xaml @@ -3,7 +3,7 @@ x:Class="RodelAgent.UI.Controls.Settings.HunYuanChatConfigSettingSection" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:community="using:CommunityToolkit.WinUI.Controls" + xmlns:base="using:Richasy.WinUI.Share.Base" xmlns:controls="using:RodelAgent.UI.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ext="using:RodelAgent.UI.Extensions" @@ -13,20 +13,20 @@ xmlns:startup="using:RodelAgent.UI.Controls.Startup" mc:Ignorable="d"> - - + + - - - + + + - - + @@ -36,8 +36,8 @@ HorizontalAlignment="Stretch" AutomationProperties.Name="{ext:Locale Name=SecretId}" PasswordChanged="OnSecretBoxTextChanged" /> - - + @@ -48,9 +48,9 @@ - - - + + + - + - + diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/HunYuanChatConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/HunYuanChatConfigSettingSection.xaml.cs index a2875eed..0fb6e445 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/HunYuanChatConfigSettingSection.xaml.cs +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/HunYuanChatConfigSettingSection.xaml.cs @@ -18,9 +18,9 @@ public sealed partial class HunYuanChatConfigSettingSection : ChatServiceConfigC public HunYuanChatConfigSettingSection() => InitializeComponent(); /// - protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e) + protected override void OnViewModelChanged(ChatServiceItemViewModel? oldValue, ChatServiceItemViewModel? newValue) { - if (e.NewValue is not ChatServiceItemViewModel newVM) + if (newValue is not ChatServiceItemViewModel newVM) { return; } diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/HunYuanDrawConfigSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/HunYuanDrawConfigSettingSection.xaml index 5a25b7aa..d7a56875 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/HunYuanDrawConfigSettingSection.xaml +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/HunYuanDrawConfigSettingSection.xaml @@ -3,7 +3,7 @@ x:Class="RodelAgent.UI.Controls.Settings.HunYuanDrawConfigSettingSection" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:community="using:CommunityToolkit.WinUI.Controls" + xmlns:base="using:Richasy.WinUI.Share.Base" xmlns:controls="using:RodelAgent.UI.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ext="using:RodelAgent.UI.Extensions" @@ -13,20 +13,20 @@ xmlns:startup="using:RodelAgent.UI.Controls.Startup" mc:Ignorable="d"> - - + + - - - + + + - - + @@ -36,8 +36,8 @@ HorizontalAlignment="Stretch" AutomationProperties.Name="{ext:Locale Name=SecretId}" PasswordChanged="OnSecretBoxTextChanged" /> - - + @@ -48,9 +48,9 @@ - - - + + + - + - + diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/HunYuanDrawConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/HunYuanDrawConfigSettingSection.xaml.cs index a7d3a983..d7b2b75b 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/HunYuanDrawConfigSettingSection.xaml.cs +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/HunYuanDrawConfigSettingSection.xaml.cs @@ -18,9 +18,9 @@ public sealed partial class HunYuanDrawConfigSettingSection : DrawServiceConfigC public HunYuanDrawConfigSettingSection() => InitializeComponent(); /// - protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e) + protected override void OnViewModelChanged(DrawServiceItemViewModel? oldValue, DrawServiceItemViewModel? newValue) { - if (e.NewValue is not DrawServiceItemViewModel newVM) + if (newValue is not DrawServiceItemViewModel newVM) { return; } diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/LanguageSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/LanguageSettingSection.xaml index bca6f742..9b1c5bb1 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/LanguageSettingSection.xaml +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/LanguageSettingSection.xaml @@ -3,7 +3,7 @@ x:Class="RodelAgent.UI.Controls.Settings.LanguageSettingSection" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:community="using:CommunityToolkit.WinUI.Controls" + xmlns:base="using:Richasy.WinUI.Share.Base" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ext="using:RodelAgent.UI.Extensions" xmlns:ic="using:FluentIcons.WinUI" @@ -11,10 +11,10 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> - - + + - + - + diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/LibrarySettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/LibrarySettingSection.xaml index 4bc2f32f..70b205e7 100644 --- a/src/Desktop/RodelAgent.UI/Controls/Settings/LibrarySettingSection.xaml +++ b/src/Desktop/RodelAgent.UI/Controls/Settings/LibrarySettingSection.xaml @@ -3,7 +3,7 @@ x:Class="RodelAgent.UI.Controls.Settings.LibrarySettingSection" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:community="using:CommunityToolkit.WinUI.Controls" + xmlns:base="using:Richasy.WinUI.Share.Base" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ext="using:RodelAgent.UI.Extensions" xmlns:ic="using:FluentIcons.WinUI" @@ -11,10 +11,10 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> - - + + - +