code style

This commit is contained in:
Lightczx
2024-01-30 09:18:11 +08:00
parent 28d702422e
commit 917c173eb2
3 changed files with 17 additions and 21 deletions

View File

@@ -7,7 +7,6 @@ using Microsoft.UI.Xaml.Controls;
namespace Snap.Hutao.Control.Helper;
[SuppressMessage("", "SH001")]
[DependencyProperty("LeftPanelMaxWidth", typeof(double), IsAttached = true, AttachedType = typeof(ScrollViewer))]
[DependencyProperty("RightPanel", typeof(UIElement), IsAttached = true, AttachedType = typeof(ScrollViewer))]
public sealed partial class ScrollViewerHelper
{

View File

@@ -42,7 +42,7 @@
Grid.ColumnSpan="2"
Margin="{TemplateBinding Padding}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" MaxWidth="{Binding Path=(shch:ScrollViewerHelper.LeftPanelMaxWidth), RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ScrollContentPresenter x:Name="ScrollContentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}"/>

View File

@@ -22,22 +22,7 @@
</mxi:Interaction.Behaviors>
<Grid x:Name="SettingPageGrid">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState>
<VisualState.StateTriggers>
<cw:ControlSizeTrigger MinWidth="1000" TargetElement="{Binding ElementName=SettingPageGrid}"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="ScrollViwerRightPanel.Visibility" Value="Visible"/>
<Setter Target="ScrollViwerTopPanel.Visibility" Value="Collapsed"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ScrollViewer shch:ScrollViewerHelper.LeftPanelMaxWidth="1000" Style="{StaticResource TwoPanelScrollViewerStyle}">
<ScrollViewer Style="{StaticResource TwoPanelScrollViewerStyle}">
<shch:ScrollViewerHelper.RightPanel>
<StackPanel
x:Name="ScrollViwerRightPanel"
@@ -129,7 +114,7 @@
<StackPanel
x:Name="ScrollViwerTopPanel"
Margin="0,0,0,4"
Margin="0,0,0,3"
Spacing="{StaticResource SettingsCardSpacing}"
Visibility="Visible">
<Border Margin="1,0,1,2" cw:Effects.Shadow="{ThemeResource CompatCardShadow}">
@@ -224,7 +209,7 @@
ItemsRepeater will behave abnormal if no direct scrollhost wrapping it
-->
<ScrollViewer
Margin="0,-4,0,0"
Margin="0,-3,0,0"
HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Disabled">
<cwc:SettingsExpander
@@ -542,7 +527,19 @@
</Grid>
</ScrollViewer>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState>
<VisualState.StateTriggers>
<cw:ControlSizeTrigger MinWidth="1000" TargetElement="{Binding ElementName=SettingPageGrid}"/>
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="ScrollViwerRightPanel.Visibility" Value="Visible"/>
<Setter Target="ScrollViwerTopPanel.Visibility" Value="Collapsed"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</shc:ScopedPage>