refactor(FeedBack): 将反馈页面拆分为独立组件并重构导航逻辑
将反馈窗口的三个页面拆分为独立的用户控件组件,使用Frame实现页面导航 重构按钮点击事件处理逻辑,简化状态管理 添加页面切换动画效果 Signed-off-by: doudou0720 <98651603+doudou0720@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
<UserControl
|
||||
x:Class="Ink_Canvas.Windows.FeedbackPages.FeedbackPage1"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="600">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<ikw:SimpleStackPanel Spacing="12">
|
||||
<TextBlock FontSize="20" FontWeight="SemiBold" Margin="0,0,0,10" Text="选择要包含的信息"/>
|
||||
|
||||
<ui:SettingsExpander x:Name="ExpanderSoftware" Header="软件信息"
|
||||
Description="选择要包含在反馈中的软件版本信息">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.AppIconDefault}"/>
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckAppVersion" IsChecked="True" Content="软件版本"/>
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckUpdateChannel" IsChecked="True" Content="更新通道"/>
|
||||
</ui:SettingsCard>
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
|
||||
<ui:SettingsExpander x:Name="ExpanderSystem" Header="系统信息"
|
||||
Description="选择要包含在反馈中的系统环境信息">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.PC1}"/>
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckOSVersion" IsChecked="True" Content="操作系统版本"/>
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckNetVersion" IsChecked="True" Content=".NET Framework 版本"/>
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckTouchSupport" IsChecked="True" Content="触控支持"/>
|
||||
</ui:SettingsCard>
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
|
||||
<ui:SettingsExpander x:Name="ExpanderDevice" Header="设备信息"
|
||||
Description="选择要包含在反馈中的设备标识信息">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Devices2}"/>
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckDeviceId" IsChecked="False" Content="设备 ID"/>
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard x:Name="CardFanceId" ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckFanceId" IsChecked="False" Content="遥测 ID" ToolTipService.ShowOnDisabled="True">
|
||||
<CheckBox.ToolTip>
|
||||
<ToolTip>
|
||||
<TextBlock>暂无遥测 ID</TextBlock>
|
||||
</ToolTip>
|
||||
</CheckBox.ToolTip>
|
||||
</CheckBox>
|
||||
</ui:SettingsCard>
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
|
||||
<ui:SettingsExpander x:Name="ExpanderConfiguration" Header="软件配置"
|
||||
Description="选择要包含在反馈中的软件配置信息">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Settings}"/>
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckPPTLinkage" IsChecked="True" Content="PPT 联动设置"/>
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckInkRecognition" IsChecked="True" Content="墨迹识别设置"/>
|
||||
</ui:SettingsCard>
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
</ikw:SimpleStackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Ink_Canvas.Windows.FeedbackPages
|
||||
{
|
||||
public partial class FeedbackPage1 : UserControl
|
||||
{
|
||||
public FeedbackPage1()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<UserControl
|
||||
x:Class="Ink_Canvas.Windows.FeedbackPages.FeedbackPage2"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="600">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<ikw:SimpleStackPanel Spacing="12" Margin="0,0,0,20">
|
||||
<TextBlock FontSize="20" FontWeight="SemiBold" Margin="0,0,0,10" Text="确认要发送的信息"/>
|
||||
|
||||
<ui:SettingsCard Header="软件信息"
|
||||
Description="将要包含在反馈中的软件版本信息">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.AppIconDefault}"/>
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ikw:SimpleStackPanel Spacing="8">
|
||||
<TextBlock x:Name="TextAppVersionInfo" Text="" FontSize="14" TextWrapping="Wrap"/>
|
||||
</ikw:SimpleStackPanel>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard Header="系统信息"
|
||||
Description="将要包含在反馈中的系统环境信息">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.PC1}"/>
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ikw:SimpleStackPanel Spacing="8">
|
||||
<TextBlock x:Name="TextSystemInfo" Text="" FontSize="14" TextWrapping="Wrap"/>
|
||||
</ikw:SimpleStackPanel>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard Header="设备信息"
|
||||
Description="将要包含在反馈中的设备标识信息">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Devices2}"/>
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ikw:SimpleStackPanel Spacing="8">
|
||||
<TextBlock x:Name="TextDeviceInfo" Text="" FontSize="14" TextWrapping="Wrap"/>
|
||||
<TextBlock x:Name="TextTelemetryInfo" Text="" FontSize="14" TextWrapping="Wrap" Visibility="Collapsed"/>
|
||||
</ikw:SimpleStackPanel>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard x:Name="CardConfiguration" Header="软件配置"
|
||||
Description="将要包含在反馈中的软件配置信息">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Settings}"/>
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ikw:SimpleStackPanel Spacing="8">
|
||||
<TextBlock x:Name="TextConfigurationInfo" Text="" FontSize="14" TextWrapping="Wrap"/>
|
||||
</ikw:SimpleStackPanel>
|
||||
</ui:SettingsCard>
|
||||
</ikw:SimpleStackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Ink_Canvas.Windows.FeedbackPages
|
||||
{
|
||||
public partial class FeedbackPage2 : UserControl
|
||||
{
|
||||
public FeedbackPage2()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<UserControl
|
||||
x:Class="Ink_Canvas.Windows.FeedbackPages.FeedbackPage3"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="600">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
<ikw:SimpleStackPanel Spacing="12" Margin="0,0,0,20">
|
||||
<TextBlock FontSize="20" FontWeight="SemiBold" Margin="0,0,0,10" Text="选择反馈方式"/>
|
||||
|
||||
<ui:SettingsExpander x:Name="ExpanderGitHubFeedback" Header="GitHub 问题反馈"
|
||||
Description="在 GitHub 上提交问题反馈">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Mail}"/>
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<Button x:Name="BtnOpenGitHubIssue" Content="跳转到 GitHub 反馈">
|
||||
<Button.Style>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource {x:Static ui:ThemeKeys.AccentButtonStyleKey}}"/>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard x:Name="CardCopyIssueUrl" Header="复制反馈链接" IsClickEnabled="True">
|
||||
<ui:SettingsCard.ActionIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Copy}"/>
|
||||
</ui:SettingsCard.ActionIcon>
|
||||
</ui:SettingsCard>
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
|
||||
<ui:SettingsExpander x:Name="ExpanderMarkdownTemplate" Header="反馈模板 (Markdown)"
|
||||
Description="复制以下 Markdown 模板进行反馈">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Code}"/>
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<Button x:Name="BtnCopyMarkdown" Content="复制模板">
|
||||
<Button.Style>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource {x:Static ui:ThemeKeys.DefaultButtonStyleKey}}"/>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<TextBox x:Name="TextBoxMarkdownTemplate"
|
||||
MinHeight="200"
|
||||
IsReadOnly="True"
|
||||
BorderThickness="0"
|
||||
Background="Transparent"
|
||||
FontFamily="Consolas"
|
||||
FontSize="12"
|
||||
TextWrapping="Wrap"
|
||||
AcceptsReturn="True"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
Text="# 问题描述
请描述您遇到的问题...

# 重现步骤
1. 
2. 
3. 

# 预期行为
请描述您期望的行为...

# 实际行为
请描述实际发生的...

# 环境信息
- 版本: 
- 系统: 
"/>
|
||||
</ui:SettingsCard>
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
</ikw:SimpleStackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Ink_Canvas.Windows.FeedbackPages
|
||||
{
|
||||
public partial class FeedbackPage3 : UserControl
|
||||
{
|
||||
public event EventHandler<RoutedEventArgs> BtnOpenGitHubIssueClick;
|
||||
public event EventHandler<RoutedEventArgs> CardCopyIssueUrlClick;
|
||||
public event EventHandler<RoutedEventArgs> BtnCopyMarkdownClick;
|
||||
|
||||
public FeedbackPage3()
|
||||
{
|
||||
InitializeComponent();
|
||||
BtnOpenGitHubIssue.Click += (s, e) => BtnOpenGitHubIssueClick?.Invoke(this, e);
|
||||
CardCopyIssueUrl.Click += (s, e) => CardCopyIssueUrlClick?.Invoke(this, e);
|
||||
BtnCopyMarkdown.Click += (s, e) => BtnCopyMarkdownClick?.Invoke(this, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user