add:新设置
This commit is contained in:
@@ -77,6 +77,9 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
// 截图和屏幕捕捉
|
||||
new SettingItem { Title = "截图和屏幕捕捉", Category = "截图和屏幕捕捉", ItemName = "SnapshotItem", Type = SettingItemType.Category },
|
||||
|
||||
// 更新中心
|
||||
new SettingItem { Title = "更新中心", Category = "更新中心", ItemName = "UpdateCenterItem", Type = SettingItemType.Category },
|
||||
|
||||
// 关于
|
||||
new SettingItem { Title = "关于 InkCanvasForClass", Category = "关于", ItemName = "AboutItem", Type = SettingItemType.Category },
|
||||
};
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<UserControl x:Class="Ink_Canvas.Windows.SettingsViews.UpdateCenterPanel"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="950" d:DesignWidth="640">
|
||||
<Grid>
|
||||
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="UpdateCenterScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2">
|
||||
<StackPanel Margin="0,12,0,24" HorizontalAlignment="Center" Width="524">
|
||||
<TextBlock Foreground="#2e3436" FontSize="18" FontWeight="Bold" Text="更新中心" Margin="0,0,0,20"/>
|
||||
<TextBlock Name="UpdateStatusText" Foreground="#878787" FontSize="14" Text="正在检查更新..." TextWrapping="Wrap" Margin="0,0,0,20"/>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
using iNKORE.UI.WPF.Helpers;
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Ink_Canvas.Windows.SettingsViews
|
||||
{
|
||||
public partial class UpdateCenterPanel : UserControl
|
||||
{
|
||||
public UpdateCenterPanel()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public event EventHandler<RoutedEventArgs> IsTopBarNeedShadowEffect;
|
||||
public event EventHandler<RoutedEventArgs> IsTopBarNeedNoShadowEffect;
|
||||
|
||||
private void ScrollViewerEx_ScrollChanged(object sender, ScrollChangedEventArgs e)
|
||||
{
|
||||
var scrollViewer = (ScrollViewer)sender;
|
||||
if (scrollViewer.VerticalOffset >= 10)
|
||||
{
|
||||
IsTopBarNeedShadowEffect?.Invoke(this, new RoutedEventArgs());
|
||||
}
|
||||
else
|
||||
{
|
||||
IsTopBarNeedNoShadowEffect?.Invoke(this, new RoutedEventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
public void ApplyTheme()
|
||||
{
|
||||
try
|
||||
{
|
||||
ThemeHelper.ApplyThemeToControl(this);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"UpdateCenterPanel 应用主题时出错: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user