diff --git a/src/App.ruleset b/src/App.ruleset
index 68d91f4..1f87eb3 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 3a3131e..810c97e 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 a21c37e..aa42976 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 04a1272..4c61c46 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 62b9e47..2e2b0bb 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 5d22876..cf02fff 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 d776809..3614f47 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 bbf2578..f413337 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 df3c8d0..53aa2b2 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 ffeb5fe..e603c5a 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 76f8994..bce8e53 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 46927b5..4eda58c 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 b82d14e..f10cf88 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 0788afc..2ea0a8d 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 c54b6b7..b84ad88 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 b67279a..edac954 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 ef71f22..ddf1ca0 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 a8382e6..160f797 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 d8109af..a7c363c 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 e92aff6..91b9943 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 4d121fe..ab3f821 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 b2caf61..f8f6911 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 efb0a9d..9243a82 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 ce601d4..7effca6 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 3722ed6..78dd984 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 203b359..9da7d8f 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 03cfbc7..fc49a82 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 ec94fe1..493cc63 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 c49e137..ea22c74 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 ca3d2be..f70ed99 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 763f452..0ac0d0a 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 1bb62ee..cfd715c 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 0a812fd..bdf2483 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 457f8fc..8850911 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 65b1901..3d26381 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 968dbbc..e26df33 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 97dff44..6f9dc74 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 d347adf..093a584 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 e2bcb72..db0c350 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 26c33ef..4b91724 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 ebeb890..3d55982 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 ce9479d..c4ffeac 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 6ac6072..1af9b5f 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 19d8c21..a94c5d8 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 0f04ca6..a2b25e7 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 42c8d26..f6154ec 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 3f28fe9..bc7ce26 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 7a9d098..0a4f781 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 a2875ee..0fb6e44 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 5a25b7a..d7a5687 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 a7d3a98..d7b2b75 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 bca6f74..9b1c5bb 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 4bc2f32..70b205e 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">
-
-
+
+
-
+
-
+
diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/ModelClientConfigSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/ModelClientConfigSettingSection.xaml
index 552a381..37c9f50 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/ModelClientConfigSettingSection.xaml
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/ModelClientConfigSettingSection.xaml
@@ -3,7 +3,7 @@
x:Class="RodelAgent.UI.Controls.Settings.ModelClientConfigSettingSection"
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,19 +13,19 @@
xmlns:startup="using:RodelAgent.UI.Controls.Startup"
mc:Ignorable="d">
-
-
+
+
-
-
-
+
+
+
-
-
+
@@ -36,9 +36,9 @@
-
-
-
+
+
+
-
+
-
+
diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/ModelClientConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/ModelClientConfigSettingSection.xaml.cs
index 3d51e3b..06c0dbd 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/ModelClientConfigSettingSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/ModelClientConfigSettingSection.xaml.cs
@@ -19,9 +19,9 @@ public sealed partial class ModelClientConfigSettingSection : ChatServiceConfigC
public ModelClientConfigSettingSection() => 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/ModelClientEndpointConfigSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/ModelClientEndpointConfigSettingSection.xaml
index 44eae1a..4ff2703 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/ModelClientEndpointConfigSettingSection.xaml
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/ModelClientEndpointConfigSettingSection.xaml
@@ -3,7 +3,7 @@
x:Class="RodelAgent.UI.Controls.Settings.ModelClientEndpointConfigSettingSection"
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 @@
AutomationProperties.Name="{ext:Locale Name=Endpoint}"
PlaceholderText="{ext:Locale Name=EndpointPlaceholder}"
TextChanged="OnEndpointBoxTextChanged" />
-
-
+
@@ -48,9 +48,9 @@
-
-
-
+
+
+
-
+
-
+
diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/ModelClientEndpointConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/ModelClientEndpointConfigSettingSection.xaml.cs
index ae0d580..9a98416 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/ModelClientEndpointConfigSettingSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/ModelClientEndpointConfigSettingSection.xaml.cs
@@ -20,9 +20,9 @@ public sealed partial class ModelClientEndpointConfigSettingSection : ChatServic
public ModelClientEndpointConfigSettingSection() => 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/OpenAIAudioConfigSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/OpenAIAudioConfigSettingSection.xaml
index 35bcd50..2e0e7c7 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/OpenAIAudioConfigSettingSection.xaml
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/OpenAIAudioConfigSettingSection.xaml
@@ -3,7 +3,7 @@
x:Class="RodelAgent.UI.Controls.Settings.OpenAIAudioConfigSettingSection"
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 @@
AutomationProperties.Name="{ext:Locale Name=Endpoint}"
PlaceholderText="{ext:Locale Name=EndpointPlaceholder}"
TextChanged="OnEndpointBoxTextChanged" />
-
-
+
@@ -47,8 +47,8 @@
AutomationProperties.Name="{ext:Locale Name=Organization_Optional}"
PlaceholderText="{ext:Locale Name=OptionalPlaceholder}"
TextChanged="OnOrganizationBoxTextChanged" />
-
-
+
@@ -59,13 +59,13 @@
-
-
+
+
-
+
diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/OpenAIAudioConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/OpenAIAudioConfigSettingSection.xaml.cs
index 1ba3e60..0d336eb 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/OpenAIAudioConfigSettingSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/OpenAIAudioConfigSettingSection.xaml.cs
@@ -17,9 +17,9 @@ public sealed partial class OpenAIAudioConfigSettingSection : AudioServiceConfig
public OpenAIAudioConfigSettingSection() => 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/OpenAIChatConfigSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/OpenAIChatConfigSettingSection.xaml
index b816bef..fbd7b9f 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/OpenAIChatConfigSettingSection.xaml
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/OpenAIChatConfigSettingSection.xaml
@@ -3,7 +3,7 @@
x:Class="RodelAgent.UI.Controls.Settings.OpenAIChatConfigSettingSection"
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 @@
AutomationProperties.Name="{ext:Locale Name=Endpoint}"
PlaceholderText="{ext:Locale Name=EndpointPlaceholder}"
TextChanged="OnEndpointBoxTextChanged" />
-
-
+
@@ -47,8 +47,8 @@
AutomationProperties.Name="{ext:Locale Name=Organization_Optional}"
PlaceholderText="{ext:Locale Name=OptionalPlaceholder}"
TextChanged="OnOrganizationBoxTextChanged" />
-
-
+
@@ -59,9 +59,9 @@
-
-
-
+
+
+
-
+
-
+
diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/OpenAIChatConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/OpenAIChatConfigSettingSection.xaml.cs
index 9079a63..9eb838a 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/OpenAIChatConfigSettingSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/OpenAIChatConfigSettingSection.xaml.cs
@@ -19,9 +19,9 @@ public sealed partial class OpenAIChatConfigSettingSection : ChatServiceConfigCo
public OpenAIChatConfigSettingSection() => 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/OpenAIDrawConfigSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/OpenAIDrawConfigSettingSection.xaml
index 81af789..f8a10cb 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/OpenAIDrawConfigSettingSection.xaml
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/OpenAIDrawConfigSettingSection.xaml
@@ -3,7 +3,7 @@
x:Class="RodelAgent.UI.Controls.Settings.OpenAIDrawConfigSettingSection"
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 @@
AutomationProperties.Name="{ext:Locale Name=Endpoint}"
PlaceholderText="{ext:Locale Name=EndpointPlaceholder}"
TextChanged="OnEndpointBoxTextChanged" />
-
-
+
@@ -47,8 +47,8 @@
AutomationProperties.Name="{ext:Locale Name=Organization_Optional}"
PlaceholderText="{ext:Locale Name=OptionalPlaceholder}"
TextChanged="OnOrganizationBoxTextChanged" />
-
-
+
@@ -59,9 +59,9 @@
-
-
-
+
+
+
-
+
-
+
diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/OpenAIDrawConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/OpenAIDrawConfigSettingSection.xaml.cs
index 208475c..9123f09 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/OpenAIDrawConfigSettingSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/OpenAIDrawConfigSettingSection.xaml.cs
@@ -18,9 +18,9 @@ public sealed partial class OpenAIDrawConfigSettingSection : DrawServiceConfigCo
public OpenAIDrawConfigSettingSection() => 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/QianFanChatConfigSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/QianFanChatConfigSettingSection.xaml
index 5f8ebeb..4d8e96c 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/QianFanChatConfigSettingSection.xaml
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/QianFanChatConfigSettingSection.xaml
@@ -3,7 +3,7 @@
x:Class="RodelAgent.UI.Controls.Settings.QianFanChatConfigSettingSection"
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=SecretKey}"
PasswordChanged="OnSecretBoxTextChanged" />
-
-
+
@@ -48,9 +48,9 @@
-
-
-
+
+
+
-
+
-
+
diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/QianFanChatConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/QianFanChatConfigSettingSection.xaml.cs
index 961f233..b4c065b 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/QianFanChatConfigSettingSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/QianFanChatConfigSettingSection.xaml.cs
@@ -18,9 +18,9 @@ public sealed partial class QianFanChatConfigSettingSection : ChatServiceConfigC
public QianFanChatConfigSettingSection() => 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/QianFanDrawConfigSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/QianFanDrawConfigSettingSection.xaml
index e46dfd0..35440af 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/QianFanDrawConfigSettingSection.xaml
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/QianFanDrawConfigSettingSection.xaml
@@ -3,7 +3,7 @@
x:Class="RodelAgent.UI.Controls.Settings.QianFanDrawConfigSettingSection"
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=SecretKey}"
PasswordChanged="OnSecretBoxTextChanged" />
-
-
+
@@ -48,9 +48,9 @@
-
-
-
+
+
+
-
+
-
+
diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/QianFanDrawConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/QianFanDrawConfigSettingSection.xaml.cs
index 7b5f750..d1b54e4 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/QianFanDrawConfigSettingSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/QianFanDrawConfigSettingSection.xaml.cs
@@ -18,9 +18,9 @@ public sealed partial class QianFanDrawConfigSettingSection : DrawServiceConfigC
public QianFanDrawConfigSettingSection() => 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/SparkDeskChatConfigSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/SparkDeskChatConfigSettingSection.xaml
index 6f426b8..33de292 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/SparkDeskChatConfigSettingSection.xaml
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/SparkDeskChatConfigSettingSection.xaml
@@ -3,7 +3,7 @@
x:Class="RodelAgent.UI.Controls.Settings.SparkDeskChatConfigSettingSection"
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,36 +13,36 @@
xmlns:startup="using:RodelAgent.UI.Controls.Startup"
mc:Ignorable="d">
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
+
+
-
-
+
@@ -53,9 +53,9 @@
-
-
-
+
+
+
-
+
-
+
diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/SparkDeskChatConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/SparkDeskChatConfigSettingSection.xaml.cs
index aff17a9..6a5bc53 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/SparkDeskChatConfigSettingSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/SparkDeskChatConfigSettingSection.xaml.cs
@@ -18,9 +18,9 @@ public sealed partial class SparkDeskChatConfigSettingSection : ChatServiceConfi
public SparkDeskChatConfigSettingSection() => 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/SparkDeskDrawConfigSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/SparkDeskDrawConfigSettingSection.xaml
index a316e1a..13c73a9 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/SparkDeskDrawConfigSettingSection.xaml
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/SparkDeskDrawConfigSettingSection.xaml
@@ -3,7 +3,7 @@
x:Class="RodelAgent.UI.Controls.Settings.SparkDeskDrawConfigSettingSection"
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,36 +13,36 @@
xmlns:startup="using:RodelAgent.UI.Controls.Startup"
mc:Ignorable="d">
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
+
+
-
-
+
@@ -53,9 +53,9 @@
-
-
-
+
+
+
-
+
-
+
diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/SparkDeskDrawConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/SparkDeskDrawConfigSettingSection.xaml.cs
index 584b655..ce2ecd0 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/SparkDeskDrawConfigSettingSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/SparkDeskDrawConfigSettingSection.xaml.cs
@@ -18,9 +18,9 @@ public sealed partial class SparkDeskDrawConfigSettingSection : DrawServiceConfi
public SparkDeskDrawConfigSettingSection() => 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/TencentTranslateConfigSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/TencentTranslateConfigSettingSection.xaml
index 061f4e4..b624a89 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/TencentTranslateConfigSettingSection.xaml
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/TencentTranslateConfigSettingSection.xaml
@@ -3,7 +3,7 @@
x:Class="RodelAgent.UI.Controls.Settings.TencentTranslateConfigSettingSection"
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=SecretKey}"
Loaded="OnKeyBoxLoaded"
PasswordChanged="OnKeyBoxPasswordChanged" />
-
-
+
+
-
-
+
+
-
+
diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/TencentTranslateConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/TencentTranslateConfigSettingSection.xaml.cs
index ce3f5a0..6c8799d 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/TencentTranslateConfigSettingSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/TencentTranslateConfigSettingSection.xaml.cs
@@ -16,9 +16,9 @@ public sealed partial class TencentTranslateConfigSettingSection : TranslateServ
public TencentTranslateConfigSettingSection() => 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/ThemeSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/ThemeSettingSection.xaml
index c36f648..83fbae8 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/ThemeSettingSection.xaml
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/ThemeSettingSection.xaml
@@ -3,7 +3,7 @@
x:Class="RodelAgent.UI.Controls.Settings.ThemeSettingSection"
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,15 +11,15 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
-
-
+
+
-
+
-
-
+
+
-
-
-
+
+
+
diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/TranslateAppClientConfigSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/TranslateAppClientConfigSettingSection.xaml
index 5e9b5ae..ba66936 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/TranslateAppClientConfigSettingSection.xaml
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/TranslateAppClientConfigSettingSection.xaml
@@ -3,7 +3,7 @@
x:Class="RodelAgent.UI.Controls.Settings.TranslateAppClientConfigSettingSection"
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,36 +12,36 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
-
+
+
-
+
diff --git a/src/Desktop/RodelAgent.UI/Controls/Settings/TranslateAppClientConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/TranslateAppClientConfigSettingSection.xaml.cs
index b609f51..b01cc95 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/TranslateAppClientConfigSettingSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/TranslateAppClientConfigSettingSection.xaml.cs
@@ -18,9 +18,9 @@ public sealed partial class TranslateAppClientConfigSettingSection : TranslateSe
public TranslateAppClientConfigSettingSection() => 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/TranslateRecordSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/TranslateRecordSettingSection.xaml
index 7b318ab..1056103 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/TranslateRecordSettingSection.xaml
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/TranslateRecordSettingSection.xaml
@@ -3,7 +3,7 @@
x:Class="RodelAgent.UI.Controls.Settings.TranslateRecordSettingSection"
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/VolcanoTranslateConfigSettingSection.xaml b/src/Desktop/RodelAgent.UI/Controls/Settings/VolcanoTranslateConfigSettingSection.xaml
index f3ebd10..783dda7 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/VolcanoTranslateConfigSettingSection.xaml
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/VolcanoTranslateConfigSettingSection.xaml
@@ -3,7 +3,7 @@
x:Class="RodelAgent.UI.Controls.Settings.VolcanoTranslateConfigSettingSection"
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/VolcanoTranslateConfigSettingSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Settings/VolcanoTranslateConfigSettingSection.xaml.cs
index 4385405..219e133 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Settings/VolcanoTranslateConfigSettingSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Settings/VolcanoTranslateConfigSettingSection.xaml.cs
@@ -16,9 +16,9 @@ public sealed partial class VolcanoTranslateConfigSettingSection : TranslateServ
public VolcanoTranslateConfigSettingSection() => 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/Startup/Audio/AudioClientConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Audio/AudioClientConfigSection.xaml.cs
index bedd06f..f0efa56 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Audio/AudioClientConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Audio/AudioClientConfigSection.xaml.cs
@@ -18,9 +18,9 @@ public sealed partial class AudioClientConfigSection : AudioServiceConfigControl
public AudioClientConfigSection() => 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/Startup/Audio/AudioClientEndpointConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Audio/AudioClientEndpointConfigSection.xaml.cs
index 7314389..617b41a 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Audio/AudioClientEndpointConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Audio/AudioClientEndpointConfigSection.xaml.cs
@@ -18,9 +18,9 @@ public sealed partial class AudioClientEndpointConfigSection : AudioServiceConfi
public AudioClientEndpointConfigSection() => 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/Startup/Audio/AudioConfigurationSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Audio/AudioConfigurationSection.xaml.cs
index 462963d..e369740 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Audio/AudioConfigurationSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Audio/AudioConfigurationSection.xaml.cs
@@ -16,9 +16,9 @@ public sealed partial class AudioConfigurationSection : AudioServiceConfigContro
public AudioConfigurationSection() => 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/Startup/Audio/AzureOpenAIAudioConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Audio/AzureOpenAIAudioConfigSection.xaml.cs
index 8f1e281..3659c7f 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Audio/AzureOpenAIAudioConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Audio/AzureOpenAIAudioConfigSection.xaml.cs
@@ -16,9 +16,9 @@ public sealed partial class AzureOpenAIAudioConfigSection : AudioServiceConfigCo
public AzureOpenAIAudioConfigSection() => 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/Startup/Audio/AzureSpeechAudioConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Audio/AzureSpeechAudioConfigSection.xaml.cs
index daef5cc..d26b8ec 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Audio/AzureSpeechAudioConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Audio/AzureSpeechAudioConfigSection.xaml.cs
@@ -16,9 +16,9 @@ public sealed partial class AzureSpeechAudioConfigSection : AudioServiceConfigCo
public AzureSpeechAudioConfigSection() => 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/Startup/Audio/OpenAIAudioConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Audio/OpenAIAudioConfigSection.xaml.cs
index 2c53743..b528c59 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Audio/OpenAIAudioConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Audio/OpenAIAudioConfigSection.xaml.cs
@@ -17,9 +17,9 @@ public sealed partial class OpenAIAudioConfigSection : AudioServiceConfigControl
public OpenAIAudioConfigSection() => 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/Startup/Chat/AzureOpenAIChatConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/AzureOpenAIChatConfigSection.xaml.cs
index d72a52a..f383bd4 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/AzureOpenAIChatConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/AzureOpenAIChatConfigSection.xaml.cs
@@ -23,9 +23,9 @@ public AzureOpenAIChatConfigSection()
}
///
- 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/Startup/Chat/ChatClientConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/ChatClientConfigSection.xaml.cs
index 239e366..0cb37e3 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/ChatClientConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/ChatClientConfigSection.xaml.cs
@@ -35,9 +35,9 @@ public string CustomHeaderText
}
///
- 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/Startup/Chat/ChatClientEndpointConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/ChatClientEndpointConfigSection.xaml.cs
index 2687e88..472684b 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/ChatClientEndpointConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/ChatClientEndpointConfigSection.xaml.cs
@@ -18,9 +18,9 @@ public sealed partial class ChatClientEndpointConfigSection : ChatServiceConfigC
public ChatClientEndpointConfigSection() => 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/Startup/Chat/ChatConfigurationSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/ChatConfigurationSection.xaml.cs
index 2c45437..3535e23 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/ChatConfigurationSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/ChatConfigurationSection.xaml.cs
@@ -19,9 +19,9 @@ public ChatConfigurationSection()
}
///
- 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/Startup/Chat/DouBaoChatConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/DouBaoChatConfigSection.xaml.cs
index e5f7689..2c8062d 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/DouBaoChatConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/DouBaoChatConfigSection.xaml.cs
@@ -20,9 +20,9 @@ public DouBaoChatConfigSection()
}
///
- 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/Startup/Chat/HunYuanChatConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/HunYuanChatConfigSection.xaml.cs
index 1032fde..4227a1a 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/HunYuanChatConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/HunYuanChatConfigSection.xaml.cs
@@ -17,9 +17,9 @@ public sealed partial class HunYuanChatConfigSection : ChatServiceConfigControlB
public HunYuanChatConfigSection() => 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/Startup/Chat/OpenAIChatConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/OpenAIChatConfigSection.xaml.cs
index d82f309..4ea6765 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/OpenAIChatConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/OpenAIChatConfigSection.xaml.cs
@@ -17,9 +17,9 @@ public sealed partial class OpenAIChatConfigSection : ChatServiceConfigControlBa
public OpenAIChatConfigSection() => 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/Startup/Chat/QianFanChatConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/QianFanChatConfigSection.xaml.cs
index 614cbd0..a0c2358 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/QianFanChatConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/QianFanChatConfigSection.xaml.cs
@@ -17,9 +17,9 @@ public sealed partial class QianFanChatConfigSection : ChatServiceConfigControlB
public QianFanChatConfigSection() => 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/Startup/Chat/SparkDeskChatConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/SparkDeskChatConfigSection.xaml.cs
index 88b8d82..fd1e885 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/SparkDeskChatConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Chat/SparkDeskChatConfigSection.xaml.cs
@@ -17,9 +17,9 @@ public sealed partial class SparkDeskChatConfigSection : ChatServiceConfigContro
public SparkDeskChatConfigSection() => 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/Startup/Draw/AzureOpenAIDrawConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/AzureOpenAIDrawConfigSection.xaml.cs
index 03f9801..88036c3 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/AzureOpenAIDrawConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/AzureOpenAIDrawConfigSection.xaml.cs
@@ -23,9 +23,9 @@ public AzureOpenAIDrawConfigSection()
}
///
- 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/Startup/Draw/DrawClientConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/DrawClientConfigSection.xaml.cs
index 1c0165c..f7b4fde 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/DrawClientConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/DrawClientConfigSection.xaml.cs
@@ -18,9 +18,9 @@ public sealed partial class DrawClientConfigSection : DrawServiceConfigControlBa
public DrawClientConfigSection() => 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/Startup/Draw/DrawClientEndpointConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/DrawClientEndpointConfigSection.xaml.cs
index 5d2f729..0e0b5cd 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/DrawClientEndpointConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/DrawClientEndpointConfigSection.xaml.cs
@@ -18,9 +18,9 @@ public sealed partial class DrawClientEndpointConfigSection : DrawServiceConfigC
public DrawClientEndpointConfigSection() => 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/Startup/Draw/DrawConfigurationSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/DrawConfigurationSection.xaml.cs
index f61e3ca..07ce9d0 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/DrawConfigurationSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/DrawConfigurationSection.xaml.cs
@@ -16,9 +16,9 @@ public sealed partial class DrawConfigurationSection : DrawServiceConfigControlB
public DrawConfigurationSection() => 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/Startup/Draw/HunYuanDrawConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/HunYuanDrawConfigSection.xaml.cs
index 5db75f7..2499a71 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/HunYuanDrawConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/HunYuanDrawConfigSection.xaml.cs
@@ -17,9 +17,9 @@ public sealed partial class HunYuanDrawConfigSection : DrawServiceConfigControlB
public HunYuanDrawConfigSection() => 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/Startup/Draw/OpenAIDrawConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/OpenAIDrawConfigSection.xaml.cs
index 2f76c99..d789398 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/OpenAIDrawConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/OpenAIDrawConfigSection.xaml.cs
@@ -17,9 +17,9 @@ public sealed partial class OpenAIDrawConfigSection : DrawServiceConfigControlBa
public OpenAIDrawConfigSection() => 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/Startup/Draw/QianFanDrawConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/QianFanDrawConfigSection.xaml.cs
index f519a4d..ad30bbb 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/QianFanDrawConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/QianFanDrawConfigSection.xaml.cs
@@ -17,9 +17,9 @@ public sealed partial class QianFanDrawConfigSection : DrawServiceConfigControlB
public QianFanDrawConfigSection() => 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/Startup/Draw/SparkDeskDrawConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/SparkDeskDrawConfigSection.xaml.cs
index d11c41b..690e330 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/SparkDeskDrawConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Draw/SparkDeskDrawConfigSection.xaml.cs
@@ -17,9 +17,9 @@ public sealed partial class SparkDeskDrawConfigSection : DrawServiceConfigContro
public SparkDeskDrawConfigSection() => 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/Startup/Translate/AliTranslateConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Translate/AliTranslateConfigSection.xaml.cs
index a6e8e18..297912c 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Translate/AliTranslateConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Translate/AliTranslateConfigSection.xaml.cs
@@ -16,9 +16,9 @@ public sealed partial class AliTranslateConfigSection : TranslateServiceConfigCo
public AliTranslateConfigSection() => 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/Startup/Translate/AzureTranslateConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Translate/AzureTranslateConfigSection.xaml.cs
index fd66ec5..84d0386 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Translate/AzureTranslateConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Translate/AzureTranslateConfigSection.xaml.cs
@@ -16,9 +16,9 @@ public sealed partial class AzureTranslateConfigSection : TranslateServiceConfig
public AzureTranslateConfigSection() => 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/Startup/Translate/TencentTranslateConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Translate/TencentTranslateConfigSection.xaml.cs
index 48c9128..1204861 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Translate/TencentTranslateConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Translate/TencentTranslateConfigSection.xaml.cs
@@ -16,9 +16,9 @@ public sealed partial class TencentTranslateConfigSection : TranslateServiceConf
public TencentTranslateConfigSection() => 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/Startup/Translate/TranslateAppClientConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Translate/TranslateAppClientConfigSection.xaml.cs
index 4e50426..51ce911 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Translate/TranslateAppClientConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Translate/TranslateAppClientConfigSection.xaml.cs
@@ -18,9 +18,9 @@ public sealed partial class TranslateAppClientConfigSection : TranslateServiceCo
public TranslateAppClientConfigSection() => 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/Startup/Translate/TranslateClientConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Translate/TranslateClientConfigSection.xaml.cs
index 15752cb..3a4b872 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Translate/TranslateClientConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Translate/TranslateClientConfigSection.xaml.cs
@@ -18,9 +18,9 @@ public sealed partial class TranslateClientConfigSection : TranslateServiceConfi
public TranslateClientConfigSection() => 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/Startup/Translate/TranslateConfigurationSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Translate/TranslateConfigurationSection.xaml.cs
index 1fdd6d5..ff45fea 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Translate/TranslateConfigurationSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Translate/TranslateConfigurationSection.xaml.cs
@@ -19,9 +19,9 @@ public TranslateConfigurationSection()
}
///
- 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/Startup/Translate/VolcanoTranslateConfigSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Startup/Translate/VolcanoTranslateConfigSection.xaml.cs
index 47d6ce3..b875048 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Startup/Translate/VolcanoTranslateConfigSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Startup/Translate/VolcanoTranslateConfigSection.xaml.cs
@@ -16,9 +16,9 @@ public sealed partial class VolcanoTranslateConfigSection : TranslateServiceConf
public VolcanoTranslateConfigSection() => 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/Translation/SourceTextSection.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Translation/SourceTextSection.xaml.cs
index 1fbcda4..4bffa9c 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Translation/SourceTextSection.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Translation/SourceTextSection.xaml.cs
@@ -20,14 +20,14 @@ public sealed partial class SourceTextSection : TranslateSessionControlBase
public SourceTextSection() => InitializeComponent();
///
- protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e)
+ protected override void OnViewModelChanged(TranslateSessionViewModel? oldValue, TranslateSessionViewModel? newValue)
{
- if (e.OldValue is TranslateSessionViewModel oldVM)
+ if (oldValue is TranslateSessionViewModel oldVM)
{
oldVM.PropertyChanged -= OnViewModelPropertyChanged;
}
- if (e.NewValue is TranslateSessionViewModel newVM)
+ if (newValue is TranslateSessionViewModel newVM)
{
newVM.PropertyChanged += OnViewModelPropertyChanged;
}
diff --git a/src/Desktop/RodelAgent.UI/Controls/Translation/TranslateSessionItemControl.xaml b/src/Desktop/RodelAgent.UI/Controls/Translation/TranslateSessionItemControl.xaml
index 5061495..2e9c6fc 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Translation/TranslateSessionItemControl.xaml
+++ b/src/Desktop/RodelAgent.UI/Controls/Translation/TranslateSessionItemControl.xaml
@@ -75,11 +75,11 @@
IsTextSelectionEnabled="True"
MaxLines="3"
Style="{StaticResource BodyTextBlockStyle}"
- Text="{x:Bind ViewModel.InputText, Mode=OneWay}"
+ Text="{x:Bind ViewModel.Data.InputText, Mode=OneWay}"
TextTrimming="CharacterEllipsis"
TextWrapping="Wrap">
-
+
-
+
diff --git a/src/Desktop/RodelAgent.UI/Controls/Translation/TranslateSessionItemControl.xaml.cs b/src/Desktop/RodelAgent.UI/Controls/Translation/TranslateSessionItemControl.xaml.cs
index e876cae..dd514b8 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Translation/TranslateSessionItemControl.xaml.cs
+++ b/src/Desktop/RodelAgent.UI/Controls/Translation/TranslateSessionItemControl.xaml.cs
@@ -4,7 +4,6 @@
using RodelAgent.UI.ViewModels;
using RodelAgent.UI.ViewModels.Items;
using RodelAgent.UI.ViewModels.Pages;
-using RodelTranslate.Models.Client;
using Windows.ApplicationModel.DataTransfer;
namespace RodelAgent.UI.Controls.Translation;
@@ -20,7 +19,7 @@ public sealed partial class TranslateSessionItemControl : TranslateSessionItemCo
public TranslateSessionItemControl() => InitializeComponent();
///
- protected override void OnViewModelChanged(DependencyPropertyChangedEventArgs e)
+ protected override void OnViewModelChanged(TranslateSessionItemViewModel? oldValue, TranslateSessionItemViewModel? newValue)
=> InitSourceAndTarget();
///
@@ -34,8 +33,8 @@ private void InitSourceAndTarget()
return;
}
- var sourceLan = new TranslateLanguageItemViewModel(ViewModel.SourceLanguage);
- var targetLan = new TranslateLanguageItemViewModel(ViewModel.TargetLanguage);
+ var sourceLan = new TranslateLanguageItemViewModel(ViewModel.Data.SourceLanguage);
+ var targetLan = new TranslateLanguageItemViewModel(ViewModel.Data.TargetLanguage);
SourceLanguageBlock.Text = sourceLan.DisplayName;
TargetLanguageBlock.Text = targetLan.DisplayName;
}
@@ -47,10 +46,10 @@ private void OnDeleteButtonClick(object sender, RoutedEventArgs e)
}
private void OnCopySourceTextItemClick(object sender, RoutedEventArgs e)
- => CopyTextInternal(ViewModel.InputText);
+ => CopyTextInternal(ViewModel.Data.InputText);
private void OnCopyTranslatedTextItemClick(object sender, RoutedEventArgs e)
- => CopyTextInternal(ViewModel.OutputText);
+ => CopyTextInternal(ViewModel.Data.OutputText);
private void CopyTextInternal(string text)
{
@@ -64,6 +63,6 @@ private void CopyTextInternal(string text)
///
/// 的基类.
///
-public abstract class TranslateSessionItemControlBase : LayoutUserControlBase
+public abstract class TranslateSessionItemControlBase : LayoutUserControlBase
{
}
diff --git a/src/Desktop/RodelAgent.UI/Controls/Translation/TranslationServiceHeader.xaml b/src/Desktop/RodelAgent.UI/Controls/Translation/TranslationServiceHeader.xaml
index 5056e7a..2790367 100644
--- a/src/Desktop/RodelAgent.UI/Controls/Translation/TranslationServiceHeader.xaml
+++ b/src/Desktop/RodelAgent.UI/Controls/Translation/TranslationServiceHeader.xaml
@@ -3,7 +3,6 @@
x:Class="RodelAgent.UI.Controls.Translation.TranslationServiceHeader"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:client="using:RodelTranslate.Models.Client"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ext="using:RodelAgent.UI.Extensions"
xmlns:itemcontrol="using:RodelAgent.UI.Controls.Items"
@@ -77,7 +76,7 @@
-
+
diff --git a/src/Desktop/RodelAgent.UI/Package.appxmanifest b/src/Desktop/RodelAgent.UI/Package.appxmanifest
index 00da5f9..ed1a672 100644
--- a/src/Desktop/RodelAgent.UI/Package.appxmanifest
+++ b/src/Desktop/RodelAgent.UI/Package.appxmanifest
@@ -48,6 +48,11 @@
+
+
+
+
+
diff --git a/src/Desktop/RodelAgent.UI/Pages/AudioServicePage.xaml b/src/Desktop/RodelAgent.UI/Pages/AudioServicePage.xaml
index 16f9ebf..44bac5d 100644
--- a/src/Desktop/RodelAgent.UI/Pages/AudioServicePage.xaml
+++ b/src/Desktop/RodelAgent.UI/Pages/AudioServicePage.xaml
@@ -4,11 +4,11 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:audio="using:RodelAgent.UI.Controls.Audio"
+ xmlns:base="using:Richasy.WinUI.Share.Base"
xmlns:community="using:CommunityToolkit.WinUI.Controls"
xmlns:controls="using:RodelAgent.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ext="using:RodelAgent.UI.Extensions"
- xmlns:lab="using:CommunityToolkit.Labs.WinUI"
xmlns:local="using:RodelAgent.UI.Pages"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
@@ -72,7 +72,7 @@
ViewModel="{x:Bind ViewModel.Session}"
Visibility="{x:Bind ViewModel.Session.AudioPath, Mode=OneWay, Converter={StaticResource ObjectToVisibilityConverter}}" />
-
@@ -72,7 +72,7 @@
-
+
+
+
+
diff --git a/src/Desktop/RodelAgent.UI/Pages/Internal/PromptTestPage.xaml.cs b/src/Desktop/RodelAgent.UI/Pages/Internal/PromptTestPage.xaml.cs
new file mode 100644
index 0000000..9d4d257
--- /dev/null
+++ b/src/Desktop/RodelAgent.UI/Pages/Internal/PromptTestPage.xaml.cs
@@ -0,0 +1,14 @@
+// Copyright (c) Rodel. All rights reserved.
+
+namespace RodelAgent.UI.Pages.Internal;
+
+///
+/// 提示词测试.
+///
+public sealed partial class PromptTestPage : LayoutPageBase
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public PromptTestPage() => InitializeComponent();
+}
diff --git a/src/Desktop/RodelAgent.UI/Resources/en-US/Resources.resw b/src/Desktop/RodelAgent.UI/Resources/en-US/Resources.resw
index 8e74327..5334427 100644
--- a/src/Desktop/RodelAgent.UI/Resources/en-US/Resources.resw
+++ b/src/Desktop/RodelAgent.UI/Resources/en-US/Resources.resw
@@ -1187,4 +1187,7 @@ Choose a library folder and let's get started!
Zhipu AI
+
+ Prompt test
+
\ No newline at end of file
diff --git a/src/Desktop/RodelAgent.UI/Resources/zh-Hans-CN/Resources.resw b/src/Desktop/RodelAgent.UI/Resources/zh-Hans-CN/Resources.resw
index 5777259..5c3f9cf 100644
--- a/src/Desktop/RodelAgent.UI/Resources/zh-Hans-CN/Resources.resw
+++ b/src/Desktop/RodelAgent.UI/Resources/zh-Hans-CN/Resources.resw
@@ -1187,4 +1187,7 @@
智谱 AI
+
+ 提示词测试
+
\ No newline at end of file
diff --git a/src/Desktop/RodelAgent.UI/RodelAgent.UI.csproj b/src/Desktop/RodelAgent.UI/RodelAgent.UI.csproj
index a401f53..e2cd718 100644
--- a/src/Desktop/RodelAgent.UI/RodelAgent.UI.csproj
+++ b/src/Desktop/RodelAgent.UI/RodelAgent.UI.csproj
@@ -3,6 +3,7 @@
WinExe
net8.0-windows10.0.22621.0
10.0.19041.0
+ 10.0.22621.38
RodelAgent.UI
app.manifest
x86;x64;ARM64
@@ -195,6 +196,7 @@
+
@@ -213,30 +215,28 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -642,6 +642,9 @@
Always
+
+ MSBuild:Compile
+
MSBuild:Compile
diff --git a/src/Desktop/RodelAgent.UI/ViewModels/Components/ChatSessionViewModel/ChatSessionViewModel.Properties.cs b/src/Desktop/RodelAgent.UI/ViewModels/Components/ChatSessionViewModel/ChatSessionViewModel.Properties.cs
index 182c9b0..c970e64 100644
--- a/src/Desktop/RodelAgent.UI/ViewModels/Components/ChatSessionViewModel/ChatSessionViewModel.Properties.cs
+++ b/src/Desktop/RodelAgent.UI/ViewModels/Components/ChatSessionViewModel/ChatSessionViewModel.Properties.cs
@@ -111,6 +111,11 @@ public sealed partial class ChatSessionViewModel
///
public string SessionId => Data?.Id ?? string.Empty;
+ ///
+ /// 会话预设模型(仅用于绑定).
+ ///
+ public ChatPresetItemViewModel PresetViewModel { get; }
+
///
/// 消息列表.
///
diff --git a/src/Desktop/RodelAgent.UI/ViewModels/Components/ChatSessionViewModel/ChatSessionViewModel.cs b/src/Desktop/RodelAgent.UI/ViewModels/Components/ChatSessionViewModel/ChatSessionViewModel.cs
index 44bd694..eedd3a3 100644
--- a/src/Desktop/RodelAgent.UI/ViewModels/Components/ChatSessionViewModel/ChatSessionViewModel.cs
+++ b/src/Desktop/RodelAgent.UI/ViewModels/Components/ChatSessionViewModel/ChatSessionViewModel.cs
@@ -32,6 +32,7 @@ public ChatSessionViewModel(
_storageService = GlobalDependencies.ServiceProvider.GetService();
IsEnterSend = SettingsToolkit.ReadLocalSetting(SettingNames.ChatServicePageIsEnterSend, true);
Messages.CollectionChanged += OnMessageCountChanged;
+ PresetViewModel = new(data);
Initialize(data);
}
diff --git a/src/Desktop/RodelAgent.UI/ViewModels/Components/NavigationViewModel.cs b/src/Desktop/RodelAgent.UI/ViewModels/Components/NavigationViewModel.cs
index ec54f59..005984d 100644
--- a/src/Desktop/RodelAgent.UI/ViewModels/Components/NavigationViewModel.cs
+++ b/src/Desktop/RodelAgent.UI/ViewModels/Components/NavigationViewModel.cs
@@ -3,6 +3,7 @@
using RodelAgent.UI.Forms;
using RodelAgent.UI.Models.Constants;
using RodelAgent.UI.Pages;
+using RodelAgent.UI.Pages.Internal;
using RodelAgent.UI.Toolkits;
namespace RodelAgent.UI.ViewModels.Components;
@@ -31,7 +32,7 @@ public sealed partial class NavigationViewModel : ViewModelBase, INavServiceView
private IReadOnlyCollection _footerItems;
///
- public void NavigateTo(string pageKey, object? parameter = null)
+ public void NavigateTo(Type pageType, object? parameter = null)
{
if (_navFrame is null)
{
@@ -46,25 +47,23 @@ public void NavigateTo(string pageKey, object? parameter = null)
_overFrame.Navigate(typeof(Page));
_overFrame.BackStack.Clear();
- if (pageKey == lastSelectedPage)
+ if (pageType.FullName == lastSelectedPage)
{
return;
}
}
- if (lastSelectedPage == pageKey && _navFrame.Content is not null && _navFrame.Content.GetType().FullName == lastSelectedPage)
+ if (lastSelectedPage == pageType.FullName && _navFrame.Content is not null && _navFrame.Content.GetType().FullName == lastSelectedPage)
{
return;
}
- SettingsToolkit.WriteLocalSetting(SettingNames.LastSelectedFeaturePage, pageKey);
- var pageType = Type.GetType(pageKey)
- ?? throw new InvalidOperationException("无法找到页面.");
+ SettingsToolkit.WriteLocalSetting(SettingNames.LastSelectedFeaturePage, pageType.FullName);
_navFrame.Navigate(pageType, parameter, new Microsoft.UI.Xaml.Media.Animation.EntranceNavigationTransitionInfo());
}
///
- public void NavigateToOver(string pageKey, object? parameter = null)
+ public void NavigateToOver(Type pageType, object? parameter = null)
{
if (_overFrame is null)
{
@@ -77,9 +76,6 @@ public void NavigateToOver(string pageKey, object? parameter = null)
}
ActiveMainWindow();
- var pageType = Type.GetType(pageKey)
- ?? throw new InvalidOperationException("无法找到页面.");
-
_overFrame.Navigate(pageType, parameter, new Microsoft.UI.Xaml.Media.Animation.EntranceNavigationTransitionInfo());
IsOverlayOpen = true;
}
@@ -153,15 +149,22 @@ private IReadOnlyList GetMenuItems()
private IReadOnlyList GetFooterItems()
{
- return new List
+ var list = new List
{
GetItem(StringNames.Settings, FluentIcons.Common.Symbol.Settings),
};
+
+ if (SettingsToolkit.ReadLocalSetting(SettingNames.IsInternalPromptTest, false))
+ {
+ list.Insert(0, GetItem(StringNames.PromptTest, FluentIcons.Common.Symbol.TextBulletListSquareEdit));
+ }
+
+ return list;
}
private AppNavigationItemViewModel GetItem(StringNames title, FluentIcons.Common.Symbol symbol, bool isSelected = false)
where TPage : Page
- => new AppNavigationItemViewModel(this, typeof(TPage).FullName, ResourceToolkit.GetLocalizedString(title), symbol, isSelected);
+ => new AppNavigationItemViewModel(this, typeof(TPage), ResourceToolkit.GetLocalizedString(title), symbol, isSelected);
private void ActiveMainWindow()
=> this.Get().DisplayWindows.Find(p => p is MainWindow)?.Activate();
diff --git a/src/Desktop/RodelAgent.UI/ViewModels/Items/AudioSessionViewModel.cs b/src/Desktop/RodelAgent.UI/ViewModels/Items/AudioSessionViewModel.cs
new file mode 100644
index 0000000..cd50d2c
--- /dev/null
+++ b/src/Desktop/RodelAgent.UI/ViewModels/Items/AudioSessionViewModel.cs
@@ -0,0 +1,19 @@
+// Copyright (c) Rodel. All rights reserved.
+
+using RodelAudio.Models.Client;
+
+namespace RodelAgent.UI.ViewModels.Items;
+
+///
+/// 音频会话视图模型.
+///
+public sealed partial class AudioSessionItemViewModel : ViewModelBase
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public AudioSessionItemViewModel(AudioSession data)
+ : base(data)
+ {
+ }
+}
diff --git a/src/Desktop/RodelAgent.UI/ViewModels/Items/DrawSessionItemViewModel.cs b/src/Desktop/RodelAgent.UI/ViewModels/Items/DrawSessionItemViewModel.cs
new file mode 100644
index 0000000..d8f8f2d
--- /dev/null
+++ b/src/Desktop/RodelAgent.UI/ViewModels/Items/DrawSessionItemViewModel.cs
@@ -0,0 +1,19 @@
+// Copyright (c) Rodel. All rights reserved.
+
+using RodelDraw.Models.Client;
+
+namespace RodelAgent.UI.ViewModels.Items;
+
+///
+/// 绘图会话项视图模型.
+///
+public sealed partial class DrawSessionItemViewModel : ViewModelBase
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public DrawSessionItemViewModel(DrawSession data)
+ : base(data)
+ {
+ }
+}
diff --git a/src/Desktop/RodelAgent.UI/ViewModels/Items/TranslateSessionItemViewModel.cs b/src/Desktop/RodelAgent.UI/ViewModels/Items/TranslateSessionItemViewModel.cs
new file mode 100644
index 0000000..8311323
--- /dev/null
+++ b/src/Desktop/RodelAgent.UI/ViewModels/Items/TranslateSessionItemViewModel.cs
@@ -0,0 +1,19 @@
+// Copyright (c) Rodel. All rights reserved.
+
+using RodelTranslate.Models.Client;
+
+namespace RodelAgent.UI.ViewModels.Items;
+
+///
+/// 翻译会话项视图模型.
+///
+public sealed partial class TranslateSessionItemViewModel : ViewModelBase
+{
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public TranslateSessionItemViewModel(TranslateSession data)
+ : base(data)
+ {
+ }
+}
diff --git a/src/Desktop/RodelAgent.UI/ViewModels/Pages/AudioServicePageViewModel/AudioServicePageViewModel.Properties.cs b/src/Desktop/RodelAgent.UI/ViewModels/Pages/AudioServicePageViewModel/AudioServicePageViewModel.Properties.cs
index 9ffa8ce..2b4cd45 100644
--- a/src/Desktop/RodelAgent.UI/ViewModels/Pages/AudioServicePageViewModel/AudioServicePageViewModel.Properties.cs
+++ b/src/Desktop/RodelAgent.UI/ViewModels/Pages/AudioServicePageViewModel/AudioServicePageViewModel.Properties.cs
@@ -3,7 +3,6 @@
using RodelAgent.Interfaces;
using RodelAgent.UI.ViewModels.Components;
using RodelAgent.UI.ViewModels.Items;
-using RodelAudio.Models.Client;
namespace RodelAgent.UI.ViewModels.Pages;
@@ -37,5 +36,5 @@ public sealed partial class AudioServicePageViewModel
///
/// 生成历史.
///
- public ObservableCollection History { get; } = new();
+ public ObservableCollection History { get; } = new();
}
diff --git a/src/Desktop/RodelAgent.UI/ViewModels/Pages/AudioServicePageViewModel/AudioServicePageViewModel.Services.cs b/src/Desktop/RodelAgent.UI/ViewModels/Pages/AudioServicePageViewModel/AudioServicePageViewModel.Services.cs
index 3f39a1c..54c065c 100644
--- a/src/Desktop/RodelAgent.UI/ViewModels/Pages/AudioServicePageViewModel/AudioServicePageViewModel.Services.cs
+++ b/src/Desktop/RodelAgent.UI/ViewModels/Pages/AudioServicePageViewModel/AudioServicePageViewModel.Services.cs
@@ -67,16 +67,16 @@ private async Task UpdateHistoryAsync()
}
[RelayCommand]
- private async Task DeleteHistoryItemAsync(AudioSession session)
+ private async Task DeleteHistoryItemAsync(AudioSessionItemViewModel session)
{
- if (Session.AudioPath?.Contains(session.Id) ?? false)
+ if (Session.AudioPath?.Contains(session.Data.Id) ?? false)
{
Session.ClearCommand.Execute(default);
Session.InitializeCommand.Execute(Session.AudioService.ProviderType);
}
History.Remove(session);
- await _storageService.RemoveAudioSessionAsync(session.Id);
+ await _storageService.RemoveAudioSessionAsync(session.Data.Id);
}
private void SyncAudioHistory(List list)
@@ -92,7 +92,7 @@ private void SyncAudioHistory(List list)
for (var i = History.Count - 1; i >= 0; i--)
{
var item = History[i];
- if (!listDict.ContainsKey(item.Id))
+ if (!listDict.ContainsKey(item.Data.Id))
{
History.RemoveAt(i);
}
@@ -104,14 +104,14 @@ private void SyncAudioHistory(List list)
if (i < History.Count)
{
var collectionItem = History[i];
- if (!Equals(listItem.Id, collectionItem.Id))
+ if (!Equals(listItem.Id, collectionItem.Data.Id))
{
- History.Insert(i, listItem);
+ History.Insert(i, new(listItem));
}
}
else
{
- History.Add(listItem);
+ History.Add(new(listItem));
}
}
}
diff --git a/src/Desktop/RodelAgent.UI/ViewModels/Pages/DrawServicePageViewModel/DrawServicePageViewModel.Properties.cs b/src/Desktop/RodelAgent.UI/ViewModels/Pages/DrawServicePageViewModel/DrawServicePageViewModel.Properties.cs
index a1c8901..20a4fd1 100644
--- a/src/Desktop/RodelAgent.UI/ViewModels/Pages/DrawServicePageViewModel/DrawServicePageViewModel.Properties.cs
+++ b/src/Desktop/RodelAgent.UI/ViewModels/Pages/DrawServicePageViewModel/DrawServicePageViewModel.Properties.cs
@@ -3,7 +3,6 @@
using RodelAgent.Interfaces;
using RodelAgent.UI.ViewModels.Components;
using RodelAgent.UI.ViewModels.Items;
-using RodelDraw.Models.Client;
namespace RodelAgent.UI.ViewModels.Pages;
@@ -37,5 +36,5 @@ public sealed partial class DrawServicePageViewModel
///
/// 生成历史.
///
- public ObservableCollection History { get; } = new();
+ public ObservableCollection History { get; } = new();
}
diff --git a/src/Desktop/RodelAgent.UI/ViewModels/Pages/DrawServicePageViewModel/DrawServicePageViewModel.Services.cs b/src/Desktop/RodelAgent.UI/ViewModels/Pages/DrawServicePageViewModel/DrawServicePageViewModel.Services.cs
index 75ac8ac..c36d41a 100644
--- a/src/Desktop/RodelAgent.UI/ViewModels/Pages/DrawServicePageViewModel/DrawServicePageViewModel.Services.cs
+++ b/src/Desktop/RodelAgent.UI/ViewModels/Pages/DrawServicePageViewModel/DrawServicePageViewModel.Services.cs
@@ -67,16 +67,16 @@ private async Task UpdateHistoryAsync()
}
[RelayCommand]
- private async Task DeleteHistoryItemAsync(DrawSession session)
+ private async Task DeleteHistoryItemAsync(DrawSessionItemViewModel session)
{
- if (Session.ImagePath?.Contains(session.Id) ?? false)
+ if (Session.ImagePath?.Contains(session.Data.Id) ?? false)
{
Session.ClearCommand.Execute(default);
Session.InitializeCommand.Execute(Session.DrawService.ProviderType);
}
History.Remove(session);
- await _storageService.RemoveDrawSessionAsync(session.Id);
+ await _storageService.RemoveDrawSessionAsync(session.Data.Id);
}
private void SyncDrawHistory(List list)
@@ -90,7 +90,7 @@ private void SyncDrawHistory(List list)
for (var i = History.Count - 1; i >= 0; i--)
{
var item = History[i];
- if (!listDict.ContainsKey(item.Id))
+ if (!listDict.ContainsKey(item.Data.Id))
{
History.RemoveAt(i);
}
@@ -102,14 +102,14 @@ private void SyncDrawHistory(List list)
if (i < History.Count)
{
var collectionItem = History[i];
- if (!Equals(listItem.Id, collectionItem.Id))
+ if (!Equals(listItem.Id, collectionItem.Data.Id))
{
- History.Insert(i, listItem);
+ History.Insert(i, new(listItem));
}
}
else
{
- History.Add(listItem);
+ History.Add(new(listItem));
}
}
}
diff --git a/src/Desktop/RodelAgent.UI/ViewModels/Pages/TranslateServicePageViewModel/TranslateServicePageViewModel.Properties.cs b/src/Desktop/RodelAgent.UI/ViewModels/Pages/TranslateServicePageViewModel/TranslateServicePageViewModel.Properties.cs
index 7cafc17..e90d941 100644
--- a/src/Desktop/RodelAgent.UI/ViewModels/Pages/TranslateServicePageViewModel/TranslateServicePageViewModel.Properties.cs
+++ b/src/Desktop/RodelAgent.UI/ViewModels/Pages/TranslateServicePageViewModel/TranslateServicePageViewModel.Properties.cs
@@ -3,7 +3,6 @@
using RodelAgent.Interfaces;
using RodelAgent.UI.ViewModels.Components;
using RodelAgent.UI.ViewModels.Items;
-using RodelTranslate.Models.Client;
namespace RodelAgent.UI.ViewModels.Pages;
@@ -37,5 +36,5 @@ public sealed partial class TranslateServicePageViewModel
///
/// 翻译会话.
///
- public ObservableCollection History { get; } = new();
+ public ObservableCollection History { get; } = new();
}
diff --git a/src/Desktop/RodelAgent.UI/ViewModels/Pages/TranslateServicePageViewModel/TranslateServicePageViewModel.Services.cs b/src/Desktop/RodelAgent.UI/ViewModels/Pages/TranslateServicePageViewModel/TranslateServicePageViewModel.Services.cs
index 268b549..5743a65 100644
--- a/src/Desktop/RodelAgent.UI/ViewModels/Pages/TranslateServicePageViewModel/TranslateServicePageViewModel.Services.cs
+++ b/src/Desktop/RodelAgent.UI/ViewModels/Pages/TranslateServicePageViewModel/TranslateServicePageViewModel.Services.cs
@@ -3,7 +3,6 @@
using RodelAgent.UI.Models.Constants;
using RodelAgent.UI.Toolkits;
using RodelAgent.UI.ViewModels.Items;
-using RodelTranslate.Models.Client;
using RodelTranslate.Models.Constants;
namespace RodelAgent.UI.ViewModels.Pages;
@@ -67,15 +66,15 @@ private async Task ReloadHistoryAsync()
var history = await _storageService.GetTranslateSessionsAsync(provider);
foreach (var item in history)
{
- History.Add(item);
+ History.Add(new(item));
}
}
[RelayCommand]
- private async Task DeleteHistoryItemAsync(TranslateSession session)
+ private async Task DeleteHistoryItemAsync(TranslateSessionItemViewModel session)
{
History.Remove(session);
- await _storageService.RemoveTranslateSessionAsync(session.Id);
+ await _storageService.RemoveTranslateSessionAsync(session.Data.Id);
}
private void SyncTranslateServices(List list)
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index d2b6d82..b661856 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -19,12 +19,11 @@
- 3.3.4
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
-
+
+
diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props
new file mode 100644
index 0000000..d97072f
--- /dev/null
+++ b/src/Directory.Packages.props
@@ -0,0 +1,131 @@
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
\ No newline at end of file
diff --git a/src/Libs/WinUI.Share b/src/Libs/WinUI.Share
index 89c0638..4846cd2 160000
--- a/src/Libs/WinUI.Share
+++ b/src/Libs/WinUI.Share
@@ -1 +1 @@
-Subproject commit 89c06385b092aa502637df4de45133af735b58c3
+Subproject commit 4846cd2e5b5340c547630618ffc8ff93d56d2ac8
diff --git a/src/RodelAgent.sln b/src/RodelAgent.sln
index aa5eacb..652fafa 100644
--- a/src/RodelAgent.sln
+++ b/src/RodelAgent.sln
@@ -1225,8 +1225,8 @@ Global
{1FBF3551-0028-4BB1-99EF-AE2513A2F324}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1FBF3551-0028-4BB1-99EF-AE2513A2F324}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{1FBF3551-0028-4BB1-99EF-AE2513A2F324}.Debug|ARM64.Build.0 = Debug|Any CPU
- {1FBF3551-0028-4BB1-99EF-AE2513A2F324}.Debug|x64.ActiveCfg = Debug|Any CPU
- {1FBF3551-0028-4BB1-99EF-AE2513A2F324}.Debug|x64.Build.0 = Debug|Any CPU
+ {1FBF3551-0028-4BB1-99EF-AE2513A2F324}.Debug|x64.ActiveCfg = Debug|x64
+ {1FBF3551-0028-4BB1-99EF-AE2513A2F324}.Debug|x64.Build.0 = Debug|x64
{1FBF3551-0028-4BB1-99EF-AE2513A2F324}.Debug|x86.ActiveCfg = Debug|Any CPU
{1FBF3551-0028-4BB1-99EF-AE2513A2F324}.Debug|x86.Build.0 = Debug|Any CPU
{1FBF3551-0028-4BB1-99EF-AE2513A2F324}.Publish|Any CPU.ActiveCfg = Publish|Any CPU
diff --git a/src/Samples/RodelAgent.Samples.Plugin/RodelAgent.Samples.Plugin.csproj b/src/Samples/RodelAgent.Samples.Plugin/RodelAgent.Samples.Plugin.csproj
index 80eddd9..1fa475d 100644
--- a/src/Samples/RodelAgent.Samples.Plugin/RodelAgent.Samples.Plugin.csproj
+++ b/src/Samples/RodelAgent.Samples.Plugin/RodelAgent.Samples.Plugin.csproj
@@ -7,8 +7,8 @@
-
-
+
+