1352 lines
71 KiB
XML
1352 lines
71 KiB
XML
<n:NeoWindow
|
||
x:Class="NeoUITest.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:NeoUITest.DataModel"
|
||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||
xmlns:n="https://github.com/ShrlAlgo/NeoUI"
|
||
xmlns:neuwpftest="clr-namespace:NeoUITest"
|
||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||
Title="样式示例"
|
||
Width="1000"
|
||
Height="800"
|
||
d:DataContext="{d:DesignInstance Type=neuwpftest:MainWindow}"
|
||
d:Height="Auto"
|
||
d:SizeToContent="WidthAndHeight"
|
||
Icon="/Resources/Images/ImageTest.png"
|
||
Loaded="Window_Loaded"
|
||
Selector.SelectionChanged="TabControl_SelectionChanged"
|
||
WindowStartupLocation="CenterScreen"
|
||
mc:Ignorable="d">
|
||
|
||
<n:NeoWindow.TitleBarLeftContent>
|
||
<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>
|
||
</n:NeoWindow.TitleBarLeftContent>
|
||
<n:NeoWindow.TitleBarRightContent>
|
||
<UniformGrid Rows="1">
|
||
<ComboBox
|
||
x:Name="PrimaryColorSelectComboBox"
|
||
VerticalContentAlignment="Center"
|
||
SelectionChanged="PrimaryColorSelectComboBox_SelectionChanged"
|
||
Style="{StaticResource FlattenComboBox}">
|
||
<ComboBoxItem>
|
||
<Rectangle
|
||
Width="30"
|
||
Height="20"
|
||
Fill="#2C63F2"
|
||
RadiusX="4"
|
||
RadiusY="4" />
|
||
</ComboBoxItem>
|
||
<ComboBoxItem>
|
||
<Rectangle
|
||
Width="30"
|
||
Height="20"
|
||
Fill="#2E3F36"
|
||
RadiusX="4"
|
||
RadiusY="4" />
|
||
</ComboBoxItem>
|
||
<ComboBoxItem>
|
||
<Rectangle
|
||
Width="30"
|
||
Height="20"
|
||
Fill="#3C2A59"
|
||
RadiusX="4"
|
||
RadiusY="4" />
|
||
</ComboBoxItem>
|
||
</ComboBox>
|
||
<ToggleButton
|
||
Checked="ThemeToggle_OnCheckedChanged"
|
||
Style="{StaticResource NeuToggleSwitch}"
|
||
Unchecked="ThemeToggle_OnCheckedChanged">
|
||
<n:ToggleSwitchAssist.OnContent>
|
||
<n:IconElement Symbol="Sunny" />
|
||
</n:ToggleSwitchAssist.OnContent>
|
||
<n:ToggleSwitchAssist.OffContent>
|
||
<n:IconElement Symbol="Nightlight" />
|
||
</n:ToggleSwitchAssist.OffContent>
|
||
</ToggleButton>
|
||
</UniformGrid>
|
||
</n:NeoWindow.TitleBarRightContent>
|
||
<n:NeoWindow.Resources>
|
||
<ResourceDictionary>
|
||
<neuwpftest:MainViewModel x:Key="mainViewModel" />
|
||
<!-- <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>
|
||
|
||
</n:NeoWindow.Resources>
|
||
<Grid>
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="auto" />
|
||
<RowDefinition Height="*" />
|
||
<RowDefinition Height="24" />
|
||
</Grid.RowDefinitions>
|
||
<!-- 工具栏 -->
|
||
<ToolBarTray Margin="4,4,4,0">
|
||
<ToolBar Foreground="{DynamicResource PrimaryFocusedBrush}" 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 PrimaryFocusedBrush}" Header="工具栏">
|
||
<ToggleButton Content="切换" />
|
||
<Button
|
||
x:Name="Test"
|
||
Click="Test_OnClick"
|
||
Content="测试" />
|
||
<Button Click="Icon_OnClick" Content="图标" />
|
||
<Button Click="ColorPalette_OnClick" Content="配色" />
|
||
</ToolBar>
|
||
</ToolBarTray>
|
||
<!-- 中间部分 -->
|
||
<n:Anchor Grid.Row="1" Margin="4">
|
||
<n:StackPanel Spacing="5">
|
||
<GroupBox n:AnchorAssist.Header="装饰器 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
|
||
Grid.Row="0"
|
||
Grid.Column="1"
|
||
Margin="5"
|
||
HorizontalContentAlignment="Center"
|
||
VerticalContentAlignment="Center"
|
||
Content="浮雕"
|
||
ContextMenu="{StaticResource ContextMenuDemo}"
|
||
CornerRadius="16"
|
||
FontSize="24"
|
||
Foreground="{DynamicResource PrimaryGradientBrush}"
|
||
ToolTip="右键" />
|
||
<n:Card
|
||
Grid.Row="0"
|
||
Grid.Column="2"
|
||
Margin="5"
|
||
Content="卡片"
|
||
CornerRadius="16"
|
||
FontSize="24"
|
||
Foreground="{DynamicResource PrimaryGradientBrush}" />
|
||
</n:FlexibleRowPanel>
|
||
|
||
<n:LightedSurface
|
||
Grid.Row="1"
|
||
Grid.Column="0"
|
||
Grid.ColumnSpan="4"
|
||
Height="100"
|
||
Margin="5"
|
||
Content="在此处移动鼠标"
|
||
CornerRadius="16"
|
||
FontSize="24"
|
||
Foreground="{DynamicResource PrimaryGradientBrush}" />
|
||
</StackPanel>
|
||
</GroupBox>
|
||
<StackPanel n:AnchorAssist.Header="警告提示 Alert">
|
||
<StackPanel>
|
||
<CheckBox x:Name="IsBanner" Content="标题" />
|
||
<n:Alert
|
||
Margin="5"
|
||
Banner="{Binding ElementName=IsBanner, Path=IsChecked}"
|
||
Description="这是一个信息提示框。"
|
||
Message="信息" />
|
||
<n:Alert
|
||
Margin="5"
|
||
Banner="{Binding ElementName=IsBanner, Path=IsChecked}"
|
||
Description="这是一个成功提示框。"
|
||
Message="成功"
|
||
Type="Success" />
|
||
<n:Alert
|
||
Margin="5"
|
||
Banner="{Binding ElementName=IsBanner, Path=IsChecked}"
|
||
Description="这是一个警告提示框。"
|
||
Message="警告"
|
||
Type="Warning" />
|
||
<n:Alert
|
||
Margin="5"
|
||
Banner="{Binding ElementName=IsBanner, Path=IsChecked}"
|
||
Description="这是一个错误提示框。"
|
||
Message="错误"
|
||
Type="Error" />
|
||
</StackPanel>
|
||
</StackPanel>
|
||
<StackPanel n:AnchorAssist.Header="通知 Toast">
|
||
<StackPanel>
|
||
<StackPanel Orientation="Horizontal">
|
||
<Button Click="LeftTopButton_Click" Content="Notification左上" />
|
||
<Button Click="RightTopButton_Click" Content="Notification右上" />
|
||
<Button Click="LeftBottomButton_Click" Content="Notification左下" />
|
||
<Button Click="RightBottomButton_Click" Content="Notification右下" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal">
|
||
<Button Click="Info_Click" Content="ToastInfo" />
|
||
<Button Click="Success_Click" Content="ToastSuccess" />
|
||
<Button Click="Warning_Click" Content="ToastWarning" />
|
||
<Button Click="Error_Click" Content="ToastError" />
|
||
</StackPanel>
|
||
<StackPanel Orientation="Horizontal">
|
||
<Button Click="ShowBasicModal_Click" Content="BasicModal" />
|
||
<Button Click="ShowAsyncModal_Click" Content="AsyncModal" />
|
||
</StackPanel>
|
||
</StackPanel>
|
||
</StackPanel>
|
||
|
||
<n:FlexibleRowPanel n:AnchorAssist.Header="文字 Text">
|
||
<n:CodeBox Title="代码块">
|
||
<n:CodeBox.Description>代码块基本使用</n:CodeBox.Description>
|
||
<n:CodeBox.Content>
|
||
<n:FlexibleRowPanel LayoutMode="Auto">
|
||
<n:Heading Size="ExtraLarge" Text="ExtraLarge" />
|
||
<n:Heading Size="Large" Text="Large" />
|
||
<n:Heading Size="Medium" Text="Medium" />
|
||
<n:Heading Size="Normal" Text="Normal" />
|
||
<n:Heading Size="Small" Text="Small" />
|
||
<n:Heading Size="Tiny" Text="Tiny" />
|
||
</n:FlexibleRowPanel>
|
||
</n:CodeBox.Content>
|
||
<n:CodeBox.Code>
|
||
<ResourceDictionary Source="pack://application:,,,/Antd;component/Styles/Theme.xaml" />\n
|
||
<ResourceDictionary Source="pack://application:,,,/Antd;component/Styles/AntIcons.xaml" />\n\n
|
||
xmlns:Antd="clr-namespace:Antd.Controls;assembly=antd"\n\n
|
||
<WrapPanel>\n
|
||
\t<Antd:Tag>Tag 1</Antd:Tag>\n
|
||
\t<Antd:Tag>Link</Antd:Tag>\n
|
||
\t<Antd:Tag Closable="True">Tag 2</Antd:Tag>\n
|
||
\t<Antd:Tag Closable="True" cal:Message.Attach="[Event Closing] = [Action Closing($source, $eventArgs)]">Prevent Default</Antd:Tag>\n
|
||
</WrapPanel>
|
||
</n:CodeBox.Code>
|
||
</n:CodeBox>
|
||
|
||
</n:FlexibleRowPanel>
|
||
<StackPanel n:AnchorAssist.Header="分隔条 Divider">
|
||
<Viewbox Height="20">
|
||
<UniformGrid Rows="1">
|
||
<Path Data="{StaticResource poweroff}" Fill="{DynamicResource TextPrimaryBrush}" />
|
||
<Path Data="{StaticResource user}" Fill="{DynamicResource TextPrimaryBrush}" />
|
||
<Path Data="{StaticResource close}" Fill="{DynamicResource TextPrimaryBrush}" />
|
||
<Path Data="{StaticResource lock}" Fill="{DynamicResource TextPrimaryBrush}" />
|
||
<Path Data="{StaticResource down}" Fill="{DynamicResource TextPrimaryBrush}" />
|
||
<Path Data="{StaticResource search}" Fill="{DynamicResource TextPrimaryBrush}" />
|
||
</UniformGrid>
|
||
</Viewbox>
|
||
<n:Divider Margin="0,16" Content="Text" />
|
||
<n:Divider
|
||
Margin="0,16"
|
||
Content="Left Text"
|
||
TextOrientation="Left" />
|
||
<n:Divider
|
||
Margin="0,16"
|
||
Content="Right Text"
|
||
TextOrientation="Right" />
|
||
<n:FlexibleRowPanel>
|
||
<n:Divider
|
||
Height="20"
|
||
Content="Text"
|
||
Orientation="Vertical" />
|
||
<Separator Height="20" Style="{StaticResource VerticalSeparator}" />
|
||
</n:FlexibleRowPanel>
|
||
</StackPanel>
|
||
<StackPanel n:AnchorAssist.Header="图标、文本、标签">
|
||
<StackPanel>
|
||
<n:FlexibleRowPanel>
|
||
<TextBlock
|
||
Margin="5"
|
||
HorizontalAlignment="Center"
|
||
VerticalAlignment="Center"
|
||
Text="文本块" />
|
||
<TextBlock
|
||
Margin="5"
|
||
HorizontalAlignment="Center"
|
||
VerticalAlignment="Center"
|
||
FontFamily="{StaticResource MaterialIconFont}"
|
||
Text="{n:SymbolIcon Symbol=AddBox}" />
|
||
<n:IconElement
|
||
Margin="5"
|
||
HorizontalAlignment="Center"
|
||
VerticalAlignment="Center"
|
||
FontSize="14"
|
||
FontWeight="Regular"
|
||
Foreground="{DynamicResource PrimaryNormalBrush}"
|
||
Symbol="Save" />
|
||
<n:Pill
|
||
Margin="10"
|
||
Content="必应"
|
||
Url="www.bing.com">
|
||
<n:Pill.Header>
|
||
<n:IconElement Symbol="Search" />
|
||
</n:Pill.Header>
|
||
</n:Pill>
|
||
|
||
<n:Pill
|
||
Margin="10"
|
||
HorizontalAlignment="Left"
|
||
Content="C盘"
|
||
HeadBackground="{DynamicResource PrimaryGradientBrush}"
|
||
Url="C:\">
|
||
<n:Pill.Header>
|
||
<n:IconElement Symbol="HardDisk" />
|
||
</n:Pill.Header>
|
||
</n:Pill>
|
||
<n:Pill
|
||
Margin="10"
|
||
Content="C盘"
|
||
HeadBackground="{DynamicResource PrimaryGradientBrush}"
|
||
Header="标题"
|
||
Url="C:\" />
|
||
</n:FlexibleRowPanel>
|
||
<n:FlexibleRowPanel>
|
||
<n:Tag Margin="10" Content="默认标签" />
|
||
<n:Tag
|
||
Margin="10"
|
||
Closable="True"
|
||
Content="可关闭标签" />
|
||
<n:Tag
|
||
Margin="10"
|
||
Closable="True"
|
||
Content="颜色标签"
|
||
Foreground="{DynamicResource PrimaryNormalBrush}" />
|
||
<n:Tag
|
||
Margin="10"
|
||
Closable="True"
|
||
Content="多彩的" />
|
||
<n:Tag
|
||
Margin="10"
|
||
Background="{DynamicResource PrimaryNormalBrush}"
|
||
Closable="True"
|
||
Content="白色前景色"
|
||
Foreground="White" />
|
||
<n:CheckableTag
|
||
Margin="10"
|
||
Content="可切换标签"
|
||
IsChecked="True" />
|
||
</n:FlexibleRowPanel>
|
||
<n:FlexibleRowPanel>
|
||
<n:Avatar>
|
||
<n:IconElement Foreground="{DynamicResource PrimaryGradientBrush}" Symbol="AccountCircle" />
|
||
</n:Avatar>
|
||
<n:Avatar Foreground="{DynamicResource PrimaryNormalBrush}">
|
||
<TextBlock Margin="5" Text="Head" />
|
||
</n:Avatar>
|
||
<n:Badge Status="Success" />
|
||
<n:Badge Count="10">
|
||
<Button Content="徽章" />
|
||
</n:Badge>
|
||
|
||
<n:Badge Count="100" OverflowCount="99">
|
||
<Button Content="徽章" />
|
||
</n:Badge>
|
||
|
||
<n:Badge Status="Warning">
|
||
<Button Content="徽章" />
|
||
</n:Badge>
|
||
</n:FlexibleRowPanel>
|
||
</StackPanel>
|
||
</StackPanel>
|
||
<StackPanel n:AnchorAssist.Header="普通按钮 Button">
|
||
<StackPanel>
|
||
<UniformGrid Columns="7" Rows="2">
|
||
<Button Content="基本" />
|
||
<Button Content="禁用按钮" IsEnabled="False" />
|
||
|
||
<Button Content="拟态" Style="{StaticResource NeuButtonStyle}" />
|
||
<Button
|
||
Content="禁用拟态"
|
||
IsEnabled="False"
|
||
Style="{StaticResource NeuButtonStyle}" />
|
||
|
||
<Button
|
||
n:ButtonAssist.AppearanceType="Primary"
|
||
Content="主要"
|
||
ToolTip="Primary"
|
||
ToolTipService.Placement="Top" />
|
||
<Button
|
||
n:ButtonAssist.AppearanceType="Primary"
|
||
Content="禁用主要"
|
||
IsEnabled="False" />
|
||
<Button
|
||
n:ButtonAssist.AppearanceType="Info"
|
||
Content="信息"
|
||
ToolTip="Info"
|
||
ToolTipService.Placement="Top" />
|
||
<Button
|
||
n:ButtonAssist.AppearanceType="Info"
|
||
Content="禁用信息"
|
||
IsEnabled="False" />
|
||
<Button
|
||
n:ButtonAssist.AppearanceType="Success"
|
||
Content="成功"
|
||
ToolTip="Succeed"
|
||
ToolTipService.InitialShowDelay="100"
|
||
ToolTipService.Placement="Bottom" />
|
||
<Button
|
||
n:ButtonAssist.AppearanceType="Success"
|
||
Content="禁用成功"
|
||
IsEnabled="False" />
|
||
|
||
<Button n:ButtonAssist.AppearanceType="Warning" Content="警告" />
|
||
<Button
|
||
n:ButtonAssist.AppearanceType="Warning"
|
||
Content="禁用警告"
|
||
IsEnabled="False" />
|
||
|
||
<Button n:ButtonAssist.AppearanceType="Error" Content="危险" />
|
||
<Button
|
||
n:ButtonAssist.AppearanceType="Error"
|
||
Content="禁用危险"
|
||
IsEnabled="False" />
|
||
</UniformGrid>
|
||
<UniformGrid Rows="1">
|
||
<Button IsEnabled="False">
|
||
<StackPanel Orientation="Horizontal">
|
||
<n:IconElement Margin="5,0" Symbol="Box" />
|
||
<TextBlock Text="图标" />
|
||
</StackPanel>
|
||
</Button>
|
||
<Button
|
||
Margin="4"
|
||
Content="扁平按钮"
|
||
Style="{StaticResource FlattenButton}" />
|
||
<Button
|
||
Margin="4"
|
||
Content="禁用按钮"
|
||
IsEnabled="False"
|
||
Style="{StaticResource FlattenButton}" />
|
||
<n:Hyperlink Margin="4" Content="超链接" />
|
||
</UniformGrid>
|
||
<UniformGrid Rows="1">
|
||
<Button n:ButtonAssist.IsRunning="True" Content="运行中..." />
|
||
<Button n:ButtonAssist.Icon="{n:Icon SymbolValue=MagicButton}" Content="图标" />
|
||
<RepeatButton Content="RepeatButton" />
|
||
<RepeatButton Content="RepeatButton" IsEnabled="False" />
|
||
</UniformGrid>
|
||
</StackPanel>
|
||
</StackPanel>
|
||
|
||
<StackPanel n:AnchorAssist.Header="输入框 Input">
|
||
<n:FlexibleRowPanel>
|
||
<TextBox
|
||
VerticalAlignment="Top"
|
||
n:InputAssist.Clearable="True"
|
||
Text="Regions" />
|
||
<TextBox
|
||
VerticalAlignment="Center"
|
||
IsEnabled="False"
|
||
Text="禁用" />
|
||
<TextBox
|
||
VerticalAlignment="Center"
|
||
IsReadOnly="True"
|
||
Text="只读" />
|
||
<TextBox
|
||
n:InputAssist.Clearable="True"
|
||
n:InputAssist.Placeholder="水印"
|
||
n:InputAssist.Prefix="Text"
|
||
n:InputAssist.Suffix="mm"
|
||
Text="123" />
|
||
</n:FlexibleRowPanel>
|
||
<n:FlexibleRowPanel>
|
||
<TextBox n:InputAssist.Placeholder="水印" n:InputAssist.Prefix="Prefix">
|
||
<n:InputAssist.Suffix>
|
||
<Button
|
||
VerticalContentAlignment="Stretch"
|
||
n:ControlAssist.CornerRadius="0 4 4 0"
|
||
Content="Search"
|
||
Style="{StaticResource FlattenButton}" />
|
||
</n:InputAssist.Suffix>
|
||
</TextBox>
|
||
<TextBox n:InputAssist.Placeholder="请输入用户名">
|
||
<n:InputAssist.Prefix>
|
||
<n:IconElement Foreground="#3F000000" Symbol="VerifiedUser" />
|
||
</n:InputAssist.Prefix>
|
||
<n:InputAssist.Suffix>
|
||
<n:IconElement Foreground="#3F000000" Symbol="Close" />
|
||
</n:InputAssist.Suffix>
|
||
</TextBox>
|
||
<TextBox
|
||
VerticalAlignment="Center"
|
||
IsEnabled="False"
|
||
Text="禁用" />
|
||
<TextBox
|
||
VerticalAlignment="Center"
|
||
IsReadOnly="True"
|
||
Text="只读" />
|
||
</n:FlexibleRowPanel>
|
||
<n:FlexibleRowPanel>
|
||
<PasswordBox Password="666" />
|
||
<PasswordBox IsEnabled="False" Password="666" />
|
||
<PasswordBox
|
||
n:InputAssist.Clearable="True"
|
||
n:InputAssist.Eyeable="True"
|
||
n:InputAssist.Password="{Binding Password}"
|
||
n:InputAssist.Placeholder="请输入密码" />
|
||
<PasswordBox
|
||
n:InputAssist.Clearable="True"
|
||
n:InputAssist.Eyeable="True"
|
||
IsEnabled="False"
|
||
Password="12345" />
|
||
</n:FlexibleRowPanel>
|
||
<n:FlexibleRowPanel>
|
||
<n:NumberBox
|
||
MaxValue="100"
|
||
MinValue="-100"
|
||
Precision="3"
|
||
Step="0.05"
|
||
Value="10" />
|
||
<n:NumberBox
|
||
IsEnabled="False"
|
||
MaxValue="100"
|
||
MinValue="0"
|
||
Precision="3"
|
||
Step="0.05"
|
||
Value="10" />
|
||
<n:NumericBox CurValue="100" Style="{StaticResource DefaultTextBox}" />
|
||
|
||
</n:FlexibleRowPanel>
|
||
<RichTextBox Grid.Row="2">
|
||
<FlowDocument>
|
||
<Paragraph>
|
||
<Bold>Flow Document</Bold>
|
||
in a<Run Foreground="{StaticResource PrimaryGradientBrush}">富文本框.</Run>
|
||
</Paragraph>
|
||
</FlowDocument>
|
||
</RichTextBox>
|
||
</StackPanel>
|
||
<StackPanel n:AnchorAssist.Header="文件、文件夹 Browser">
|
||
<n:FlexibleRowPanel>
|
||
<n:ChooseBox Placeholder="请选择路径" />
|
||
<n:ChooseBox IsEnabled="False" Text="选择路径" />
|
||
</n:FlexibleRowPanel>
|
||
<n:FlexibleRowPanel>
|
||
<n:UploadArea
|
||
Accept="Image Files|*.jpg;*.jpeg;*.png;*.gif|All Files|*.*"
|
||
HintText="点击选择单个图片"
|
||
Mode="FilesOnly" />
|
||
<n:UploadArea HintText="点击选择一个项目文件夹" Mode="FoldersOnly" />
|
||
<n:UploadArea
|
||
Accept="Document Files|*.doc;*.docx;*.pdf|All Files|*.*"
|
||
HintText="点击或拖拽多个文档到此"
|
||
Mode="FilesOnly"
|
||
Multiple="True" />
|
||
<n:UploadArea
|
||
HintText="点击或拖拽多个文件夹到此"
|
||
Mode="FoldersOnly"
|
||
Multiple="True" />
|
||
</n:FlexibleRowPanel>
|
||
</StackPanel>
|
||
<StackPanel n:AnchorAssist.Header="下拉框 ComboBox">
|
||
<n:FlexibleRowPanel Spacing="5">
|
||
<ComboBox IsEditable="True">
|
||
<ComboBoxItem Content="可编辑 选项" />
|
||
<ComboBoxItem Content="选项 B" />
|
||
<ComboBoxItem Content="选项 C" />
|
||
</ComboBox>
|
||
<ComboBox
|
||
IsEditable="True"
|
||
IsEnabled="False"
|
||
SelectedIndex="0">
|
||
<ComboBoxItem Content="可编辑 选项" />
|
||
<ComboBoxItem Content="选项 B" />
|
||
<ComboBoxItem Content="选项 C" />
|
||
</ComboBox>
|
||
<ComboBox>
|
||
<ComboBoxItem Content="选项 A" />
|
||
<ComboBoxItem Content="选项 B" />
|
||
<ComboBoxItem Content="选项 C" />
|
||
</ComboBox>
|
||
<ComboBox IsEnabled="False" SelectedIndex="0">
|
||
<ComboBoxItem Content="选项 A" />
|
||
<ComboBoxItem Content="选项 B" />
|
||
<ComboBoxItem Content="选项 C" />
|
||
</ComboBox>
|
||
</n:FlexibleRowPanel>
|
||
<n:FlexibleRowPanel n:AnchorAssist.Header="级联选择 Cascader">
|
||
<n:Cascader
|
||
DisplayMemberPath="Name"
|
||
ItemsSource="{Binding StaffList, Mode=TwoWay}"
|
||
SelectedValue="{Binding SelectedItem, Mode=TwoWay}"
|
||
SubmenuMemberPath="Children" />
|
||
<n:Cascader
|
||
DisplayMemberPath="Name"
|
||
IsSearchable="False"
|
||
ItemsSource="{Binding StaffList, Mode=TwoWay}"
|
||
SelectedValue="{Binding SelectedItem, Mode=TwoWay}"
|
||
SubmenuMemberPath="Children" />
|
||
<StackPanel VerticalAlignment="Center" Orientation="Horizontal">
|
||
<TextBlock
|
||
Margin="3,0"
|
||
FontWeight="Bold"
|
||
Text="详情:" />
|
||
<StackPanel Orientation="Horizontal">
|
||
<TextBlock Margin="3,0" Text="姓名: " />
|
||
<TextBlock Margin="3,0" Text="{Binding SelectedItem.Name, FallbackValue='N/A'}" />
|
||
</StackPanel>
|
||
<StackPanel Margin="3,0" Orientation="Horizontal">
|
||
<TextBlock Margin="3,0" Text="年龄: " />
|
||
<TextBlock Margin="3,0" Text="{Binding SelectedItem.Age, FallbackValue='N/A'}" />
|
||
</StackPanel>
|
||
</StackPanel>
|
||
</n:FlexibleRowPanel>
|
||
<n:FlexibleRowPanel>
|
||
<n:AutoComplete
|
||
n:InputAssist.Placeholder="请输入地区.."
|
||
ItemsSource="{Binding Areas}"
|
||
SelectedItem="{Binding Area, Mode=TwoWay}"
|
||
Text="{Binding Input, Mode=TwoWay}" />
|
||
<n:AutoComplete
|
||
n:InputAssist.Clearable="False"
|
||
ItemsSource="{Binding Areas}"
|
||
SelectedItem="{Binding Area, Mode=TwoWay}"
|
||
Text="{Binding Input, Mode=TwoWay}" />
|
||
<n:AutoComplete
|
||
IsEnabled="False"
|
||
ItemsSource="{Binding Areas}"
|
||
SelectedItem="{Binding Area, Mode=TwoWay}"
|
||
Text="{Binding Area.Name, Mode=TwoWay}" />
|
||
</n:FlexibleRowPanel>
|
||
<n:FlexibleRowPanel Spacing="5">
|
||
<n:NeuComboBox
|
||
x:Name="Regions"
|
||
DisplayMemberPath="Name"
|
||
ItemsSource="{Binding Areas}"
|
||
PlaceHolder="请选择区域..."
|
||
SelectedItem="{Binding Area}"
|
||
SelectionMode="Single" />
|
||
<n:NeuComboBox
|
||
DisplayMemberPath="Name"
|
||
IsFilteringEnabled="False"
|
||
ItemsSource="{Binding Areas}"
|
||
PlaceHolder="请选择区域..."
|
||
SelectedItem="{Binding Area}"
|
||
SelectionMode="Single" />
|
||
<n:NeuComboBox
|
||
DisplayMemberPath="Name"
|
||
ItemsSource="{Binding Areas}"
|
||
PlaceHolder="请选择区域..."
|
||
SelectedItems="{Binding SelectedListAreas}"
|
||
SelectionMode="Multiple" />
|
||
<n:NeuComboBox
|
||
IsFilteringEnabled="False"
|
||
ItemsSource="{Binding Areas}"
|
||
PlaceHolder="请选择区域..."
|
||
SelectedItems="{Binding SelectedObservableAreas}"
|
||
SelectionMode="Multiple" />
|
||
<Button Command="{Binding AddAreaCommand}" Content="测试" />
|
||
</n:FlexibleRowPanel>
|
||
</StackPanel>
|
||
<StackPanel n:AnchorAssist.Header="切换按钮 ToggleButton">
|
||
<n:FlexibleRowPanel>
|
||
<ToggleButton Content="切换按钮" IsChecked="False" />
|
||
<ToggleButton Content="切换按钮" IsChecked="True" />
|
||
<ToggleButton
|
||
Content="禁用切换按钮"
|
||
IsChecked="False"
|
||
IsEnabled="False" />
|
||
<ToggleButton
|
||
Content="禁用切换按钮"
|
||
IsChecked="True"
|
||
IsEnabled="False" />
|
||
</n:FlexibleRowPanel>
|
||
<n:FlexibleRowPanel>
|
||
<ToggleButton
|
||
Width="100"
|
||
IsChecked="False"
|
||
Style="{StaticResource ToggleSwitch}" />
|
||
<ToggleButton
|
||
IsChecked="False"
|
||
IsEnabled="False"
|
||
Style="{StaticResource ToggleSwitch}" />
|
||
<ToggleButton IsChecked="True" Style="{StaticResource ToggleSwitch}" />
|
||
|
||
<ToggleButton
|
||
IsChecked="True"
|
||
IsEnabled="False"
|
||
Style="{StaticResource ToggleSwitch}" />
|
||
|
||
</n:FlexibleRowPanel>
|
||
<n:FlexibleRowPanel>
|
||
<ToggleButton
|
||
n:ToggleSwitchAssist.ShowText="True"
|
||
IsChecked="True"
|
||
Style="{StaticResource NeuToggleSwitch}">
|
||
<n:ToggleSwitchAssist.OnContent>
|
||
<n:IconElement Symbol="ToggleOn" />
|
||
</n:ToggleSwitchAssist.OnContent>
|
||
<n:ToggleSwitchAssist.OffContent>
|
||
<n:IconElement Symbol="ToggleOff" />
|
||
</n:ToggleSwitchAssist.OffContent>
|
||
</ToggleButton>
|
||
<ToggleButton
|
||
IsChecked="True"
|
||
IsEnabled="False"
|
||
Style="{StaticResource NeuToggleSwitch}">
|
||
<n:ToggleSwitchAssist.OnContent>
|
||
<n:IconElement Symbol="ToggleOn" />
|
||
</n:ToggleSwitchAssist.OnContent>
|
||
<n:ToggleSwitchAssist.OffContent>
|
||
<n:IconElement Symbol="ToggleOff" />
|
||
</n:ToggleSwitchAssist.OffContent>
|
||
</ToggleButton>
|
||
<ToggleButton
|
||
n:ToggleSwitchAssist.ShowText="False"
|
||
IsChecked="False"
|
||
Style="{StaticResource NeuToggleSwitch}" />
|
||
<ToggleButton
|
||
IsChecked="False"
|
||
IsEnabled="False"
|
||
Style="{StaticResource NeuToggleSwitch}" />
|
||
</n:FlexibleRowPanel>
|
||
</StackPanel>
|
||
<StackPanel n:AnchorAssist.Header="文本标签 Label">
|
||
<UniformGrid Rows="1">
|
||
<Label Content="默认标签" />
|
||
<Label Content="主要标签" Style="{StaticResource LabelPrimary}" />
|
||
<Label Content="禁用默认标签" IsEnabled="False" />
|
||
<Label
|
||
Content="禁用主要标签"
|
||
IsEnabled="False"
|
||
Style="{StaticResource LabelPrimary}" />
|
||
|
||
</UniformGrid>
|
||
</StackPanel>
|
||
<StackPanel n:AnchorAssist.Header="折叠 Expander">
|
||
<Expander Header="折叠" IsExpanded="True">
|
||
<!-- <Grid Height="40" >
|
||
<neu:RunningLine>
|
||
<neu:RunningLine.LineTemplate>
|
||
<DataTemplate>
|
||
<TextBlock Text="这是一个折叠内容的示例。" />
|
||
</DataTemplate>
|
||
</neu:RunningLine.LineTemplate>
|
||
</neu:RunningLine>
|
||
</Grid>-->
|
||
</Expander>
|
||
</StackPanel>
|
||
<StackPanel n:AnchorAssist.Header="复选框 CheckBox">
|
||
<UniformGrid Rows="1">
|
||
<CheckBox Content="复选框" />
|
||
<CheckBox Content="复选框" IsEnabled="False" />
|
||
<CheckBox Content="复选框" IsChecked="{x:Null}" />
|
||
<CheckBox
|
||
Content="复选框"
|
||
IsChecked="{x:Null}"
|
||
IsEnabled="False" />
|
||
<CheckBox Content="复选框" IsChecked="True" />
|
||
<CheckBox
|
||
Content="复选框"
|
||
IsChecked="True"
|
||
IsEnabled="False" />
|
||
</UniformGrid>
|
||
<UniformGrid Rows="1">
|
||
<CheckBox Content="复选框" Style="{StaticResource SlotCheckBox}" />
|
||
<CheckBox
|
||
Content="复选框"
|
||
IsEnabled="False"
|
||
Style="{StaticResource SlotCheckBox}" />
|
||
<CheckBox
|
||
Content="复选框"
|
||
IsChecked="True"
|
||
Style="{StaticResource SlotCheckBox}" />
|
||
<CheckBox
|
||
Content="复选框"
|
||
IsChecked="True"
|
||
IsEnabled="False"
|
||
Style="{StaticResource SlotCheckBox}" />
|
||
</UniformGrid>
|
||
</StackPanel>
|
||
<UniformGrid Rows="1">
|
||
<CheckBox Content="复选框" Style="{StaticResource EmbossCheckBox}" />
|
||
<CheckBox
|
||
Content="复选框"
|
||
IsEnabled="False"
|
||
Style="{StaticResource EmbossCheckBox}" />
|
||
<CheckBox
|
||
Content="复选框"
|
||
IsChecked="True"
|
||
Style="{StaticResource EmbossCheckBox}" />
|
||
<CheckBox
|
||
Content="复选框"
|
||
IsChecked="True"
|
||
IsEnabled="False"
|
||
Style="{StaticResource EmbossCheckBox}" />
|
||
</UniformGrid>
|
||
<StackPanel n:AnchorAssist.Header="单选框 RadioButton">
|
||
<n:FlexibleRowPanel>
|
||
<RadioButton
|
||
Content="单选按钮 A"
|
||
GroupName="RadioG1"
|
||
IsChecked="True" />
|
||
<RadioButton
|
||
Content="禁用单选按钮 A"
|
||
GroupName="RadioG2"
|
||
IsChecked="True"
|
||
IsEnabled="False" />
|
||
<RadioButton
|
||
Content="单选按钮 B"
|
||
GroupName="RadioG1"
|
||
IsChecked="{x:Null}" />
|
||
<RadioButton
|
||
Content="禁用单选按钮 B"
|
||
GroupName="RadioG2"
|
||
IsChecked="{x:Null}"
|
||
IsEnabled="False" />
|
||
<RadioButton Content="单选按钮 C" GroupName="RadioG1" />
|
||
<RadioButton
|
||
Content="禁用单选按钮 C"
|
||
GroupName="RadioG2"
|
||
IsEnabled="False" />
|
||
</n:FlexibleRowPanel>
|
||
<n:FlexibleRowPanel>
|
||
<RadioButton
|
||
Content="单选按钮 A"
|
||
GroupName="RadioG1"
|
||
IsChecked="True"
|
||
Style="{StaticResource EmbossRadioButton}" />
|
||
<RadioButton
|
||
Content="禁用单选按钮 A"
|
||
GroupName="RadioG2"
|
||
IsChecked="True"
|
||
IsEnabled="False"
|
||
Style="{StaticResource EmbossRadioButton}" />
|
||
<RadioButton
|
||
Content="单选按钮 C"
|
||
GroupName="RadioG1"
|
||
Style="{StaticResource EmbossRadioButton}" />
|
||
<RadioButton
|
||
Content="禁用单选按钮 C"
|
||
GroupName="RadioG2"
|
||
IsEnabled="False"
|
||
Style="{StaticResource EmbossRadioButton}" />
|
||
</n:FlexibleRowPanel>
|
||
</StackPanel>
|
||
<StackPanel n:AnchorAssist.Header="滑动/滚动条 Slider">
|
||
<Grid>
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="Auto" />
|
||
<ColumnDefinition Width="*" />
|
||
</Grid.ColumnDefinitions>
|
||
<StackPanel>
|
||
<CheckBox x:Name="IsSpining" Content="加载中" />
|
||
<StackPanel Height="100" Orientation="Horizontal">
|
||
<Slider
|
||
x:Name="ProgressVerticalSlider"
|
||
Maximum="100"
|
||
Minimum="0"
|
||
Orientation="Vertical"
|
||
Value="25" />
|
||
<Slider
|
||
x:Name="ProgressVerticalSlider1"
|
||
IsEnabled="False"
|
||
Maximum="100"
|
||
Minimum="0"
|
||
Orientation="Vertical"
|
||
Value="25" />
|
||
<ProgressBar
|
||
Height="100"
|
||
IsIndeterminate="{Binding ElementName=ProgressCheckbox, Path=IsChecked}"
|
||
Maximum="100"
|
||
Minimum="0"
|
||
Orientation="Vertical"
|
||
Value="{Binding ElementName=ProgressVerticalSlider, Path=Value}" />
|
||
<ProgressBar
|
||
Height="100"
|
||
IsEnabled="False"
|
||
IsIndeterminate="{Binding ElementName=ProgressCheckbox, Path=IsChecked}"
|
||
Maximum="100"
|
||
Minimum="0"
|
||
Orientation="Vertical"
|
||
Value="{Binding ElementName=ProgressVerticalSlider, Path=Value}" />
|
||
<ProgressBar
|
||
Height="100"
|
||
IsEnabled="False"
|
||
IsIndeterminate="True"
|
||
Maximum="100"
|
||
Minimum="0"
|
||
Orientation="Vertical"
|
||
Value="100" />
|
||
</StackPanel>
|
||
</StackPanel>
|
||
|
||
<Grid Grid.Column="1" Panel.ZIndex="10">
|
||
<n:Spin Spinning="{Binding ElementName=IsSpining, Path=IsChecked}" Tip="加载中...">
|
||
<StackPanel x:Name="SpinPanel">
|
||
<CheckBox x:Name="ProgressCheckbox" Content="进度待定" />
|
||
<Slider
|
||
x:Name="ProgressSlider"
|
||
Maximum="100"
|
||
Minimum="0"
|
||
Value="25" />
|
||
<Slider
|
||
x:Name="ProgressSlider1"
|
||
IsEnabled="False"
|
||
Maximum="100"
|
||
Minimum="0"
|
||
Value="25" />
|
||
<ProgressBar
|
||
IsIndeterminate="{Binding ElementName=ProgressCheckbox, Path=IsChecked}"
|
||
Maximum="100"
|
||
Minimum="0"
|
||
Value="{Binding ElementName=ProgressSlider, Path=Value}" />
|
||
<ProgressBar
|
||
IsEnabled="False"
|
||
IsIndeterminate="{Binding ElementName=ProgressCheckbox, Path=IsChecked}"
|
||
Maximum="100"
|
||
Minimum="0"
|
||
Value="{Binding ElementName=ProgressSlider, Path=Value}" />
|
||
</StackPanel>
|
||
</n:Spin>
|
||
<n:Spin
|
||
HorizontalAlignment="Left"
|
||
Spinning="{Binding ElementName=IsSpining, Path=IsChecked}"
|
||
Tip="加载中...">
|
||
<n:Spin.Indicator>
|
||
<n:IconElement Symbol="Downloading" />
|
||
</n:Spin.Indicator>
|
||
</n:Spin>
|
||
</Grid>
|
||
</Grid>
|
||
</StackPanel>
|
||
<n:FlexibleRowPanel n:AnchorAssist.Header="时间日期 DataPicker" LayoutMode="Auto">
|
||
<StackPanel>
|
||
<DatePicker />
|
||
<DatePicker IsEnabled="False" />
|
||
</StackPanel>
|
||
<Calendar>
|
||
<Calendar.BlackoutDates>
|
||
<CalendarDateRange End="2022/7/12" Start="2022/7/10" />
|
||
</Calendar.BlackoutDates>
|
||
</Calendar>
|
||
<Calendar IsEnabled="False">
|
||
<Calendar.BlackoutDates>
|
||
<CalendarDateRange End="2025/7/12" Start="2025/7/10" />
|
||
</Calendar.BlackoutDates>
|
||
</Calendar>
|
||
<n:TimePicker />
|
||
</n:FlexibleRowPanel>
|
||
<n:FlexibleRowPanel n:AnchorAssist.Header="颜色拾取 ColorPicker">
|
||
<!--<neu:ColorPickerControl />-->
|
||
<n:ColorPanel />
|
||
<n:ColorPicker Margin="10" SelectedColor="Black" />
|
||
</n:FlexibleRowPanel>
|
||
<n:FlexibleRowPanel n:AnchorAssist.Header="树形结构 TreeView">
|
||
<TreeView 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>
|
||
<n:MultiTreeView>
|
||
<n:MultiTreeViewItem Header="Item1">
|
||
<n:MultiTreeViewItem Header="Item1">
|
||
<n:MultiTreeViewItem Header="Item1" />
|
||
|
||
<n:MultiTreeViewItem Header="Item1" />
|
||
</n:MultiTreeViewItem>
|
||
<n:MultiTreeViewItem Header="Item1" />
|
||
</n:MultiTreeViewItem>
|
||
<n:MultiTreeViewItem Header="Item1" />
|
||
<n:MultiTreeViewItem Header="Item1" />
|
||
</n:MultiTreeView>
|
||
<n:MultiTreeView ItemsSource="{Binding Nodes}" SelectedItems="{Binding SelectedNodes}">
|
||
<n:MultiTreeView.ItemTemplate>
|
||
<HierarchicalDataTemplate ItemsSource="{Binding Children}">
|
||
<TextBlock Text="{Binding Name}" />
|
||
</HierarchicalDataTemplate>
|
||
</n:MultiTreeView.ItemTemplate>
|
||
</n:MultiTreeView>
|
||
</n:FlexibleRowPanel>
|
||
|
||
<StackPanel n:AnchorAssist.Header="列表框 ListBox">
|
||
<n:FlexibleRowPanel>
|
||
<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>
|
||
|
||
</n:FlexibleRowPanel>
|
||
<n:FlexibleRowPanel LayoutMode="Auto" Spacing="100">
|
||
<UniformGrid Columns="1">
|
||
<ListBox
|
||
HorizontalAlignment="Center"
|
||
VerticalAlignment="Center"
|
||
SelectedIndex="1"
|
||
Style="{StaticResource TabGroupListBoxStyle}">
|
||
<ListBoxItem Content="Home" />
|
||
<ListBoxItem Content="Away" />
|
||
<ListBoxItem Content="Night" />
|
||
</ListBox>
|
||
<ListBox
|
||
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"
|
||
Style="{StaticResource TabGroupListBoxStyle}">
|
||
<ListBoxItem Content="Home" />
|
||
<ListBoxItem Content="Away" />
|
||
<ListBoxItem Content="Night" />
|
||
</ListBox>
|
||
<ListBox
|
||
HorizontalAlignment="Center"
|
||
VerticalAlignment="Center"
|
||
n:ListBoxSlideBehavior.EnableSlideAnimation="True"
|
||
n:SelectorAssist.Orientation="Vertical"
|
||
SelectedIndex="0"
|
||
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:AnchorAssist.Header="数据展示 TabControl">
|
||
<WrapPanel>
|
||
<TabControl Style="{StaticResource NavigationTabControl}">
|
||
<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 Style="{StaticResource NavigationTabControl}" TabStripPlacement="Bottom">
|
||
<TabItem Header="选项卡 1">
|
||
<Grid>
|
||
<!-- <Separator /> -->
|
||
<DataGrid
|
||
Margin="4"
|
||
DataContext="{StaticResource Dgd}"
|
||
ItemsSource="{Binding DataCollection}" />
|
||
|
||
</Grid>
|
||
</TabItem>
|
||
<TabItem Header="选项卡 2" />
|
||
<TabItem Header="禁用选项卡" IsEnabled="False" />
|
||
</TabControl>
|
||
<TabControl>
|
||
<TabItem Header="选项卡 1">
|
||
<Grid Margin="4">
|
||
<!-- <Separator /> -->
|
||
<DataGrid
|
||
Margin="4"
|
||
DataContext="{StaticResource Dgd}"
|
||
ItemsSource="{Binding DataCollection}" />
|
||
|
||
</Grid>
|
||
</TabItem>
|
||
<TabItem Header="选项卡 2" />
|
||
<TabItem Header="禁用选项卡" IsEnabled="False" />
|
||
</TabControl>
|
||
<TabControl TabStripPlacement="Left">
|
||
<TabItem Header="选项卡 1">
|
||
<Grid>
|
||
<!-- <Separator /> -->
|
||
<DataGrid
|
||
Margin="4"
|
||
DataContext="{StaticResource Dgd}"
|
||
ItemsSource="{Binding DataCollection}" />
|
||
|
||
</Grid>
|
||
</TabItem>
|
||
<TabItem Header="选项卡 2" />
|
||
<TabItem Header="禁用选项卡" IsEnabled="False" />
|
||
</TabControl>
|
||
<TabControl Style="{StaticResource FlattenTabControl}" TabStripPlacement="Top">
|
||
<TabItem Header="选项卡 1">
|
||
<StackPanel Margin="4">
|
||
<DataGrid
|
||
Margin="4"
|
||
DataContext="{StaticResource Dgd}"
|
||
ItemsSource="{Binding DataCollection}"
|
||
SelectedItem="{Binding SelectedDataGridItems}" />
|
||
<Button
|
||
VerticalAlignment="Center"
|
||
Command="{Binding ShowSelectedItemsCommand}"
|
||
Content="显示选中项" />
|
||
</StackPanel>
|
||
</TabItem>
|
||
<TabItem Header="选项卡 2" />
|
||
<TabItem Header="禁用选项卡" IsEnabled="False" />
|
||
</TabControl>
|
||
<TabControl Style="{StaticResource FlattenTabControl}" TabStripPlacement="Left">
|
||
<TabItem Header="选项卡 1">
|
||
<Grid Margin="4">
|
||
<!-- <Separator /> -->
|
||
<DataGrid
|
||
Margin="4"
|
||
DataContext="{StaticResource Dgd}"
|
||
ItemsSource="{Binding DataCollection}" />
|
||
</Grid>
|
||
</TabItem>
|
||
<TabItem Header="选项卡 2" />
|
||
<TabItem Header="禁用选项卡" IsEnabled="False" />
|
||
</TabControl>
|
||
<n:NeuDataGrid
|
||
Margin="5"
|
||
HorizontalAlignment="Left"
|
||
d:ItemsSource="{d:SampleData ItemCount=5}"
|
||
BindableSelectedItems="{Binding SelectedDataItems, Mode=TwoWay}"
|
||
ItemsSource="{Binding DataItems}"
|
||
ToolTip="双击展开详情">
|
||
<i:Interaction.Triggers>
|
||
<i:EventTrigger EventName="MouseDoubleClick">
|
||
<i:InvokeCommandAction Command="{Binding ToggleDetailsCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=DataGrid}, Path=SelectedItem}" />
|
||
</i:EventTrigger>
|
||
</i:Interaction.Triggers>
|
||
<!-- 2. RowStyle现在只负责绑定详情可见性,不再处理事件 -->
|
||
<DataGrid.RowStyle>
|
||
<Style BasedOn="{StaticResource DataGridRowDefault}" TargetType="DataGridRow">
|
||
<Setter Property="DetailsVisibility" Value="{Binding IsDetailsVisible, Converter={x:Static n:BooleanToVisibilityConverter.CollapsedInstance}, Mode=TwoWay}" />
|
||
</Style>
|
||
</DataGrid.RowStyle>
|
||
<n:NeuDataGrid.RowDetailsTemplate>
|
||
<DataTemplate>
|
||
<StackPanel Margin="10">
|
||
<TextBlock FontWeight="Bold" Text="详细信息:" />
|
||
<StackPanel Margin="10,5,0,0" Orientation="Horizontal">
|
||
<TextBlock Text="姓名: " />
|
||
<TextBlock Text="{Binding Name}" />
|
||
</StackPanel>
|
||
<StackPanel Margin="10,5,0,0" Orientation="Horizontal">
|
||
<TextBlock Text="年龄: " />
|
||
<TextBlock Text="{Binding Age}" />
|
||
</StackPanel>
|
||
</StackPanel>
|
||
</DataTemplate>
|
||
</n:NeuDataGrid.RowDetailsTemplate>
|
||
<n:NeuDataGrid.Columns>
|
||
<DataGridTextColumn Binding="{Binding Name}" Header="Name" />
|
||
<DataGridTextColumn Binding="{Binding Age}" Header="Age" />
|
||
</n:NeuDataGrid.Columns>
|
||
</n:NeuDataGrid>
|
||
<StackPanel>
|
||
<n:TreeGrid
|
||
Margin="5"
|
||
d:ItemsSource="{d:SampleData ItemCount=5}"
|
||
ItemsSource="{Binding HierarchicalData}">
|
||
<n:TreeGrid.ItemTemplate>
|
||
<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}" />
|
||
</HierarchicalDataTemplate>
|
||
</n:TreeGrid.ItemTemplate>
|
||
<!-- 直接定义 GridViewColumn 集合,就像使用 ListView 一样 -->
|
||
<n:TreeGrid.Columns>
|
||
<!-- 第一列使用 CellTemplate 来手动添加展开按钮和内容 -->
|
||
<GridViewColumn Header="任务名">
|
||
<GridViewColumn.CellTemplate>
|
||
<DataTemplate DataType="{x:Type neuwpftest:TreeNodeItem}">
|
||
<StackPanel Orientation="Horizontal">
|
||
<!-- TreeViewItem 的默认模板会提供缩进和展开按钮,我们只需要显示内容即可 -->
|
||
<TextBlock VerticalAlignment="Center" Text="{Binding Name}" />
|
||
</StackPanel>
|
||
</DataTemplate>
|
||
</GridViewColumn.CellTemplate>
|
||
</GridViewColumn>
|
||
|
||
<GridViewColumn DisplayMemberBinding="{Binding Owner}" Header="安排" />
|
||
|
||
<GridViewColumn DisplayMemberBinding="{Binding Status}" Header="状态" />
|
||
</n:TreeGrid.Columns>
|
||
|
||
</n:TreeGrid>
|
||
<Button
|
||
Margin="10"
|
||
VerticalAlignment="Center"
|
||
Command="{Binding ShowSelectedItemsCommand}"
|
||
Content="查看选中项" />
|
||
</StackPanel>
|
||
<n:Accordion
|
||
Width="200"
|
||
BorderBrush="Gray"
|
||
BorderThickness="1">
|
||
<n:AccordionItem Header="User Profile">
|
||
<StackPanel Margin="10">
|
||
<TextBlock Text="Name: John Doe" />
|
||
<TextBlock Text="Email: john.doe@example.com" />
|
||
</StackPanel>
|
||
</n:AccordionItem>
|
||
<n:AccordionItem Header="User Profile">
|
||
<StackPanel Margin="10">
|
||
<TextBlock Text="Name: John Doe" />
|
||
<TextBlock Text="Email: john.doe@example.com" />
|
||
</StackPanel>
|
||
</n:AccordionItem>
|
||
<n:AccordionItem Header="User Profile">
|
||
<StackPanel Margin="10">
|
||
<TextBlock Text="Name: John Doe" />
|
||
<TextBlock Text="Email: john.doe@example.com" />
|
||
</StackPanel>
|
||
</n:AccordionItem>
|
||
<n:AccordionItem Header="Application Settings">
|
||
<StackPanel Margin="10">
|
||
<CheckBox Content="Enable Dark Mode" />
|
||
<CheckBox Content="Auto-save every 5 minutes" />
|
||
</StackPanel>
|
||
</n:AccordionItem>
|
||
<n:AccordionItem Header="Help & Support">
|
||
<TextBlock
|
||
Margin="10"
|
||
Text="For support, please visit our website."
|
||
TextWrapping="Wrap" />
|
||
</n:AccordionItem>
|
||
</n:Accordion>
|
||
<n:Accordion
|
||
BorderBrush="Gray"
|
||
BorderThickness="1"
|
||
ItemsSource="{Binding Items}">
|
||
<n:Accordion.ItemContainerStyle>
|
||
<Style BasedOn="{StaticResource {x:Type n:AccordionItem}}" TargetType="n:AccordionItem">
|
||
<Setter Property="Header" Value="{Binding Label}" />
|
||
<Setter Property="Content">
|
||
<Setter.Value>
|
||
<TextBlock
|
||
Margin="10"
|
||
Text="{Binding Value}"
|
||
TextWrapping="Wrap" />
|
||
</Setter.Value>
|
||
</Setter>
|
||
|
||
</Style>
|
||
</n:Accordion.ItemContainerStyle>
|
||
</n:Accordion>
|
||
<!-- 显示分页后的数据 -->
|
||
<n:PaginationControl
|
||
Margin="0,15,0,0"
|
||
HorizontalAlignment="Center"
|
||
CurrentPage="{Binding CurrentPage, Mode=TwoWay}"
|
||
DataContext="{StaticResource mainViewModel}"
|
||
PageSize="{Binding PageSize, Mode=TwoWay}"
|
||
ShowPageInput="True"
|
||
TotalItems="{Binding TotalItems}" />
|
||
</WrapPanel>
|
||
</StackPanel>
|
||
<StackPanel n:AnchorAssist.Header="其他 Others">
|
||
<n:Breadcrumb Navigate="Breadcrumb_Navigate">
|
||
<n:BreadcrumbItem
|
||
Content="Item1"
|
||
Href="Item1"
|
||
ToolTip="Item 3 Href属性为空将禁用" />
|
||
<n:BreadcrumbItem
|
||
Content="Item2"
|
||
Href="Item2"
|
||
ToolTip="Item 3 Href属性为空将禁用" />
|
||
<n:BreadcrumbItem Content="Item3" />
|
||
</n:Breadcrumb>
|
||
</StackPanel>
|
||
</n:StackPanel>
|
||
</n:Anchor>
|
||
|
||
<!-- 状态栏部分 -->
|
||
<StatusBar Grid.Row="2">
|
||
<TextBlock Text="★" />
|
||
<TextBlock Text="状态栏" />
|
||
<Separator />
|
||
<TextBlock x:Name="TextMessage" Text="消息" />
|
||
</StatusBar>
|
||
</Grid>
|
||
|
||
</n:NeoWindow> |