样式demo

This commit is contained in:
GG Z
2025-12-28 11:47:54 +08:00
parent ceccab9abb
commit 1fd8d2ced7
65 changed files with 2369 additions and 799 deletions

View File

@@ -138,57 +138,17 @@
</ComboBox>
</ToolBar>
<ToolBar Foreground="{DynamicResource PrimaryFocusedBrush}" Header="工具栏">
<ToggleButton Content="切换" />
<Button
x:Name="Test"
Click="Test_OnClick"
Content="测试" />
Content="测试窗口" />
<Button Click="Icon_OnClick" Content="图标" />
<Button Click="ColorPalette_OnClick" Content="配色" />
<Button Click="ShowNeumorphism_Click" Content="Neumorphism" />
</ToolBar>
</ToolBarTray>
<!-- 中间部分 -->
<n:Anchor Grid.Row="1" Margin="4">
<n:StackPanel Spacing="5">
<GroupBox n:ControlAssist.AnchorHeaderText="装饰器 Decoration" Header="装饰器">
<StackPanel>
<n:FlexibleRowPanel>
<n:SlotBorder
Height="100"
Margin="5"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Content="凹槽"
CornerRadius="16"
FontSize="24"
Foreground="{DynamicResource PrimaryGradientBrush}" />
<n:EmbossBorder
Margin="5"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Content="浮雕"
ContextMenu="{StaticResource ContextMenuDemo}"
CornerRadius="16"
FontSize="24"
Foreground="{DynamicResource PrimaryGradientBrush}"
ToolTip="右键" />
<n:Card
Margin="5"
Content="卡片"
CornerRadius="16"
FontSize="24"
Foreground="{DynamicResource PrimaryGradientBrush}" />
</n:FlexibleRowPanel>
<n:LightedSurface
Height="100"
Margin="5"
Content="在此处移动鼠标"
CornerRadius="16"
FontSize="24"
Foreground="{DynamicResource PrimaryGradientBrush}" />
</StackPanel>
</GroupBox>
<StackPanel n:ControlAssist.AnchorHeaderText="警告提示 Alert">
<StackPanel>
<CheckBox x:Name="IsBanner" Content="标题" />
@@ -337,10 +297,6 @@
</n:FlexibleRowPanel>
<n:FlexibleRowPanel>
<n:Tag Content="默认标签" />
<n:Tag
Closable="True"
Content="可关闭标签"
Style="{StaticResource EmbossTag}" />
<n:Tag
Closable="True"
Content="颜色标签"
@@ -381,7 +337,7 @@
ColumnSpacing="0"
Columns="6"
RowSpacing="0"
Rows="4">
Rows="2">
<Button n:ControlAssist.Icon="{n:Icon SymbolValue=SmartButton}" Content="基本" />
<Button
n:ControlAssist.Icon="{n:Icon SymbolValue=SmartButton}"
@@ -678,42 +634,6 @@
<n:ToggleSwitch IsChecked="True" IsEnabled="False" />
</n:FlexibleRowPanel>
<n:FlexibleRowPanel>
<n:ToggleSwitch IsChecked="False" Style="{StaticResource FloatToggleSwitchStyle}" />
<n:ToggleSwitch
IsChecked="False"
IsEnabled="False"
Style="{StaticResource FloatToggleSwitchStyle}" />
<n:ToggleSwitch IsChecked="True" Style="{StaticResource FloatToggleSwitchStyle}" />
<n:ToggleSwitch
IsChecked="True"
IsEnabled="False"
Style="{StaticResource FloatToggleSwitchStyle}" />
</n:FlexibleRowPanel>
<n:FlexibleRowPanel>
<n:ToggleSwitch
n:ControlAssist.OffContent="{n:Icon SymbolValue=ToggleOff}"
n:ControlAssist.OnContent="{n:Icon ToggleOn}"
n:ControlAssist.ShowText="True"
IsChecked="True"
Style="{StaticResource SlotToggleSwitch}" />
<n:ToggleSwitch
n:ControlAssist.OffContent="{n:Icon SymbolValue=ToggleOff}"
n:ControlAssist.OnContent="{n:Icon ToggleOn}"
IsChecked="True"
IsEnabled="False"
Style="{StaticResource SlotToggleSwitch}" />
<n:ToggleSwitch
n:ControlAssist.ShowText="False"
IsChecked="False"
Style="{StaticResource SlotToggleSwitch}" />
<n:ToggleSwitch
IsChecked="False"
IsEnabled="False"
Style="{StaticResource SlotToggleSwitch}" />
</n:FlexibleRowPanel>
</StackPanel>
<StackPanel n:ControlAssist.AnchorHeaderText="文本标签 Label">
<UniformGrid Rows="1">
@@ -743,39 +663,7 @@
IsChecked="True"
IsEnabled="False" />
</UniformGrid>
<UniformGrid Rows="1">
<CheckBox Content="复选框" Style="{StaticResource SlotCheckBoxStyle}" />
<CheckBox
Content="复选框"
IsEnabled="False"
Style="{StaticResource SlotCheckBoxStyle}" />
<CheckBox
Content="复选框"
IsChecked="True"
Style="{StaticResource SlotCheckBoxStyle}" />
<CheckBox
Content="复选框"
IsChecked="True"
IsEnabled="False"
Style="{StaticResource SlotCheckBoxStyle}" />
</UniformGrid>
</StackPanel>
<UniformGrid Rows="1">
<CheckBox Content="复选框" Style="{StaticResource EmbossCheckBoxStyle}" />
<CheckBox
Content="复选框"
IsEnabled="False"
Style="{StaticResource EmbossCheckBoxStyle}" />
<CheckBox
Content="复选框"
IsChecked="True"
Style="{StaticResource EmbossCheckBoxStyle}" />
<CheckBox
Content="复选框"
IsChecked="True"
IsEnabled="False"
Style="{StaticResource EmbossCheckBoxStyle}" />
</UniformGrid>
<StackPanel n:ControlAssist.AnchorHeaderText="单选框 RadioButton">
<n:FlexibleRowPanel>
<RadioButton
@@ -803,28 +691,6 @@
GroupName="RadioG2"
IsEnabled="False" />
</n:FlexibleRowPanel>
<n:FlexibleRowPanel>
<RadioButton
Content="单选按钮 A"
GroupName="RadioG3"
IsChecked="True"
Style="{StaticResource EmbossRadioButtonStyle}" />
<RadioButton
Content="单选按钮 C"
GroupName="RadioG3"
Style="{StaticResource EmbossRadioButtonStyle}" />
<RadioButton
Content="禁用单选按钮 A"
GroupName="RadioG4"
IsChecked="True"
IsEnabled="False"
Style="{StaticResource EmbossRadioButtonStyle}" />
<RadioButton
Content="禁用单选按钮 C"
GroupName="RadioG4"
IsEnabled="False"
Style="{StaticResource EmbossRadioButtonStyle}" />
</n:FlexibleRowPanel>
</StackPanel>
<StackPanel n:ControlAssist.AnchorHeaderText="滑动/滚动条 Slider">
<Grid>
@@ -921,8 +787,8 @@
</StackPanel>
<StackPanel n:ControlAssist.AnchorHeaderText="文件、文件夹 Browser">
<n:FlexibleRowPanel>
<n:ChooseBox PlaceholderText="请选择路径" />
<n:ChooseBox IsEnabled="False" Text="选择路径" />
<n:ChooseBox />
<n:ChooseBox IsEnabled="False" />
</n:FlexibleRowPanel>
<UniformGrid Rows="1">
<n:UploadArea
@@ -951,7 +817,6 @@
<n:FlexibleRowPanel n:ControlAssist.AnchorHeaderText="时间日期 DataPicker" LayoutMode="Auto">
<StackPanel>
<DatePicker />
<DatePicker Style="{StaticResource SlotDatePicker}" />
</StackPanel>
<Calendar Margin="5">
<Calendar.BlackoutDates>
@@ -1053,7 +918,7 @@
</n:FlexibleRowPanel>
<n:FlexibleRowPanel LayoutMode="Auto" Spacing="20">
<UniformGrid Columns="1">
<UniformGrid Columns="3">
<ListBox
HorizontalAlignment="Center"
VerticalAlignment="Center"
@@ -1063,87 +928,14 @@
<ListBoxItem Content="Away" />
<ListBoxItem Content="Night" />
</ListBox>
<ListBox
HorizontalAlignment="Center"
VerticalAlignment="Center"
n:BehaviorAssist.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>
<ListBox
HorizontalAlignment="Center"
VerticalAlignment="Center"
n:BehaviorAssist.EnableSlideAnimation="True"
IsEnabled="False"
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:ControlAssist.Orientation="Vertical"
SelectedIndex="1"
SelectionMode="Multiple"
Style="{StaticResource SlotTabGroupListBoxStyle}">
<ListBoxItem Content="Home" />
<ListBoxItem Content="Away" />
<ListBoxItem Content="Night" />
</ListBox>
<ListBox
HorizontalAlignment="Center"
VerticalAlignment="Center"
n:ControlAssist.Orientation="Vertical"
IsEnabled="False"
SelectedIndex="1"
Style="{StaticResource SlotTabGroupListBoxStyle}">
<ListBoxItem Content="Home" />
<ListBoxItem Content="Away" />
<ListBoxItem Content="Night" />
</ListBox>
<ListBox
HorizontalAlignment="Center"
VerticalAlignment="Center"
n:BehaviorAssist.EnableSlideAnimation="True"
n:ControlAssist.Orientation="Vertical"
SelectedIndex="0"
SelectionMode="Multiple"
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>
</n:FlexibleRowPanel>
</StackPanel>
<StackPanel n:ControlAssist.AnchorHeaderText="数据展示 TabControl">
<WrapPanel>
<TabControl Style="{StaticResource NavigationTabControlStyle}">
<TabItem Header="选项卡 1">
<Grid Margin="4">
<!-- <Separator /> -->
<DataGrid
Margin="4"
DataContext="{StaticResource Dgd}"
ItemsSource="{Binding DataCollection}"
SelectedItem="{Binding SelectedDataGridItem}" />
</Grid>
</TabItem>
<TabItem Header="选项卡 2" />
<TabItem Header="禁用选项卡" IsEnabled="False" />
</TabControl>
<TabControl>
<TabItem Header="选项卡 1">