Files
community/Ink Canvas/Windows/SettingsViews/SettingsViews/SettingsBaseView.xaml
T
doudou0720 016abafee4 fix(UI): 为新设置、云储存管理添加基本触控支持 (#409)
实测部分按钮(如新设置的云储存按钮)仍然有问题

统一设置所有ScrollViewer控件的PanningMode为VerticalOnly,防止水平滚动干扰用户体验

Signed-off-by: doudou0720 <98651603+doudou0720@users.noreply.github.com>
2026-03-21 17:46:19 +08:00

55 lines
4.1 KiB
XML

<UserControl x:Class="Ink_Canvas.Windows.SettingsViews.SettingsBaseView"
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"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:controls="http://schemas.inkore.net/lib/ui/wpf/modern"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="SettingsViewScrollViewer" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2" PanningMode="VerticalOnly">
<ItemsControl Name="SettingsViewBaseItemsControl">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Margin="0,12,0,24" HorizontalAlignment="Center" Width="524"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical" Margin="0,0,0,25">
<TextBlock Visibility="{Binding _TitleVisibility}" Text="{Binding Title}" FontSize="15" FontWeight="Bold" Foreground="#2e3436"/>
<Border Margin="{Binding _PanelMargin}" Background="#fafafa" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<ItemsControl ItemsSource="{Binding Items}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"></StackPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical">
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="{Binding Title}" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{Binding Description}" HorizontalAlignment="Left"/>
</StackPanel>
<controls:ToggleSwitch IsEnabled="{Binding ToggleSwitchEnabled}" IsOn="{Binding ToggleSwitchToggled, Mode=TwoWay}" Tag="{Binding}" Visibility="{Binding _ToggleSwitchVisibility}" Margin="0,0,15,0"/>
</Grid>
<Border Visibility="{Binding _SeparatorVisibility}" Height="1" Background="#ebebeb"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</Border>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</UserControl>