月更
This commit is contained in:
371
NeuWPF/NeuWPFTest/MainWindow.xaml
Normal file
371
NeuWPF/NeuWPFTest/MainWindow.xaml
Normal file
@@ -0,0 +1,371 @@
|
||||
<Window x:Class="NeuWPFTest.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:dm="clr-namespace:NeuWPFTest.DataModel"
|
||||
xmlns:enu="https://github.com/ShrlAlgo/NeuWPF"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Width="1000"
|
||||
Height="800"
|
||||
mc:Ignorable="d"
|
||||
d:Height="Auto"
|
||||
d:SizeToContent="WidthAndHeight"
|
||||
Icon="/Resources/Images/SyminUI.png"
|
||||
Loaded="Window_Loaded"
|
||||
Selector.SelectionChanged="TabControl_SelectionChanged"
|
||||
Style="{StaticResource Window.Normal}"
|
||||
Title="样式示例"
|
||||
WindowStartupLocation="CenterScreen">
|
||||
|
||||
<enu:WindowAssist.TitleBar>
|
||||
<!-- <Grid VerticalAlignment="Center"> -->
|
||||
<!-- <Grid.ColumnDefinitions> -->
|
||||
<!-- <ColumnDefinition /> -->
|
||||
<!-- <ColumnDefinition Width="Auto" /> -->
|
||||
<!-- </Grid.ColumnDefinitions> -->
|
||||
<!-- -->
|
||||
<!-- <Button -->
|
||||
<!-- Content="切换主题" -->
|
||||
<!-- Grid.Column="1" -->
|
||||
<!-- VerticalAlignment="Center" /> -->
|
||||
<!-- </Grid> -->
|
||||
<Menu>
|
||||
<MenuItem Header="文件">
|
||||
<MenuItem Header="打开" />
|
||||
<MenuItem Header="打开最近文件...">
|
||||
<MenuItem Header="文件01" />
|
||||
<MenuItem Header="文件02" />
|
||||
<MenuItem Header="文件03" />
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Header="保存" />
|
||||
<MenuItem Header="另存为..." />
|
||||
</MenuItem>
|
||||
|
||||
<MenuItem Header="编辑">
|
||||
<MenuItem Header="删除" />
|
||||
<MenuItem Header="编辑模式"
|
||||
IsCheckable="True"
|
||||
IsChecked="True" />
|
||||
</MenuItem>
|
||||
<MenuItem Header="复选"
|
||||
IsCheckable="True"
|
||||
IsChecked="True" />
|
||||
<MenuItem Header="帮助">
|
||||
<MenuItem Header="关于" />
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</enu:WindowAssist.TitleBar>
|
||||
<Window.Resources>
|
||||
<ResourceDictionary>
|
||||
<!-- <ResourceDictionary.MergedDictionaries> -->
|
||||
<!-- <enu:ThemesDictionary Theme="Dark" /> -->
|
||||
<!-- <enu:ControlsDictionary /> -->
|
||||
<!-- </ResourceDictionary.MergedDictionaries> -->
|
||||
<dm:DataGridDemo x:Key="Dgd" />
|
||||
<ContextMenu x:Key="ContextMenuDemo">
|
||||
<MenuItem Header="菜单01" />
|
||||
<MenuItem Header="菜单02" />
|
||||
<Separator />
|
||||
<MenuItem Header="菜单03">
|
||||
<MenuItem Header="菜单A1" />
|
||||
<MenuItem Header="菜单A2" />
|
||||
<Separator />
|
||||
<MenuItem Header="菜单A3" />
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</ResourceDictionary>
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="24" />
|
||||
</Grid.RowDefinitions>
|
||||
<!-- 工具栏 -->
|
||||
<ToolBarTray Margin="4,4,4,0">
|
||||
<ToolBar Foreground="{DynamicResource Primary.Focused}" Header="工具栏">
|
||||
<Button Click="Switch_OnClick" Content="切换主题" />
|
||||
<ToggleButton Content="切换" />
|
||||
<Separator />
|
||||
<RadioButton Content="单选框A" IsChecked="True" />
|
||||
<RadioButton Content="单选框B" />
|
||||
<TextBox Width="100" Text="文本框" />
|
||||
<CheckBox Content="复选框" />
|
||||
<Separator />
|
||||
<ComboBox Width="100" SelectedIndex="0">
|
||||
<ComboBoxItem Content="选项01" />
|
||||
<ComboBoxItem Content="选项02" />
|
||||
<ComboBoxItem Content="选项03" />
|
||||
</ComboBox>
|
||||
</ToolBar>
|
||||
<ToolBar Foreground="{DynamicResource Primary.Focused}" Header="工具栏">
|
||||
<ToggleButton Content="切换" />
|
||||
<Button x:Name="Test"
|
||||
Click="Test_OnClick"
|
||||
Content="测试" />
|
||||
</ToolBar>
|
||||
</ToolBarTray>
|
||||
<!-- 中间部分 -->
|
||||
<enu:Anchor Grid.Row="1" Margin="4">
|
||||
<StackPanel>
|
||||
<StackPanel>
|
||||
<GroupBox enu:AnchorAssist.AnchorName="装饰器" Header="装饰器">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<enu:SlotBorder Height="100"
|
||||
Margin="5"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Content="凹槽"
|
||||
FontSize="24"
|
||||
Foreground="{DynamicResource Gradient.Primary}"
|
||||
Radius="16" />
|
||||
<enu:EmbossBorder Grid.Column="1"
|
||||
Margin="5"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Content="浮雕"
|
||||
ContextMenu="{StaticResource ContextMenuDemo}"
|
||||
CornerRadius="16"
|
||||
FontSize="24"
|
||||
Foreground="{DynamicResource Gradient.Primary}"
|
||||
ToolTip="右键" />
|
||||
<enu:Card Grid.Column="2"
|
||||
Margin="5"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Content="卡片"
|
||||
CornerRadius="16"
|
||||
FontSize="24"
|
||||
Foreground="{DynamicResource Gradient.Primary}" />
|
||||
<enu:LightedSurface Grid.Row="1"
|
||||
Grid.ColumnSpan="3"
|
||||
Height="100"
|
||||
Margin="5"
|
||||
Background="{DynamicResource Background.Main}"
|
||||
Content="在此处移动鼠标"
|
||||
CornerRadius="16"
|
||||
FontSize="24" />
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox enu:AnchorAssist.AnchorName="按钮和标签" Header="按钮和标签">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Content="基本按钮" />
|
||||
<Button Content="主要按钮" Style="{StaticResource ButtonPrimary}" />
|
||||
|
||||
<Button Content="禁用基本按钮" IsEnabled="False" />
|
||||
<Button Content="禁用主要按钮"
|
||||
IsEnabled="False"
|
||||
Style="{StaticResource ButtonPrimary}" />
|
||||
<Separator />
|
||||
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
<GroupBox enu:AnchorAssist.AnchorName="文本框" Header="文本框">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBox VerticalAlignment="Center" Text="文本框(输入字段)" />
|
||||
<PasswordBox Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Password="12345" />
|
||||
<RichTextBox Grid.Row="2">
|
||||
<FlowDocument>
|
||||
<Paragraph>
|
||||
<Bold>Flow Document</Bold>
|
||||
in a
|
||||
<Run Foreground="{StaticResource Gradient.Primary}">富文本框.</Run>
|
||||
</Paragraph>
|
||||
</FlowDocument>
|
||||
</RichTextBox>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox enu:AnchorAssist.AnchorName="下拉框" Header="下拉框">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ComboBox Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
IsEditable="True"
|
||||
SelectedIndex="0">
|
||||
<ComboBoxItem Content="可编辑 选项" />
|
||||
<ComboBoxItem Content="选项 B" />
|
||||
<ComboBoxItem Content="选项 C" />
|
||||
</ComboBox>
|
||||
<ComboBox SelectedIndex="0">
|
||||
<ComboBoxItem Content="选项 A" />
|
||||
<ComboBoxItem Content="选项 B" />
|
||||
<ComboBoxItem Content="选项 C" />
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
<GroupBox enu:AnchorAssist.AnchorName="切换按钮" Header="切换按钮">
|
||||
<UniformGrid Rows="1">
|
||||
<ToggleButton Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Content="切换按钮"
|
||||
IsChecked="True" />
|
||||
<ToggleButton Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
IsChecked="True"
|
||||
Style="{StaticResource SwitchButton}" />
|
||||
<ToggleButton Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Content="禁用切换按钮"
|
||||
IsEnabled="False" />
|
||||
<ToggleButton Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
IsEnabled="False"
|
||||
Style="{StaticResource SwitchButton}" />
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
<GroupBox enu:AnchorAssist.AnchorName="文本标签" Header="文本标签">
|
||||
<UniformGrid Rows="1">
|
||||
<Label Content="默认标签" />
|
||||
<Label Content="主要标签" Style="{StaticResource LabelPrimary}" />
|
||||
<Label Content="禁用默认标签" IsEnabled="False" />
|
||||
<Label Content="禁用主要标签"
|
||||
IsEnabled="False"
|
||||
Style="{StaticResource LabelPrimary}" />
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox enu:AnchorAssist.AnchorName="折叠" Header="折叠">
|
||||
<Expander Header="折叠" IsExpanded="True" />
|
||||
</GroupBox>
|
||||
<GroupBox enu:AnchorAssist.AnchorName="单选复选框" Header="单选复选框">
|
||||
<UniformGrid Rows="1">
|
||||
<CheckBox Content="进度不确定" />
|
||||
<CheckBox Content="禁用进度不确定"
|
||||
IsChecked="{x:Null}"
|
||||
IsEnabled="False" />
|
||||
<RadioButton Content="单选按钮 A"
|
||||
GroupName="RadioG"
|
||||
IsChecked="{x:Null}" />
|
||||
<RadioButton Content="单选按钮 B" GroupName="RadioG" />
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
<GroupBox enu:AnchorAssist.AnchorName="滑动/滚动条" Header="滑动/滚动条">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0" Orientation="Horizontal" Height="100">
|
||||
<Slider x:Name="ProgressVerticalSlider"
|
||||
Value="25"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical" />
|
||||
<ProgressBar Grid.Column="1"
|
||||
Height="100"
|
||||
Value="{Binding ElementName=ProgressVerticalSlider, Path=Value}"
|
||||
IsIndeterminate="{Binding ElementName=ProgressCheckbox, Path=IsChecked}"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Orientation="Vertical" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="1">
|
||||
<Slider x:Name="ProgressSlider"
|
||||
Value="25"
|
||||
Maximum="100"
|
||||
Minimum="0" />
|
||||
<ProgressBar Value="{Binding ElementName=ProgressSlider, Path=Value}"
|
||||
IsIndeterminate="{Binding ElementName=ProgressCheckbox, Path=IsChecked}"
|
||||
Maximum="100"
|
||||
Minimum="0" />
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
<GroupBox Grid.Column="1"
|
||||
Margin="4"
|
||||
enu:AnchorAssist.AnchorName="日期"
|
||||
Header="日期">
|
||||
<StackPanel Margin="4,0" Orientation="Horizontal">
|
||||
<DatePicker Width="200" />
|
||||
<Calendar>
|
||||
<Calendar.BlackoutDates>
|
||||
<CalendarDateRange End="2022/7/12" Start="2022/7/10" />
|
||||
</Calendar.BlackoutDates>
|
||||
</Calendar>
|
||||
</StackPanel>
|
||||
|
||||
</GroupBox>
|
||||
<GroupBox enu:AnchorAssist.AnchorName="选择" Header="选择">
|
||||
<UniformGrid Rows="1">
|
||||
<TreeView Grid.Row="0" Margin="4">
|
||||
<TreeViewItem Header="A123" IsExpanded="True">
|
||||
<TreeViewItem Header="B123"
|
||||
IsExpanded="True"
|
||||
IsSelected="True">
|
||||
<TreeViewItem Header="C123" />
|
||||
</TreeViewItem>
|
||||
<TreeViewItem Header="B456" IsEnabled="False" />
|
||||
</TreeViewItem>
|
||||
</TreeView>
|
||||
<ListBox Margin="4">
|
||||
<ListBoxItem>SyminOmega</ListBoxItem>
|
||||
<ListBoxItem>Celeron533</ListBoxItem>
|
||||
<ListBoxItem>Hello World</ListBoxItem>
|
||||
<ListBoxItem>Furry Fantasy</ListBoxItem>
|
||||
<ListBoxItem>Item Demo</ListBoxItem>
|
||||
<ListBoxItem>Item Demo</ListBoxItem>
|
||||
</ListBox>
|
||||
<ListView Margin="4"
|
||||
DataContext="{StaticResource Dgd}"
|
||||
ItemsSource="{Binding DataCollection}">
|
||||
<ListView.View>
|
||||
<GridView>
|
||||
<GridViewColumn DisplayMemberBinding="{Binding Id}" Header="ID" />
|
||||
<GridViewColumn DisplayMemberBinding="{Binding Name}" Header="Name" />
|
||||
<GridViewColumn DisplayMemberBinding="{Binding Age}" Header="Age" />
|
||||
<GridViewColumn DisplayMemberBinding="{Binding Mark}" Header="Mark" />
|
||||
<GridViewColumn DisplayMemberBinding="{Binding Gender}" Header="Gender" />
|
||||
</GridView>
|
||||
</ListView.View>
|
||||
</ListView>
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
<GroupBox enu:AnchorAssist.AnchorName="数据展示" Header="数据展示">
|
||||
<TabControl Style="{StaticResource NavigationTabControl}">
|
||||
<TabItem Header="选项卡 1">
|
||||
<Grid Margin="4">
|
||||
<Separator Grid.Row="1" />
|
||||
<DataGrid Grid.Row="3"
|
||||
Margin="4"
|
||||
DataContext="{StaticResource Dgd}"
|
||||
ItemsSource="{Binding DataCollection}" />
|
||||
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="选项卡 2" />
|
||||
<TabItem Header="禁用选项卡" IsEnabled="False" />
|
||||
</TabControl>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
</enu:Anchor>
|
||||
|
||||
<!-- 状态栏部分 -->
|
||||
<StatusBar Grid.Row="2">
|
||||
<TextBlock Text="★" />
|
||||
<TextBlock Text="状态栏" />
|
||||
<Separator />
|
||||
<TextBlock x:Name="TextMessage" Text="消息" />
|
||||
</StatusBar>
|
||||
</Grid>
|
||||
|
||||
</Window>
|
||||
Reference in New Issue
Block a user