更新窗口的snap layouts和tab样式

This commit is contained in:
GG Z
2025-09-09 21:41:37 +08:00
parent 6ef36a08db
commit a86ed1c670
9 changed files with 199 additions and 75 deletions

View File

@@ -397,7 +397,7 @@
Content="禁用按钮"
IsEnabled="False" />
<Button Content="拟态" Style="{StaticResource NeuButtonStyle}" />
<Button Content="拟态" Style="{StaticResource NeuButtonStyle}"/>
<Button
Content="禁用拟态"
IsEnabled="False"
@@ -468,6 +468,10 @@
<RepeatButton Content="RepeatButton" />
<RepeatButton Content="RepeatButton" IsEnabled="False" />
</UniformGrid>
<UniformGrid Rows="1">
<Button Style="{StaticResource IconButton}" n:ButtonAssist.Icon="{n:Icon SymbolValue=Add}"/>
<Button IsEnabled="False" Style="{StaticResource IconButton}" n:ButtonAssist.Icon="{n:Icon SymbolValue=Add}"/>
</UniformGrid>
</StackPanel>
</StackPanel>
@@ -988,8 +992,7 @@
<TreeViewItem Header="A123" IsExpanded="True">
<TreeViewItem
Header="B123"
IsExpanded="True"
IsSelected="True">
IsExpanded="True">
<TreeViewItem Header="C123" />
</TreeViewItem>
<TreeViewItem Header="B456" IsEnabled="False" />
@@ -1043,7 +1046,7 @@
</ListView>
</n:FlexibleRowPanel>
<n:FlexibleRowPanel LayoutMode="Auto" Spacing="100">
<n:FlexibleRowPanel LayoutMode="Auto" Spacing="20">
<UniformGrid Columns="1">
<ListBox
HorizontalAlignment="Center"
@@ -1066,8 +1069,33 @@
<sys:String>Tab 3</sys:String>
<sys:String>Another Tab</sys:String>
</ListBox>
<ListBox
IsEnabled="False"
HorizontalAlignment="Center"
VerticalAlignment="Center"
n:ListBoxSlideBehavior.EnableSlideAnimation="True"
SelectedIndex="1"
Style="{StaticResource SlideTabGroupListBoxStyle}">
<!-- 这里是你的数据项 -->
<sys:String>Tab 1</sys:String>
<sys:String>Tab 2</sys:String>
<sys:String>Tab 3</sys:String>
<sys:String>Another Tab</sys:String>
</ListBox>
</UniformGrid>
<ListBox
HorizontalAlignment="Center"
VerticalAlignment="Center"
n:SelectorAssist.Orientation="Vertical"
SelectedIndex="1"
SelectionMode="Multiple"
Style="{StaticResource TabGroupListBoxStyle}">
<ListBoxItem Content="Home" />
<ListBoxItem Content="Away" />
<ListBoxItem Content="Night" />
</ListBox>
<ListBox
IsEnabled="False"
HorizontalAlignment="Center"
VerticalAlignment="Center"
n:SelectorAssist.Orientation="Vertical"
@@ -1078,6 +1106,7 @@
<ListBoxItem Content="Night" />
</ListBox>
<ListBox
SelectionMode="Multiple"
HorizontalAlignment="Center"
VerticalAlignment="Center"
n:ListBoxSlideBehavior.EnableSlideAnimation="True"
@@ -1190,15 +1219,15 @@
ToolTip="双击展开详情">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDoubleClick">
<i:InvokeCommandAction Command="{Binding ToggleDetailsCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=DataGrid}, Path=SelectedItem}" />
<i:InvokeCommandAction Command="{Binding ToggleDetailsCommand}" CommandParameter="{Binding SelectedItem, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<!-- 2. RowStyle现在只负责绑定详情可见性不再处理事件 -->
<DataGrid.RowStyle>
<Style BasedOn="{StaticResource DataGridRowDefault}" TargetType="DataGridRow">
<n:NeuDataGrid.RowStyle>
<Style BasedOn="{StaticResource DataGridRowDefault}" TargetType="{x:Type DataGridRow}">
<Setter Property="DetailsVisibility" Value="{Binding IsDetailsVisible, Converter={x:Static n:BooleanToVisibilityConverter.CollapsedInstance}, Mode=TwoWay}" />
</Style>
</DataGrid.RowStyle>
</n:NeuDataGrid.RowStyle>
<n:NeuDataGrid.RowDetailsTemplate>
<DataTemplate>
<StackPanel Margin="10">
@@ -1228,7 +1257,7 @@
<HierarchicalDataTemplate DataType="{x:Type neuwpftest:TreeNodeItem}" ItemsSource="{Binding Children}">
<!-- 使用 GridViewRowPresenter 来确保内容与表头列对齐 -->
<!-- Columns 属性必须绑定到 TreeGrid 的 Columns 集合 -->
<GridViewRowPresenter Columns="{Binding Path=Columns, RelativeSource={RelativeSource AncestorType=n:TreeGrid}}" Content="{Binding}" />
<GridViewRowPresenter Columns="{Binding Columns, RelativeSource={RelativeSource AncestorType={x:Type n:TreeGrid}}}" Content="{Binding}" />
</HierarchicalDataTemplate>
</n:TreeGrid.ItemTemplate>
<!-- 直接定义 GridViewColumn 集合,就像使用 ListView 一样 -->
@@ -1261,7 +1290,7 @@
Width="200"
BorderBrush="Gray"
BorderThickness="1">
<n:AccordionItem Header="User Profile">
<n:AccordionItem Header="User Profile" IsExpanded="True">
<StackPanel Margin="10">
<TextBlock Text="Name: John Doe" />
<TextBlock Text="Email: john.doe@example.com" />
@@ -1279,13 +1308,13 @@
<TextBlock Text="Email: john.doe@example.com" />
</StackPanel>
</n:AccordionItem>
<n:AccordionItem Header="Application Settings">
<StackPanel Margin="10">
<n:AccordionItem Header="Application Settings" IsExpanded="True">
<StackPanel>
<CheckBox Content="Enable Dark Mode" />
<CheckBox Content="Auto-save every 5 minutes" />
</StackPanel>
</n:AccordionItem>
<n:AccordionItem Header="Help &amp; Support">
<n:AccordionItem Header="Help &amp; Support" IsExpanded="True">
<TextBlock
Margin="10"
Text="For support, please visit our website."
@@ -1297,7 +1326,7 @@
BorderThickness="1"
ItemsSource="{Binding Items}">
<n:Accordion.ItemContainerStyle>
<Style BasedOn="{StaticResource {x:Type n:AccordionItem}}" TargetType="n:AccordionItem">
<Style BasedOn="{StaticResource {x:Type n:AccordionItem}}" TargetType="{x:Type n:AccordionItem}">
<Setter Property="Header" Value="{Binding Label}" />
<Setter Property="Content">
<Setter.Value>