更新
This commit is contained in:
@@ -1,128 +0,0 @@
|
||||
<ui:FluentWindow
|
||||
Height="450"
|
||||
Title="MainWindow"
|
||||
Width="800"
|
||||
mc:Ignorable="d"
|
||||
x:Class="WPFluent.Gallery.MainWindowEx"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WPFluent.Gallery"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="https://github.com/ShrlAlgo/WPFluent"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ScrollViewer>
|
||||
<StackPanel>
|
||||
<ui:TitleBar />
|
||||
<ui:Button Click="Button_Click" Content="Toast" />
|
||||
<ui:Button Content="Show Flyout">
|
||||
<ui:FlyoutService.Flyout>
|
||||
<ui:Flyout Placement="Bottom">
|
||||
<StackPanel>
|
||||
<TextBlock HorizontalAlignment="Left" Text="Show the flyout message here" />
|
||||
<Button Command="{Binding GotItCommand}" Content="Got it" />
|
||||
</StackPanel>
|
||||
</ui:Flyout>
|
||||
</ui:FlyoutService.Flyout>
|
||||
</ui:Button>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel.Resources>
|
||||
<ui:ToggleButtonGroup x:Key="ToggleButtonGroup" />
|
||||
</StackPanel.Resources>
|
||||
<ToggleButton
|
||||
Content="1st"
|
||||
IsChecked="True"
|
||||
ui:ToggleButtonGroup.Group="{DynamicResource ToggleButtonGroup}" />
|
||||
<ToggleButton Content="2nd" ui:ToggleButtonGroup.Group="{DynamicResource ToggleButtonGroup}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel.Resources>
|
||||
<ui:RadioButtonGroup x:Key="RadioButtonGroup" />
|
||||
</StackPanel.Resources>
|
||||
<RadioButton
|
||||
Content="1st"
|
||||
IsChecked="True"
|
||||
ui:RadioButtonGroup.Group="{DynamicResource RadioButtonGroup}" />
|
||||
<Grid>
|
||||
<RadioButton
|
||||
Content="2nd"
|
||||
Margin="8,0,0,0"
|
||||
ui:RadioButtonGroup.Group="{DynamicResource RadioButtonGroup}" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<ui:TreeListView ItemsSource="{Binding StaffList}">
|
||||
<ui:TreeListView.DataContext>
|
||||
<local:ViewModelEx />
|
||||
</ui:TreeListView.DataContext>
|
||||
<ui:TreeListView.Columns>
|
||||
<GridViewColumnCollection>
|
||||
<ui:GridViewColumn Header="Name" Width="400">
|
||||
<ui:GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ui:TreeRowExpander Content="{Binding Name}" />
|
||||
</DataTemplate>
|
||||
</ui:GridViewColumn.CellTemplate>
|
||||
</ui:GridViewColumn>
|
||||
<ui:GridViewColumn
|
||||
DisplayMemberBinding="{Binding Age}"
|
||||
Header="Age"
|
||||
Width="80" />
|
||||
<ui:GridViewColumn
|
||||
DisplayMemberBinding="{Binding Sex}"
|
||||
Header="Sex"
|
||||
Width="80" />
|
||||
<ui:GridViewColumn
|
||||
DisplayMemberBinding="{Binding Duty}"
|
||||
Header="Duty"
|
||||
Width="100" />
|
||||
<ui:GridViewColumn Header="IsChecked" Width="250">
|
||||
<ui:GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ui:ToggleSwitch IsChecked="{Binding IsChecked}" />
|
||||
</DataTemplate>
|
||||
</ui:GridViewColumn.CellTemplate>
|
||||
</ui:GridViewColumn>
|
||||
</GridViewColumnCollection>
|
||||
</ui:TreeListView.Columns>
|
||||
<ui:TreeListView.ItemTemplate>
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding StaffList}" />
|
||||
</ui:TreeListView.ItemTemplate>
|
||||
</ui:TreeListView>
|
||||
<Button Click="MsgSyncClick" Content="MessageBox" />
|
||||
<Button Click="MsgAsyncClick" Content="MessageBoxAsync" />
|
||||
<Button Click="PendingBoxClick" Content="PendingBox" />
|
||||
<Button Click="ContentDialogClick" Content="ContentDialog" />
|
||||
<Button Click="NewContentDialogClick" Content="NewContentDialog" />
|
||||
<ui:TreeModelListView Model="{Binding TreeTestModel}">
|
||||
<ui:TreeModelListView.DataContext>
|
||||
<local:ViewModel2 />
|
||||
</ui:TreeModelListView.DataContext>
|
||||
<ui:GridView>
|
||||
<ui:GridView.Columns>
|
||||
<ui:GridViewColumn Header="Column1" Width="400">
|
||||
<ui:GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ui:TreeModelRowExpander Content="{Binding Column1}" />
|
||||
</DataTemplate>
|
||||
</ui:GridViewColumn.CellTemplate>
|
||||
</ui:GridViewColumn>
|
||||
<ui:GridViewColumn
|
||||
DisplayMemberBinding="{Binding Column2, Mode=TwoWay}"
|
||||
Header="Column2"
|
||||
Width="250" />
|
||||
<ui:GridViewColumn
|
||||
DisplayMemberBinding="{Binding Column3, Mode=TwoWay}"
|
||||
Header="Column3"
|
||||
Width="250" />
|
||||
<ui:GridViewColumn Header="IsChecked" Width="250">
|
||||
<ui:GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ui:ToggleSwitch IsChecked="{Binding IsChecked}" />
|
||||
</DataTemplate>
|
||||
</ui:GridViewColumn.CellTemplate>
|
||||
</ui:GridViewColumn>
|
||||
</ui:GridView.Columns>
|
||||
</ui:GridView>
|
||||
</ui:TreeModelListView>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</ui:FluentWindow>
|
||||
@@ -1,92 +0,0 @@
|
||||
|
||||
|
||||
using System.Threading;
|
||||
|
||||
using System.Windows;
|
||||
|
||||
using WPFluent.Controls;
|
||||
|
||||
using MessageBox = WPFluent.Controls.MessageBox;
|
||||
|
||||
|
||||
namespace WPFluent.Gallery;
|
||||
|
||||
/// <summary>
|
||||
/// MainWindowEx.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class MainWindowEx
|
||||
{
|
||||
ContentDialog dialog;
|
||||
ContentDialog newdialog;
|
||||
|
||||
public MainWindowEx()
|
||||
{
|
||||
InitializeComponent();
|
||||
dialog = new()
|
||||
{
|
||||
Title = "My sample dialog",
|
||||
Content = "Content of the dialog",
|
||||
CloseButtonText = "Close button",
|
||||
PrimaryButtonText = "Primary button",
|
||||
SecondaryButtonText = "Secondary button",
|
||||
// Setting the dialog container
|
||||
//DialogHost = ContentDialogHostService.ContentPresenterForDialogs
|
||||
};
|
||||
newdialog = new()
|
||||
{
|
||||
Title = "My sample dialog",
|
||||
Content = "Content of the dialog",
|
||||
CloseButtonText = "Close button",
|
||||
PrimaryButtonText = "Primary button",
|
||||
SecondaryButtonText = "Secondary button",
|
||||
DefaultButton = ContentDialogButton.Primary,
|
||||
};
|
||||
Splash.CloseOnLoaded(this, minimumMilliseconds: 1800);
|
||||
}
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Toast.Information("I am information message");
|
||||
Toast.Error("I am error message");
|
||||
//Toast.Success("I am success message");
|
||||
//Toast.Warning("I am warning message");
|
||||
//Toast.Show(owner: null, "I am any message", new ToastConfig());
|
||||
}
|
||||
|
||||
private async void ContentDialogClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
await dialog.ShowAsync(CancellationToken.None);
|
||||
}
|
||||
|
||||
private async void MsgAsyncClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// Async methods
|
||||
_ = await MessageBox.InformationAsync("This is a information message");
|
||||
_ = await MessageBox.WarningAsync("This is a warning message");
|
||||
_ = await MessageBox.ErrorAsync("This is a error message");
|
||||
var result = await MessageBox.QuestionAsync("This is a question and do you want to click OK?");
|
||||
}
|
||||
|
||||
private void MsgSyncClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_ = MessageBox.Information("This is a information message");
|
||||
_ = MessageBox.Warning("This is a warning message");
|
||||
_ = MessageBox.Error("This is a error message");
|
||||
var result = MessageBox.Question("This is a question and do you want to click OK?");
|
||||
}
|
||||
|
||||
private async void NewContentDialogClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_ = await dialog.ShowAsync();
|
||||
}
|
||||
|
||||
private void PendingBoxClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// Default style.
|
||||
using IPendingHandler pending = PendingBox.Show();
|
||||
|
||||
// Show with title and cancel button.
|
||||
//using IPendingHandler pending = PendingBox.Show("Doing something", "I'm a title", isShowCancel: true);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -19,63 +19,159 @@
|
||||
Header="WPF UI anchor.">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:Anchor
|
||||
IsEnabled="{Binding ElementName=CBDisableAnchor,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}"
|
||||
Grid.Column="0"
|
||||
Content="Anchor"
|
||||
Icon="{ui:SymbolIcon Link24}"
|
||||
IsEnabled="{Binding ElementName=CBDisableAnchor,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}"
|
||||
NavigateUri="https://www.shrlalgo.com/" />
|
||||
<CheckBox
|
||||
<ui:Badge
|
||||
Grid.Column="1"
|
||||
Appearance="Caution"
|
||||
Content="Badge" />
|
||||
<CheckBox
|
||||
x:Name="CBDisableAnchor"
|
||||
Grid.Column="2"
|
||||
HorizontalAlignment="Right"
|
||||
Content="禁用anchor" />
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="Badge">
|
||||
<ui:Badge Appearance="Caution" Content="徽章" />
|
||||
</GroupBox>
|
||||
<GroupBox Header="IconButton">
|
||||
<GroupBox Header="Button">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<Button Click="Button_Click" IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}">
|
||||
<ui:SymbolIcon Symbol="Button20" />
|
||||
</Button>
|
||||
<Button
|
||||
Command="{Binding ButtonClickCommand}"
|
||||
Content="消息"
|
||||
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
<Button
|
||||
Grid.Column="0"
|
||||
Content="默认按钮"
|
||||
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
<ui:Button
|
||||
Grid.Column="0"
|
||||
Content="UiButton"
|
||||
Icon="{ui:SymbolIcon Fluent24}"
|
||||
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
<ui:Button
|
||||
HorizontalAlignment="Center"
|
||||
Appearance="Primary"
|
||||
Content="AccentUiButton"
|
||||
Icon="{ui:SymbolIcon Fluent24}"
|
||||
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
<ui:Button
|
||||
Appearance="Secondary"
|
||||
Content="FontIcon button"
|
||||
Icon="{ui:FontIcon 🌈}"
|
||||
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
<ui:Button
|
||||
Appearance="Danger"
|
||||
Content="ImageIconButton"
|
||||
Icon="{ui:ImageIcon pack://application:\,\,\,/WPFluent.Gallery;component/wpfui.png}"
|
||||
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
<ui:StackPanel Spacing="5">
|
||||
<ui:StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<TextBlock
|
||||
Width="120"
|
||||
VerticalAlignment="Center"
|
||||
Text="Button:"
|
||||
TextAlignment="Right" />
|
||||
<Button
|
||||
Width="120"
|
||||
Content="Default"
|
||||
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
<RepeatButton Width="120" IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ui:SymbolIcon Symbol="KeyCommand16" />
|
||||
<TextBlock Text="Repeat" />
|
||||
</StackPanel>
|
||||
</RepeatButton>
|
||||
<Button Width="120" IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ui:SymbolIcon Symbol="KeyCommand16" />
|
||||
<TextBlock Text="Icon" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</ui:StackPanel>
|
||||
<ui:StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<TextBlock
|
||||
Width="120"
|
||||
VerticalAlignment="Center"
|
||||
Text="UiButton:"
|
||||
TextAlignment="Right" />
|
||||
<ui:Button
|
||||
Width="120"
|
||||
Appearance="Primary"
|
||||
Content="Primary"
|
||||
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
<ui:Button
|
||||
Width="120"
|
||||
Appearance="Accent"
|
||||
Content="Accent"
|
||||
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
</ui:StackPanel>
|
||||
<ui:StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<TextBlock
|
||||
Width="120"
|
||||
VerticalAlignment="Center"
|
||||
Text="AccentUiButton:" />
|
||||
<ui:Button
|
||||
Width="120"
|
||||
Appearance="Attention"
|
||||
Command="{Binding ButtonClickCommand}"
|
||||
CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self}}"
|
||||
Content="Attention"
|
||||
Icon="{ui:SymbolIcon Fluent24}"
|
||||
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
<ui:Button
|
||||
Width="120"
|
||||
Appearance="Success"
|
||||
Command="{Binding ButtonClickCommand}"
|
||||
CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self}}"
|
||||
Content="Success"
|
||||
Icon="{ui:SymbolIcon Fluent24}"
|
||||
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
<ui:Button
|
||||
Width="120"
|
||||
Appearance="Caution"
|
||||
Command="{Binding ButtonClickCommand}"
|
||||
CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self}}"
|
||||
Content="Caution"
|
||||
Icon="{ui:SymbolIcon Fluent24}"
|
||||
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
<ui:Button
|
||||
Width="120"
|
||||
Appearance="Critical"
|
||||
Command="{Binding ButtonClickCommand}"
|
||||
CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self}}"
|
||||
Content="Critical"
|
||||
Icon="{ui:SymbolIcon Fluent24}"
|
||||
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
</ui:StackPanel>
|
||||
<ui:StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<TextBlock
|
||||
Width="120"
|
||||
VerticalAlignment="Center"
|
||||
Text="IconUiButton:"
|
||||
TextAlignment="Right" />
|
||||
<ui:Button
|
||||
Width="120"
|
||||
Content="Symbol"
|
||||
Icon="{ui:SymbolIcon Fluent24}"
|
||||
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
<ui:Button
|
||||
Width="120"
|
||||
Content="Font"
|
||||
Icon="{ui:FontIcon 🌈}"
|
||||
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
<ui:Button
|
||||
Width="120"
|
||||
Content="Image"
|
||||
Icon="{ui:ImageIcon pack://application:\,\,\,/WPFluent.Gallery;component/wpfui.png}"
|
||||
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
</ui:StackPanel>
|
||||
<ui:StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<TextBlock
|
||||
Width="120"
|
||||
VerticalAlignment="Center"
|
||||
Text="MessageBox:"
|
||||
TextAlignment="Right" />
|
||||
<ui:Button
|
||||
Width="120"
|
||||
Content="Sync"
|
||||
Icon="{ui:SymbolIcon Symbol=Info16}"
|
||||
Command="{Binding MsgSyncCommand}"
|
||||
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
<ui:Button
|
||||
Width="120"
|
||||
Content="Async"
|
||||
Command="{Binding MsgAsyncCommand}"
|
||||
Icon="{ui:SymbolIcon Symbol=Info16}"
|
||||
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
<ui:Button
|
||||
Width="120"
|
||||
Content="Pending"
|
||||
Command="{Binding MsgPendingCommand}"
|
||||
Icon="{ui:SymbolIcon Symbol=Info16}"
|
||||
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
</ui:StackPanel>
|
||||
</ui:StackPanel>
|
||||
<CheckBox
|
||||
x:Name="CBDisableButton"
|
||||
@@ -98,6 +194,7 @@
|
||||
OnContent="开" />
|
||||
<ToggleButton
|
||||
Grid.Column="0"
|
||||
Width="120"
|
||||
Content="切换按钮"
|
||||
IsEnabled="{Binding ElementName=CBDisableToggle,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
</ui:StackPanel>
|
||||
@@ -122,7 +219,7 @@
|
||||
<ComboBox
|
||||
MinWidth="150"
|
||||
HorizontalAlignment="Left"
|
||||
ItemsSource="{Binding ViewModel.ComboBoxFontFamilies, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type pages:BasicInputPage}, Mode=FindAncestor}}"
|
||||
ItemsSource="{Binding ComboBoxFontFamilies, Mode=OneWay}"
|
||||
SelectedIndex="0">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
@@ -141,7 +238,7 @@
|
||||
HorizontalAlignment="Left"
|
||||
Header="带标题:"
|
||||
HeaderPlacement="Left"
|
||||
ItemsSource="{Binding ViewModel.ComboBoxFontFamilies, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type pages:BasicInputPage}, Mode=FindAncestor}}" />
|
||||
ItemsSource="{Binding ComboBoxFontFamilies, Mode=OneWay}" />
|
||||
</ui:StackPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Margin="0" Header="A DropDownButton">
|
||||
@@ -198,28 +295,42 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
||||
<ui:StackPanel Grid.Column="0" Orientation="Horizontal" Spacing="30">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton
|
||||
Content="选项 1"
|
||||
GroupName="radio_group_one"
|
||||
IsChecked="True"
|
||||
IsEnabled="{Binding ElementName=CBDisableRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
<RadioButton
|
||||
Content="选项 1"
|
||||
GroupName="radio_group_one"
|
||||
IsChecked="True"
|
||||
IsEnabled="{Binding ElementName=CBDisableRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
Content="选项 2"
|
||||
GroupName="radio_group_one"
|
||||
IsEnabled="{Binding ElementName=CBDisableRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<RadioButton
|
||||
Content="选项 1"
|
||||
FlowDirection="RightToLeft"
|
||||
GroupName="radio_group_two"
|
||||
IsChecked="True"
|
||||
IsEnabled="{Binding ElementName=CBDisableRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
<RadioButton
|
||||
Content="选项 2"
|
||||
GroupName="radio_group_one"
|
||||
IsEnabled="{Binding ElementName=CBDisableRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
<RadioButton
|
||||
Content="选项 1"
|
||||
FlowDirection="RightToLeft"
|
||||
GroupName="radio_group_two"
|
||||
IsChecked="True"
|
||||
IsEnabled="{Binding ElementName=CBDisableRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
<RadioButton
|
||||
Content="选项 2"
|
||||
FlowDirection="RightToLeft"
|
||||
GroupName="radio_group_two"
|
||||
IsEnabled="{Binding ElementName=CBDisableRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
</StackPanel>
|
||||
Content="选项 2"
|
||||
FlowDirection="RightToLeft"
|
||||
GroupName="radio_group_two"
|
||||
IsEnabled="{Binding ElementName=CBDisableRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel.Resources>
|
||||
<ui:ToggleButtonGroup x:Key="ToggleButtonGroup" />
|
||||
</StackPanel.Resources>
|
||||
<ToggleButton
|
||||
Content="1st"
|
||||
IsChecked="True"
|
||||
ui:ToggleButtonGroup.Group="{DynamicResource ToggleButtonGroup}" />
|
||||
<ToggleButton Content="2nd" ui:ToggleButtonGroup.Group="{DynamicResource ToggleButtonGroup}" />
|
||||
</StackPanel>
|
||||
</ui:StackPanel>
|
||||
<CheckBox
|
||||
x:Name="CBDisableRadioButton"
|
||||
Grid.Column="1"
|
||||
@@ -247,7 +358,10 @@
|
||||
<Label Margin="0,0,0,-4" Content="值:" />
|
||||
<TextBlock Margin="0" Text="{Binding ElementName=UiRating,Path=Value}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<StackPanel
|
||||
Grid.Column="2"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<CheckBox
|
||||
x:Name="CBSetFull"
|
||||
VerticalAlignment="Center"
|
||||
@@ -268,21 +382,21 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Slider
|
||||
x:Name="Slider"
|
||||
Width="200"
|
||||
Margin="10,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Value="{Binding ViewModel.RangeSliderValue, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type pages:BasicInputPage}, Mode=FindAncestor}}"
|
||||
IsSnapToTickEnabled="{Binding ElementName=CBSnapToTick,Path=IsChecked}"
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
TickFrequency="20"
|
||||
TickPlacement="{Binding ElementName=CBPlacement,Path=SelectedItem}" />
|
||||
<TextBlock VerticalAlignment="Center" Text="值:" />
|
||||
<TextBlock VerticalAlignment="Center" Text="{Binding ViewModel.RangeSliderValue, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type pages:BasicInputPage}, Mode=FindAncestor}}" />
|
||||
<TextBlock VerticalAlignment="Center" Text="{Binding ElementName=Slider,Path=Value, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
<Grid Grid.Column="1">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<ComboBox
|
||||
x:Name="CBPlacement"
|
||||
Margin="10,0"
|
||||
@@ -415,6 +529,42 @@
|
||||
<ui:ColorPickerControl VerticalAlignment="Top" />
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="Flyout">
|
||||
<ui:StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<ui:Flyout IsOpen="{Binding IsFlyoutOpen, Mode=TwoWay}" Placement="Top">
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
Width="280"
|
||||
HorizontalAlignment="Left"
|
||||
Text="Replicants like any other machine are either a benefit or a hazard. If they're a benefit it's not my problem."
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
<Button Margin="0,8,0,0" Content="The cake is a lie!" />
|
||||
</StackPanel>
|
||||
</ui:Flyout>
|
||||
<Button
|
||||
Command="{Binding FlyoutButtonClickCommand, Mode=OneWay}"
|
||||
CommandParameter="{Binding Mode=OneWay, RelativeSource={RelativeSource Mode=Self}}"
|
||||
Content="Open flyout" />
|
||||
<Button
|
||||
Command="{Binding OpenCustomMessageBoxCommand}"
|
||||
CommandParameter="{Binding Mode=OneWay, RelativeSource={RelativeSource Mode=Self}}"
|
||||
Content="Open UI MessageBox" />
|
||||
</ui:StackPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Header="Media">
|
||||
<ui:StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<Image
|
||||
Height="200"
|
||||
HorizontalAlignment="Left"
|
||||
Source="pack://application:,,,/WPFluent.Gallery;component/Assets/pexels-johannes-plenio-1103970.jpg" />
|
||||
<ui:Image
|
||||
Height="200"
|
||||
HorizontalAlignment="Left"
|
||||
BorderBrush="#33000000"
|
||||
BorderThickness="2"
|
||||
CornerRadius="4"
|
||||
Source="pack://application:,,,/WPFluent.Gallery;component/Assets/pexels-johannes-plenio-1103970.jpg" />
|
||||
</ui:StackPanel>
|
||||
</GroupBox>
|
||||
</ui:StackPanel>
|
||||
</Page>
|
||||
@@ -8,20 +8,9 @@ namespace WPFluent.Gallery.Views.Pages;
|
||||
|
||||
public partial class BasicInputPage
|
||||
{
|
||||
public BasicInputViewModel ViewModel { get; }
|
||||
|
||||
public BasicInputPage()
|
||||
{
|
||||
ViewModel = new();
|
||||
DataContext = ViewModel;
|
||||
DataContext = new BasicInputViewModel();
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var theme = ThemeManager.GetAppTheme();
|
||||
ThemeManager.ChangeAppTheme(theme
|
||||
== ThemeType.Light ? ThemeType.Dark : ThemeType.Light);
|
||||
var res = Application.Current.Resources;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,42 +8,32 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:models="clr-namespace:WPFluent.Gallery.Models"
|
||||
xmlns:ui="https://github.com/ShrlAlgo/WPFluent"
|
||||
xmlns:vm="clr-namespace:WPFluent.Gallery.ViewModels.Pages"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance local:CollectionsPage,
|
||||
d:DataContext="{d:DesignInstance vm:CollectionsViewModel,
|
||||
IsDesignTimeCreatable=False}"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Title="CollectionsPage">
|
||||
|
||||
<Grid>
|
||||
<StackPanel Grid.Row="1">
|
||||
<GroupBox Margin="0" Header="Default DataGrid with ItemsSource.">
|
||||
<DataGrid Height="400" ItemsSource="{Binding ViewModel.ProductsCollection, Mode=TwoWay}" />
|
||||
<GroupBox Margin="0" Header="DataGrid">
|
||||
<DataGrid Height="400" ItemsSource="{Binding ProductsCollection, Mode=TwoWay}" />
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="WPF UI DataGrid with ItemsSource.">
|
||||
<ui:DataGrid Height="400" ItemsSource="{Binding ViewModel.ProductsCollection, Mode=TwoWay}" />
|
||||
<GroupBox Header="UI DataGrid">
|
||||
<ui:DataGrid Height="400" ItemsSource="{Binding ProductsCollection, Mode=TwoWay}" />
|
||||
</GroupBox>
|
||||
<GroupBox Margin="0" Header="ListBox with items defined inline.">
|
||||
<ListBox SelectedIndex="0">
|
||||
<ListBoxItem>Blue</ListBoxItem>
|
||||
<ListBoxItem>Green</ListBoxItem>
|
||||
<ListBoxItem>Red</ListBoxItem>
|
||||
<ListBoxItem>Yellow</ListBoxItem>
|
||||
</ListBox>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="A ListBox with its ItemsSource and Height set.">
|
||||
<GroupBox Header="ListBox">
|
||||
<ListBox
|
||||
Height="164"
|
||||
d:ItemsSource="{d:SampleData ItemCount=5}"
|
||||
ItemsSource="{Binding ViewModel.ListBoxItems, Mode=TwoWay}"
|
||||
ItemsSource="{Binding ListBoxItems, Mode=TwoWay}"
|
||||
SelectedIndex="2" />
|
||||
</GroupBox>
|
||||
<GroupBox Margin="0" Header="Basic ListView with Simple DataTemplate.">
|
||||
<GroupBox Margin="0" Header="ListView with DataTemplate.">
|
||||
<ui:ListView
|
||||
MaxHeight="200"
|
||||
d:ItemsSource="{d:SampleData ItemCount=2}"
|
||||
ItemsSource="{Binding ViewModel.BasicListViewItems, Mode=TwoWay}"
|
||||
ItemsSource="{Binding BasicListViewItems, Mode=TwoWay}"
|
||||
SelectedIndex="2"
|
||||
SelectionMode="Single">
|
||||
<ui:ListView.ItemTemplate>
|
||||
@@ -64,9 +54,9 @@
|
||||
Grid.Column="0"
|
||||
MaxHeight="200"
|
||||
d:ItemsSource="{d:SampleData ItemCount=2}"
|
||||
ItemsSource="{Binding ViewModel.BasicListViewItems, Mode=TwoWay}"
|
||||
ItemsSource="{Binding BasicListViewItems, Mode=TwoWay}"
|
||||
SelectedIndex="1"
|
||||
SelectionMode="{Binding ViewModel.ListViewSelectionMode, Mode=OneWay}">
|
||||
SelectionMode="{Binding ElementName=SelectionModeComboBox,Path=SelectedItem, Mode=OneWay}">
|
||||
<ui:ListView.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type models:Person}">
|
||||
<Grid Margin="8,0">
|
||||
@@ -108,11 +98,15 @@
|
||||
MinWidth="120"
|
||||
Margin="12,0,0,0"
|
||||
VerticalAlignment="Top">
|
||||
<Label Content="Selection mode" Target="{Binding ElementName=SelectionModeComboBox}" />
|
||||
<ComboBox x:Name="SelectionModeComboBox" SelectedIndex="{Binding ViewModel.ListViewSelectionModeComboBoxSelectedIndex, Mode=TwoWay}">
|
||||
<ComboBoxItem Content="Single" />
|
||||
<ComboBoxItem Content="Multiple" />
|
||||
<ComboBoxItem Content="Extended" />
|
||||
<Label Content="选择模式" Target="{Binding ElementName=SelectionModeComboBox}" />
|
||||
<ComboBox x:Name="SelectionModeComboBox" SelectedIndex="0">
|
||||
<ComboBox.ItemsSource>
|
||||
<x:Array Type="{x:Type SelectionMode}">
|
||||
<SelectionMode>Single</SelectionMode>
|
||||
<SelectionMode>Multiple</SelectionMode>
|
||||
<SelectionMode>Extended</SelectionMode>
|
||||
</x:Array>
|
||||
</ComboBox.ItemsSource>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
@@ -123,7 +117,7 @@
|
||||
MaxHeight="200"
|
||||
BorderThickness="0"
|
||||
d:ItemsSource="{d:SampleData ItemCount=2}"
|
||||
ItemsSource="{Binding ViewModel.BasicListViewItems, Mode=TwoWay}">
|
||||
ItemsSource="{Binding BasicListViewItems, Mode=TwoWay}">
|
||||
<ui:ListView.View>
|
||||
<ui:GridView>
|
||||
<ui:GridViewColumn
|
||||
@@ -142,7 +136,7 @@
|
||||
</ui:ListView.View>
|
||||
</ui:ListView>
|
||||
</GroupBox>
|
||||
<GroupBox Margin="0" Header="Simple TreeView.">
|
||||
<GroupBox Margin="0" Header="TreeView">
|
||||
<TreeView AllowDrop="True" ScrollViewer.CanContentScroll="False">
|
||||
<TreeViewItem
|
||||
Header="Work Documents"
|
||||
@@ -161,24 +155,8 @@
|
||||
</TreeViewItem>
|
||||
</TreeView>
|
||||
</GroupBox>
|
||||
<GroupBox>
|
||||
<GroupBox Header="MultiTreeView">
|
||||
<StackPanel>
|
||||
<TreeView>
|
||||
<ui:TreeViewItem Header="ui:TreeViewItem">
|
||||
<ui:TreeViewItem Header="ui:TreeViewItem">
|
||||
<ui:TreeViewItem Header="ui:TreeViewItem" />
|
||||
<ui:TreeViewItem Header="ui:TreeViewItem" />
|
||||
</ui:TreeViewItem>
|
||||
<ui:TreeViewItem Header="ui:TreeViewItem" />
|
||||
</ui:TreeViewItem>
|
||||
<TreeViewItem Header="TreeViewItem">
|
||||
<TreeViewItem Header="TreeViewItem">
|
||||
<TreeViewItem Header="TreeViewItem" />
|
||||
<TreeViewItem Header="TreeViewItem" />
|
||||
</TreeViewItem>
|
||||
<TreeViewItem Header="TreeViewItem" />
|
||||
</TreeViewItem>
|
||||
</TreeView>
|
||||
<ui:MultiTreeView>
|
||||
<ui:MultiTreeViewItem Header="FirstRoot">
|
||||
<ui:MultiTreeViewItem Header="First">
|
||||
@@ -188,7 +166,6 @@
|
||||
<ui:MultiTreeViewItem Header="Second" />
|
||||
</ui:MultiTreeViewItem>
|
||||
<ui:MultiTreeViewItem Header="SecondRoot" />
|
||||
|
||||
<!--<b:Interaction.Triggers>
|
||||
<b:EventTrigger EventName="SelectedItemChanged">
|
||||
<b:ChangePropertyAction PropertyName="" TargetObject="{Binding}" />
|
||||
@@ -212,11 +189,73 @@
|
||||
</ui:MultiTreeView>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Header="TreeListView">
|
||||
<ui:TreeListView ItemsSource="{Binding StaffList}">
|
||||
<ui:TreeListView.Columns>
|
||||
<GridViewColumnCollection>
|
||||
<ui:GridViewColumn Width="400" Header="Name">
|
||||
<ui:GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ui:TreeRowExpander Content="{Binding Name}" />
|
||||
</DataTemplate>
|
||||
</ui:GridViewColumn.CellTemplate>
|
||||
</ui:GridViewColumn>
|
||||
<ui:GridViewColumn
|
||||
Width="80"
|
||||
DisplayMemberBinding="{Binding Age}"
|
||||
Header="Age" />
|
||||
<ui:GridViewColumn
|
||||
Width="80"
|
||||
DisplayMemberBinding="{Binding Sex}"
|
||||
Header="Sex" />
|
||||
<ui:GridViewColumn
|
||||
Width="100"
|
||||
DisplayMemberBinding="{Binding Duty}"
|
||||
Header="Duty" />
|
||||
<ui:GridViewColumn Width="250" Header="IsChecked">
|
||||
<ui:GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ui:ToggleSwitch IsChecked="{Binding IsChecked}" />
|
||||
</DataTemplate>
|
||||
</ui:GridViewColumn.CellTemplate>
|
||||
</ui:GridViewColumn>
|
||||
</GridViewColumnCollection>
|
||||
</ui:TreeListView.Columns>
|
||||
<ui:TreeListView.ItemTemplate>
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding StaffList}" />
|
||||
</ui:TreeListView.ItemTemplate>
|
||||
</ui:TreeListView>
|
||||
</GroupBox>
|
||||
<GroupBox Header="TreeModelListView">
|
||||
<ui:TreeModelListView Model="{Binding TreeTestModel}">
|
||||
<ui:GridView>
|
||||
<ui:GridView.Columns>
|
||||
<ui:GridViewColumn Header="Column1" Width="400">
|
||||
<ui:GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ui:TreeModelRowExpander Content="{Binding Column1}" />
|
||||
</DataTemplate>
|
||||
</ui:GridViewColumn.CellTemplate>
|
||||
</ui:GridViewColumn>
|
||||
<ui:GridViewColumn
|
||||
DisplayMemberBinding="{Binding Column2, Mode=TwoWay}"
|
||||
Header="Column2"
|
||||
Width="250" />
|
||||
<ui:GridViewColumn
|
||||
DisplayMemberBinding="{Binding Column3, Mode=TwoWay}"
|
||||
Header="Column3"
|
||||
Width="250" />
|
||||
<ui:GridViewColumn Header="IsChecked" Width="250">
|
||||
<ui:GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ui:ToggleSwitch IsChecked="{Binding IsChecked}" />
|
||||
</DataTemplate>
|
||||
</ui:GridViewColumn.CellTemplate>
|
||||
</ui:GridViewColumn>
|
||||
</ui:GridView.Columns>
|
||||
</ui:GridView>
|
||||
</ui:TreeModelListView>
|
||||
</GroupBox>
|
||||
</StackPanel>
|
||||
|
||||
<!-- <controls:GalleryNavigationPresenter -->
|
||||
<!-- Grid.Row="1" -->
|
||||
<!-- Margin="0, 10" -->
|
||||
<!-- ItemsSource="{Binding ViewModel.NavigationCards, Mode=OneWay}" /> -->
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -1,17 +1,13 @@
|
||||
using WPFluent.Gallery.ViewModels.Pages.Collections;
|
||||
using WPFluent.Gallery.ViewModels.Pages;
|
||||
|
||||
namespace WPFluent.Gallery.Views.Pages.Collections;
|
||||
|
||||
public partial class CollectionsPage
|
||||
{
|
||||
public CollectionsViewModel ViewModel { get; }
|
||||
|
||||
public CollectionsPage()
|
||||
{
|
||||
ViewModel = new();
|
||||
DataContext = ViewModel;
|
||||
|
||||
|
||||
DataContext = new CollectionsViewModel();
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,11 +22,12 @@
|
||||
<GroupBox Header="A basic Calendar control">
|
||||
<Calendar HorizontalAlignment="Left" />
|
||||
</GroupBox>
|
||||
<GroupBox>
|
||||
<GroupBox Header="DatePicker">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:CalendarDatePicker
|
||||
Content="Pick a date"
|
||||
@@ -39,11 +40,10 @@
|
||||
Margin="8,0,0,0"
|
||||
Text="{Binding Date, ElementName=CalendarDatePicker}"
|
||||
VerticalAlignment="Center" />
|
||||
<DatePicker Width="120" Grid.Column="2" HorizontalAlignment="Right"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="DatePicker">
|
||||
<DatePicker />
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="TimePicker">
|
||||
<ui:TimePicker
|
||||
ClockIdentifier="Clock12Hour"
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
|
||||
|
||||
using DateAndTimeViewModel = WPFluent.Gallery.ViewModels.Pages.DateAndTimeViewModel;
|
||||
|
||||
namespace WPFluent.Gallery.Views.Pages;
|
||||
|
||||
public partial class DateAndTimePage
|
||||
{
|
||||
public DateAndTimePage()
|
||||
{
|
||||
DataContext = new DateAndTimeViewModel();
|
||||
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="950"
|
||||
d:DesignWidth="800"
|
||||
ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}"
|
||||
ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Title="ColorsPage"
|
||||
|
||||
>
|
||||
Title="ColorsPage">
|
||||
|
||||
<StackPanel Margin="0,0,0,24">
|
||||
<ui:TextBlock Text="Color provides an intuitive way of communicating information to users in your app: it can be used to indicate interactivity, give feedback to user actions, and give your interface a sense of visual continuity." TextWrapping="WrapWithOverflow" />
|
||||
@@ -55,8 +55,7 @@
|
||||
<Border
|
||||
Grid.Column="0"
|
||||
Background="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
CornerRadius="8,0,0,8"
|
||||
TextElement.Foreground="{DynamicResource TextFillColorInverseBrush}">
|
||||
CornerRadius="8,0,0,8">
|
||||
<Grid Margin="12">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
@@ -74,8 +73,7 @@
|
||||
<Border
|
||||
Grid.Column="1"
|
||||
Background="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
CornerRadius="0"
|
||||
TextElement.Foreground="{DynamicResource TextFillColorInverseBrush}">
|
||||
CornerRadius="0">
|
||||
<Grid Margin="12">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
@@ -93,8 +91,7 @@
|
||||
<Border
|
||||
Grid.Column="2"
|
||||
Background="{DynamicResource TextFillColorTertiaryBrush}"
|
||||
CornerRadius="0"
|
||||
TextElement.Foreground="{DynamicResource TextFillColorInverseBrush}">
|
||||
CornerRadius="0">
|
||||
<Grid Margin="12">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
@@ -112,8 +109,7 @@
|
||||
<Border
|
||||
Grid.Column="3"
|
||||
Background="{DynamicResource TextFillColorDisabledBrush}"
|
||||
CornerRadius="0,8,8,0"
|
||||
TextElement.Foreground="{DynamicResource TextFillColorInverseBrush}">
|
||||
CornerRadius="0,8,8,0">
|
||||
<Grid Margin="12">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
@@ -162,8 +158,7 @@
|
||||
<Border
|
||||
Grid.Column="0"
|
||||
Background="{DynamicResource AccentTextFillColorPrimaryBrush}"
|
||||
CornerRadius="8,0,0,8"
|
||||
TextElement.Foreground="{DynamicResource TextFillColorInverseBrush}">
|
||||
CornerRadius="8,0,0,8">
|
||||
<Grid Margin="12">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
@@ -181,8 +176,7 @@
|
||||
<Border
|
||||
Grid.Column="1"
|
||||
Background="{DynamicResource AccentTextFillColorSecondaryBrush}"
|
||||
CornerRadius="0"
|
||||
TextElement.Foreground="{DynamicResource TextFillColorInverseBrush}">
|
||||
CornerRadius="0">
|
||||
<Grid Margin="12">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
@@ -200,8 +194,7 @@
|
||||
<Border
|
||||
Grid.Column="2"
|
||||
Background="{DynamicResource AccentTextFillColorTertiaryBrush}"
|
||||
CornerRadius="0"
|
||||
TextElement.Foreground="{DynamicResource TextFillColorInverseBrush}">
|
||||
CornerRadius="0">
|
||||
<Grid Margin="12">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
@@ -219,8 +212,7 @@
|
||||
<Border
|
||||
Grid.Column="3"
|
||||
Background="{DynamicResource AccentTextFillColorDisabledBrush}"
|
||||
CornerRadius="0,8,8,0"
|
||||
TextElement.Foreground="{DynamicResource TextFillColorInverseBrush}">
|
||||
CornerRadius="0,8,8,0">
|
||||
<Grid Margin="12">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
Grid.Row="1"
|
||||
Margin="0,4,0,0"
|
||||
Padding="0"
|
||||
Content="Find out more about Fluent System Icons"
|
||||
Content="了解更多Fluent System Icons"
|
||||
NavigateUri="https://github.com/microsoft/fluentui-system-icons" />
|
||||
<ui:TextBlock
|
||||
Grid.Row="2"
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
<Page
|
||||
x:Class="WPFluent.Gallery.Views.Pages.DialogsAndFlyoutsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:WPFluent.Gallery.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:models="clr-namespace:WPFluent.Gallery.Models"
|
||||
xmlns:pages="clr-namespace:WPFluent.Gallery.Views.Pages"
|
||||
xmlns:ui="https://github.com/ShrlAlgo/WPFluent"
|
||||
xmlns:vm="clr-namespace:WPFluent.Gallery.ViewModels.Pages"
|
||||
mc:Ignorable="d"
|
||||
|
||||
d:DataContext="{d:DesignInstance vm:DialogsAndFlyoutsViewModel,
|
||||
IsDesignTimeCreatable=False}"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Title="DialogsAndFlyoutsPage"
|
||||
|
||||
>
|
||||
<Page.Resources>
|
||||
<ResourceDictionary>
|
||||
<StackPanel x:Key="DialogContent">
|
||||
<TextBlock Text="Lorem ipsum dolor sit amet, adipisicing elit." TextWrapping="Wrap" />
|
||||
<CheckBox Content="Upload your content to the cloud." />
|
||||
</StackPanel>
|
||||
</ResourceDictionary>
|
||||
</Page.Resources>
|
||||
<ui:StackPanel Spacing="5">
|
||||
<GroupBox Header="WPF UI Flyout control.">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<ui:Flyout
|
||||
Grid.Row="0"
|
||||
IsOpen="{Binding ViewModel.IsFlyoutOpen, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type pages:DialogsAndFlyoutsPage}, Mode=FindAncestor}}"
|
||||
Placement="Top">
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
Width="280"
|
||||
HorizontalAlignment="Left"
|
||||
Text="Replicants like any other machine are either a benefit or a hazard. If they're a benefit it's not my problem."
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
<Button Margin="0,8,0,0" Content="The cake is a lie!" />
|
||||
</StackPanel>
|
||||
</ui:Flyout>
|
||||
<Button
|
||||
Grid.Row="1"
|
||||
Command="{Binding ViewModel.ButtonClickCommand, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type pages:DialogsAndFlyoutsPage}, Mode=FindAncestor}}"
|
||||
CommandParameter="{Binding Mode=OneWay, RelativeSource={RelativeSource Mode=Self}}"
|
||||
Content="Open flyout" />
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="ContentDialog">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button
|
||||
Command="{Binding ShowDialogCommand}"
|
||||
CommandParameter="{StaticResource DialogContent}"
|
||||
Content="Show" />
|
||||
|
||||
<TextBlock
|
||||
Margin="15,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text="{Binding DialogResultText}" />
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="Terms of Use ContentDialog example">
|
||||
<Button Command="{Binding ShowSignInContentDialogCommand}" Content="Show" />
|
||||
</GroupBox>
|
||||
<GroupBox Header="Standard MessageBox.">
|
||||
<Button
|
||||
Command="{Binding ViewModel.OpenStandardMessageBoxCommand, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type pages:DialogsAndFlyoutsPage}, Mode=FindAncestor}}"
|
||||
CommandParameter="{Binding Mode=OneWay, RelativeSource={RelativeSource Mode=Self}}"
|
||||
Content="Open standard MessageBox" />
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="WPF UI MessageBox.">
|
||||
<Button
|
||||
Command="{Binding ViewModel.OpenCustomMessageBoxCommand, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type pages:DialogsAndFlyoutsPage}, Mode=FindAncestor}}"
|
||||
CommandParameter="{Binding Mode=OneWay, RelativeSource={RelativeSource Mode=Self}}"
|
||||
Content="Open custom MessageBox" />
|
||||
</GroupBox>
|
||||
<GroupBox Header="Global WPF UI Snackbar inside NavigationView content.">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button
|
||||
Grid.Column="0"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding ViewModel.OpenSnackbarCommand, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type pages:DialogsAndFlyoutsPage}, Mode=FindAncestor}}"
|
||||
CommandParameter="{Binding Mode=OneWay, RelativeSource={RelativeSource Mode=Self}}"
|
||||
Content="Show snackbar" />
|
||||
<Grid Grid.Column="1" VerticalAlignment="Center">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<ComboBox
|
||||
Grid.Row="0"
|
||||
MinWidth="140"
|
||||
Margin="0,8,0,0"
|
||||
VerticalAlignment="Center"
|
||||
SelectedIndex="{Binding ViewModel.SnackbarAppearanceComboBoxSelectedIndex, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type pages:DialogsAndFlyoutsPage}, Mode=FindAncestor}}">
|
||||
<ComboBoxItem Content="Primary" />
|
||||
<ComboBoxItem Content="Secondary" />
|
||||
<ComboBoxItem Content="Info" />
|
||||
<ComboBoxItem Content="Success" />
|
||||
<ComboBoxItem Content="Caution" />
|
||||
<ComboBoxItem Content="Danger" />
|
||||
<ComboBoxItem Content="Light" />
|
||||
<ComboBoxItem Content="Dark" />
|
||||
<ComboBoxItem Content="Transparent" />
|
||||
</ComboBox>
|
||||
<Label
|
||||
Grid.Row="1"
|
||||
Margin="0,6,0,0"
|
||||
Content="Timeout:" />
|
||||
<Slider
|
||||
Grid.Row="2"
|
||||
Value="{Binding ViewModel.SnackbarTimeout, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type pages:DialogsAndFlyoutsPage}, Mode=FindAncestor}}"
|
||||
AutoToolTipPlacement="BottomRight"
|
||||
AutoToolTipPrecision="0"
|
||||
IsSnapToTickEnabled="True"
|
||||
Maximum="5"
|
||||
Minimum="1"
|
||||
TickFrequency="1"
|
||||
TickPlacement="BottomRight" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<!--<controls:GalleryNavigationPresenter
|
||||
Grid.Row="1"
|
||||
Margin="0, 10"
|
||||
ItemsSource="{Binding ViewModel.NavigationCards, Mode=OneWay}" />-->
|
||||
</ui:StackPanel>
|
||||
</Page>
|
||||
@@ -1,23 +0,0 @@
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
|
||||
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
|
||||
// All Rights Reserved.
|
||||
|
||||
|
||||
|
||||
using DialogsAndFlyoutsViewModel = WPFluent.Gallery.ViewModels.Pages.DialogsAndFlyoutsViewModel;
|
||||
|
||||
namespace WPFluent.Gallery.Views.Pages;
|
||||
|
||||
public partial class DialogsAndFlyoutsPage
|
||||
{
|
||||
public DialogsAndFlyoutsViewModel ViewModel { get; }
|
||||
|
||||
public DialogsAndFlyoutsPage()
|
||||
{
|
||||
ViewModel = new();
|
||||
DataContext = ViewModel;
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,17 @@
|
||||
<Page
|
||||
x:Class="WPFluent.Gallery.Views.Pages.LayoutPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:WPFluent.Gallery.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:models="clr-namespace:WPFluent.Gallery.Models"
|
||||
xmlns:pages="clr-namespace:WPFluent.Gallery.Views.Pages"
|
||||
xmlns:ui="https://github.com/ShrlAlgo/WPFluent" xmlns:pages1="clr-namespace:WPFluent.Gallery.ViewModels.Pages"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance pages:LayoutPage,
|
||||
IsDesignTimeCreatable=False}"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Title="DialogsAndFlyoutsPage">
|
||||
<Page x:Class="WPFluent.Gallery.Views.Pages.LayoutPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:WPFluent.Gallery.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:models="clr-namespace:WPFluent.Gallery.Models"
|
||||
xmlns:pages="clr-namespace:WPFluent.Gallery.Views.Pages"
|
||||
xmlns:pages1="clr-namespace:WPFluent.Gallery.ViewModels.Pages"
|
||||
xmlns:ui="https://github.com/ShrlAlgo/WPFluent"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance pages:LayoutPage, IsDesignTimeCreatable=False}"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Title="DialogsAndFlyoutsPage">
|
||||
|
||||
<StackPanel>
|
||||
<GroupBox Margin="0" Header="An Expander with text in the header and content areas">
|
||||
@@ -21,11 +20,10 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Expander
|
||||
Grid.Column="0"
|
||||
Content="This is in the content"
|
||||
Header="This text is in the header" />
|
||||
<!-- TODO: ExpandDirection -->
|
||||
<Expander Grid.Column="0"
|
||||
Content="This is in the content"
|
||||
Header="This text is in the header" />
|
||||
<!-- TODO: ExpandDirection -->
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
@@ -46,52 +44,45 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:TextBlock
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
FontSize="16"
|
||||
FontTypography="Body"
|
||||
Text="This is a header text" />
|
||||
<ui:ToggleSwitch
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
Grid.Column="1"
|
||||
Margin="0,0,16,0"
|
||||
OffContent="Off"
|
||||
OnContent="On" />
|
||||
<ui:TextBlock
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
FontSize="12"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
Text="This is a description text" />
|
||||
<ui:TextBlock Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
FontSize="16"
|
||||
FontTypography="Body"
|
||||
Text="This is a header text" />
|
||||
<ui:ToggleSwitch Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
Grid.Column="1"
|
||||
Margin="0,0,16,0"
|
||||
OffContent="Off"
|
||||
OnContent="On" />
|
||||
<ui:TextBlock Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
FontSize="12"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
Text="This is a description text" />
|
||||
</Grid>
|
||||
</ui:CardExpander.Header>
|
||||
<StackPanel Margin="24,0.5,24,0">
|
||||
<ui:CardControl Header="This is an item" Padding="20,10,20,10">
|
||||
<ui:ToggleSwitch
|
||||
HorizontalContentAlignment="Left"
|
||||
IsEnabled="True"
|
||||
OffContent="Off"
|
||||
OnContent="On" />
|
||||
<ui:ToggleSwitch HorizontalContentAlignment="Left"
|
||||
IsEnabled="True"
|
||||
OffContent="Off"
|
||||
OnContent="On" />
|
||||
</ui:CardControl>
|
||||
<ui:CardControl
|
||||
Margin="0,0.5,0,0"
|
||||
Icon="{ui:SymbolIcon FlashSettings24}"
|
||||
Padding="20,10,20,10">
|
||||
<ui:CardControl Margin="0,0.5,0,0"
|
||||
Icon="{ui:SymbolIcon FlashSettings24}"
|
||||
Padding="20,10,20,10">
|
||||
<ui:CardControl.Header>
|
||||
<StackPanel>
|
||||
<ui:TextBlock
|
||||
Margin="0"
|
||||
FontTypography="BodyStrong"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Text="This is a header text"
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
<ui:TextBlock
|
||||
Appearance="Secondary"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
Text="This is a description text."
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
<ui:TextBlock Margin="0"
|
||||
FontTypography="BodyStrong"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Text="This is a header text"
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
<ui:TextBlock Appearance="Secondary"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
Text="This is a description text."
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
</StackPanel>
|
||||
</ui:CardControl.Header>
|
||||
<ui:DropDownButton Content="Hello" Icon="{ui:SymbolIcon Fluent24}">
|
||||
@@ -108,7 +99,7 @@
|
||||
</ui:CardControl>
|
||||
</StackPanel>
|
||||
</ui:CardExpander>
|
||||
<!-- TODO: ExpandDirection -->
|
||||
<!-- TODO: ExpandDirection -->
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="A card control with a header and a button.">
|
||||
@@ -131,30 +122,26 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:CardControl
|
||||
Margin="4"
|
||||
Icon="{ui:SymbolIcon FlashSettings24}"
|
||||
Padding="20,10,20,10">
|
||||
<ui:CardControl Margin="4"
|
||||
Icon="{ui:SymbolIcon FlashSettings24}"
|
||||
Padding="20,10,20,10">
|
||||
<ui:CardControl.Header>
|
||||
<StackPanel>
|
||||
<ui:TextBlock
|
||||
Margin="0"
|
||||
FontTypography="BodyStrong"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Text="This is the header text"
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
<ui:TextBlock
|
||||
Appearance="Secondary"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
Text="This is a description text."
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
<ui:TextBlock Margin="0"
|
||||
FontTypography="BodyStrong"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Text="This is the header text"
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
<ui:TextBlock Appearance="Secondary"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
Text="This is a description text."
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
</StackPanel>
|
||||
</ui:CardControl.Header>
|
||||
<ui:ToggleSwitch
|
||||
HorizontalContentAlignment="Left"
|
||||
IsEnabled="True"
|
||||
OffContent="Off"
|
||||
OnContent="On" />
|
||||
<ui:ToggleSwitch HorizontalContentAlignment="Left"
|
||||
IsEnabled="True"
|
||||
OffContent="Off"
|
||||
OnContent="On" />
|
||||
</ui:CardControl>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
@@ -165,23 +152,20 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:CardControl
|
||||
Margin="4"
|
||||
Icon="{ui:ImageIcon pack://application:\,\,\,/WPFluent.Gallery;component/wpfui.png}"
|
||||
Padding="20,10,20,10">
|
||||
<ui:CardControl Margin="4"
|
||||
Icon="{ui:ImageIcon 'pack://application:,,,/WPFluent.Gallery;component/wpfui.png'}"
|
||||
Padding="20,10,20,10">
|
||||
<ui:CardControl.Header>
|
||||
<StackPanel>
|
||||
<ui:TextBlock
|
||||
Margin="0"
|
||||
FontTypography="BodyStrong"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Text="This is the header text"
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
<ui:TextBlock
|
||||
Appearance="Secondary"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
Text="This is a description text."
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
<ui:TextBlock Margin="0"
|
||||
FontTypography="BodyStrong"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Text="This is the header text"
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
<ui:TextBlock Appearance="Secondary"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
Text="This is a description text."
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
</StackPanel>
|
||||
</ui:CardControl.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
@@ -199,7 +183,7 @@
|
||||
选择剖面框
|
||||
<ui:DropDownButton.Flyout>
|
||||
<ContextMenu>
|
||||
<MenuItem d:DataContext="{d:DesignInstance Type=pages1:LayoutViewModel}" Command="{Binding ShowDialogCommand}" Header="选择剖面框" />
|
||||
<MenuItem Command="{Binding ShowDialogCommand}" Header="选择剖面框" />
|
||||
<MenuItem Header="框选剖面框" />
|
||||
</ContextMenu>
|
||||
</ui:DropDownButton.Flyout>
|
||||
@@ -214,14 +198,13 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:CardAction Grid.Column="0" Icon="{ui:ImageIcon pack://application:\,\,\,/WPFluent.Gallery;component/wpfui.png}">
|
||||
<ui:CardAction Grid.Column="0" Icon="{ui:ImageIcon 'pack://application:,,,/WPFluent.Gallery;component/wpfui.png'}">
|
||||
<StackPanel>
|
||||
<ui:TextBlock
|
||||
Margin="0"
|
||||
FontTypography="Body"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Text="This is the header text"
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
<ui:TextBlock Margin="0"
|
||||
FontTypography="Body"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Text="This is the header text"
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
</StackPanel>
|
||||
</ui:CardAction>
|
||||
</Grid>
|
||||
@@ -232,19 +215,19 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:CardAction Grid.Column="0" Icon="{ui:SymbolIcon DocumentEdit20, FontSize=43, Filled=False}">
|
||||
<ui:CardAction Grid.Column="0" Icon="{ui:SymbolIcon DocumentEdit20,
|
||||
FontSize=43,
|
||||
Filled=False}">
|
||||
<StackPanel>
|
||||
<ui:TextBlock
|
||||
Margin="0"
|
||||
FontTypography="BodyStrong"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Text="This is the header text"
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
<ui:TextBlock
|
||||
Appearance="Secondary"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
Text="This is a description text."
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
<ui:TextBlock Margin="0"
|
||||
FontTypography="BodyStrong"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Text="This is the header text"
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
<ui:TextBlock Appearance="Secondary"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
Text="This is a description text."
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
</StackPanel>
|
||||
</ui:CardAction>
|
||||
</Grid>
|
||||
|
||||
@@ -1,22 +1,10 @@
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
|
||||
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
|
||||
// All Rights Reserved.
|
||||
|
||||
|
||||
using LayoutViewModel = WPFluent.Gallery.ViewModels.Pages.LayoutViewModel;
|
||||
|
||||
namespace WPFluent.Gallery.Views.Pages;
|
||||
namespace WPFluent.Gallery.Views.Pages;
|
||||
|
||||
public partial class LayoutPage
|
||||
{
|
||||
public LayoutViewModel ViewModel { get; }
|
||||
|
||||
public LayoutPage()
|
||||
{
|
||||
ViewModel = new();
|
||||
DataContext = ViewModel;
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
<Page
|
||||
x:Class="WPFluent.Gallery.Views.Pages.MediaPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:WPFluent.Gallery.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:models="clr-namespace:WPFluent.Gallery.Models"
|
||||
xmlns:pages="clr-namespace:WPFluent.Gallery.Views.Pages"
|
||||
xmlns:ui="https://github.com/ShrlAlgo/WPFluent"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance pages:MediaPage,
|
||||
IsDesignTimeCreatable=False}"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Title="MediaPage"
|
||||
|
||||
>
|
||||
|
||||
<ui:StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<Image
|
||||
Height="200"
|
||||
HorizontalAlignment="Left"
|
||||
Source="pack://application:,,,/WPFluent.Gallery;component/Assets/pexels-johannes-plenio-1103970.jpg" />
|
||||
<ui:Image
|
||||
Height="200"
|
||||
HorizontalAlignment="Left"
|
||||
BorderBrush="#33000000"
|
||||
BorderThickness="2"
|
||||
CornerRadius="4"
|
||||
Source="pack://application:,,,/WPFluent.Gallery;component/Assets/pexels-johannes-plenio-1103970.jpg" />
|
||||
</ui:StackPanel>
|
||||
</Page>
|
||||
@@ -1,15 +0,0 @@
|
||||
|
||||
|
||||
using MediaViewModel = WPFluent.Gallery.ViewModels.Pages.MediaViewModel;
|
||||
|
||||
namespace WPFluent.Gallery.Views.Pages;
|
||||
|
||||
public partial class MediaPage
|
||||
{
|
||||
public MediaPage()
|
||||
{
|
||||
DataContext = new MediaViewModel();
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,9 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:models="clr-namespace:WPFluent.Gallery.Models"
|
||||
xmlns:ui="https://github.com/ShrlAlgo/WPFluent"
|
||||
xmlns:vm="clr-namespace:WPFluent.Gallery.ViewModels.Pages.Navigation"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance local:NavigationPage,
|
||||
d:DataContext="{d:DesignInstance vm:BreadcrumbBarViewModel,
|
||||
IsDesignTimeCreatable=False}"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Title="NavigationPage"
|
||||
@@ -98,12 +99,7 @@
|
||||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
<Button
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Content="Navigate to the first page"
|
||||
FontSize="24" />
|
||||
<ui:BreadcrumbBar ItemsSource="{Binding ViewModel.Strings, Mode=OneWay}" />
|
||||
<ui:BreadcrumbBar ItemsSource="{Binding Strings, Mode=OneWay}" />
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
@@ -112,8 +108,8 @@
|
||||
<ui:BreadcrumbBar
|
||||
x:Name="BreadcrumbBar2"
|
||||
Grid.Column="0"
|
||||
Command="{Binding ViewModel.FolderSelectedCommand, Mode=OneWay}"
|
||||
ItemsSource="{Binding ViewModel.Folders, Mode=OneWay}">
|
||||
Command="{Binding FolderSelectedCommand, Mode=OneWay}"
|
||||
ItemsSource="{Binding Folders, Mode=OneWay}">
|
||||
<ui:BreadcrumbBar.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type models:Folder}">
|
||||
<TextBlock Text="{Binding Name, Mode=OneTime}" />
|
||||
@@ -122,7 +118,7 @@
|
||||
</ui:BreadcrumbBar>
|
||||
<Button
|
||||
Grid.Column="1"
|
||||
Command="{Binding ViewModel.ResetFoldersCommand, Mode=OneWay}"
|
||||
Command="{Binding ResetFoldersCommand, Mode=OneWay}"
|
||||
Content="Reset" />
|
||||
</Grid>
|
||||
</ui:StackPanel>
|
||||
|
||||
@@ -1,22 +1,12 @@
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
|
||||
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
|
||||
// All Rights Reserved.
|
||||
|
||||
using WPFluent.Controls;
|
||||
|
||||
using WPFluent.Gallery.ViewModels.Pages.Navigation;
|
||||
using WPFluent.Gallery.ViewModels.Pages.Navigation;
|
||||
|
||||
namespace WPFluent.Gallery.Views.Pages.Navigation;
|
||||
|
||||
public partial class NavigationPage
|
||||
{
|
||||
public NavigationViewModel ViewModel { get; }
|
||||
|
||||
public NavigationPage()
|
||||
{
|
||||
ViewModel = new NavigationViewModel();
|
||||
DataContext = ViewModel;
|
||||
DataContext = new BreadcrumbBarViewModel();
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
|
||||
@@ -1,56 +1,51 @@
|
||||
<Page
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
d:DataContext="{d:DesignInstance pages:OpSystemPage,
|
||||
IsDesignTimeCreatable=False}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d"
|
||||
|
||||
|
||||
x:Class="WPFluent.Gallery.Views.Pages.OpSystemPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:WPFluent.Gallery.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:pages="clr-namespace:WPFluent.Gallery.Views.Pages"
|
||||
xmlns:ui="https://github.com/ShrlAlgo/WPFluent"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
xmlns:vm="clr-namespace:WPFluent.Gallery.ViewModels.Pages"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance vm:OpSystemViewModel,
|
||||
IsDesignTimeCreatable=False}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}">
|
||||
|
||||
<ui:StackPanel Spacing="5">
|
||||
<GroupBox
|
||||
Header="Copy text to the clipboard"
|
||||
Margin="0">
|
||||
<GroupBox Margin="0" Header="Copy text to the clipboard">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0" >
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:Button
|
||||
Command="{Binding ViewModel.CopyTextToClipboardCommand}"
|
||||
Content="Copy Text to the Clipboard"
|
||||
Grid.Column="0" />
|
||||
Grid.Column="0"
|
||||
Command="{Binding CopyTextToClipboardCommand}"
|
||||
Content="Copy Text to the Clipboard" />
|
||||
<ui:TextBlock
|
||||
Grid.Column="1"
|
||||
Margin="8,0,0,0"
|
||||
Text="Text copied to clipboard!"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="{Binding ViewModel.TextCopiedVisibility}" />
|
||||
Grid.Column="1"
|
||||
Margin="8,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="Text copied to clipboard!"
|
||||
Visibility="{Binding TextCopiedVisibility}" />
|
||||
</Grid>
|
||||
<ui:TextBox
|
||||
Grid.Row="1"
|
||||
MinLines="4"
|
||||
Text="{Binding ViewModel.TextToCopy}" />
|
||||
Grid.Row="1"
|
||||
MinLines="4"
|
||||
Text="{Binding TextToCopy}" />
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox
|
||||
Header="Paste text from the clipboard"
|
||||
>
|
||||
<GroupBox Header="Paste text from the clipboard">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
@@ -58,121 +53,111 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<ui:Button
|
||||
Command="{Binding ViewModel.ParseTextFromClipboardCommand}"
|
||||
Content="Paste Text from the Clipboard"
|
||||
Grid.Row="0"
|
||||
Margin="0,0,0,16" />
|
||||
Grid.Row="0"
|
||||
Margin="0,0,0,16"
|
||||
Command="{Binding ParseTextFromClipboardCommand}"
|
||||
Content="Paste Text from the Clipboard" />
|
||||
<ui:TextBlock
|
||||
Grid.Row="1"
|
||||
Text="Clipboard:"
|
||||
TextDecorations="Underline" />
|
||||
<ui:TextBlock Grid.Row="2" Text="{Binding ViewModel.ClipboardContent}" />
|
||||
Grid.Row="1"
|
||||
Text="Clipboard:"
|
||||
TextDecorations="Underline" />
|
||||
<ui:TextBlock Grid.Row="2" Text="{Binding ClipboardContent}" />
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox
|
||||
Header="Pick a single file"
|
||||
Margin="0">
|
||||
<GroupBox Margin="0" Header="Pick a single file">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:Button
|
||||
Command="{Binding ViewModel.OpenFileCommand}"
|
||||
Content="Open a file"
|
||||
Grid.Column="0" />
|
||||
Grid.Column="0"
|
||||
Command="{Binding OpenFileCommand}"
|
||||
Content="Open a file" />
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
Margin="16,0,0,0"
|
||||
Orientation="Horizontal"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="{Binding ViewModel.OpenedFilePathVisibility}">
|
||||
Grid.Column="1"
|
||||
Margin="16,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{Binding OpenedFilePathVisibility}">
|
||||
<ui:TextBlock Text="Picked file:" />
|
||||
<ui:TextBlock
|
||||
FontTypography="BodyStrong"
|
||||
Margin="4,0,0,0"
|
||||
Text="{Binding ViewModel.OpenedFilePath}" />
|
||||
Margin="4,0,0,0"
|
||||
FontTypography="BodyStrong"
|
||||
Text="{Binding OpenedFilePath}" />
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox
|
||||
Header="Pick a specific file type"
|
||||
Margin="0,32,0,0">
|
||||
<GroupBox Margin="0,32,0,0" Header="Pick a specific file type">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:Button
|
||||
Command="{Binding ViewModel.OpenPictureCommand}"
|
||||
Content="Open a picture"
|
||||
Grid.Column="0" />
|
||||
Grid.Column="0"
|
||||
Command="{Binding OpenPictureCommand}"
|
||||
Content="Open a picture" />
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
Margin="16,0,0,0"
|
||||
Orientation="Horizontal"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="{Binding ViewModel.OpenedPicturePathVisibility}">
|
||||
Grid.Column="1"
|
||||
Margin="16,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{Binding OpenedPicturePathVisibility}">
|
||||
<ui:TextBlock Text="Picked photo:" />
|
||||
<ui:TextBlock
|
||||
FontTypography="BodyStrong"
|
||||
Margin="4,0,0,0"
|
||||
Text="{Binding ViewModel.OpenedPicturePath}" />
|
||||
Margin="4,0,0,0"
|
||||
FontTypography="BodyStrong"
|
||||
Text="{Binding OpenedPicturePath}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox
|
||||
Header="Pick multiple files"
|
||||
Margin="0,32,0,0">
|
||||
<GroupBox Margin="0,32,0,0" Header="Pick multiple files">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:Button
|
||||
Command="{Binding ViewModel.OpenMultipleCommand}"
|
||||
Content="Open multiple files"
|
||||
Grid.Column="0" />
|
||||
Grid.Column="0"
|
||||
Command="{Binding OpenMultipleCommand}"
|
||||
Content="Open multiple files" />
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
Margin="16,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="{Binding ViewModel.OpenedMultiplePathVisibility}">
|
||||
Grid.Column="1"
|
||||
Margin="16,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="{Binding OpenedMultiplePathVisibility}">
|
||||
<ui:TextBlock Text="Picked files:" />
|
||||
<ui:TextBlock FontTypography="BodyStrong" Text="{Binding ViewModel.OpenedMultiplePath}" />
|
||||
<ui:TextBlock FontTypography="BodyStrong" Text="{Binding OpenedMultiplePath}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox
|
||||
Header="Pick a folder"
|
||||
Margin="0,32,0,0">
|
||||
<GroupBox Margin="0,32,0,0" Header="Pick a folder">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:Button
|
||||
Command="{Binding ViewModel.OpenFolderCommand}"
|
||||
Content="Open a folder"
|
||||
Grid.Column="0" />
|
||||
Grid.Column="0"
|
||||
Command="{Binding OpenFolderCommand}"
|
||||
Content="Open a folder" />
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
Margin="16,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="{Binding ViewModel.OpenedFolderPathVisibility}">
|
||||
Grid.Column="1"
|
||||
Margin="16,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="{Binding OpenedFolderPathVisibility}">
|
||||
<ui:TextBlock Text="Picked folder:" />
|
||||
<ui:TextBlock FontTypography="BodyStrong" Text="{Binding ViewModel.OpenedFolderPath}" />
|
||||
<ui:TextBlock FontTypography="BodyStrong" Text="{Binding OpenedFolderPath}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox
|
||||
Header="Save a file"
|
||||
Margin="0,32,0,0">
|
||||
<GroupBox Margin="0,32,0,0" Header="Save a file">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
@@ -188,20 +173,20 @@
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:TextBlock
|
||||
Grid.Column="0"
|
||||
MinWidth="80"
|
||||
Text="File name:"
|
||||
VerticalAlignment="Center" />
|
||||
Grid.Column="0"
|
||||
MinWidth="80"
|
||||
VerticalAlignment="Center"
|
||||
Text="File name:" />
|
||||
<ui:TextBox
|
||||
Grid.Column="1"
|
||||
MinWidth="180"
|
||||
PlaceholderText="Type your file name here..."
|
||||
Text="{Binding ViewModel.FileToSaveName}" />
|
||||
Grid.Column="1"
|
||||
MinWidth="180"
|
||||
PlaceholderText="Type your file name here..."
|
||||
Text="{Binding FileToSaveName}" />
|
||||
<ui:TextBlock
|
||||
Grid.Column="2"
|
||||
Margin="4,0,0,0"
|
||||
Text=".txt"
|
||||
VerticalAlignment="Center" />
|
||||
Grid.Column="2"
|
||||
Margin="4,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text=".txt" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="2" Margin="0,8,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -209,15 +194,15 @@
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:TextBlock
|
||||
Grid.Column="0"
|
||||
MinWidth="80"
|
||||
Text="File content:"
|
||||
VerticalAlignment="Center" />
|
||||
Grid.Column="0"
|
||||
MinWidth="80"
|
||||
VerticalAlignment="Center"
|
||||
Text="File content:" />
|
||||
<ui:TextBox
|
||||
Grid.Column="1"
|
||||
MinWidth="210"
|
||||
PlaceholderText="Type your file contents here..."
|
||||
Text="{Binding ViewModel.FileToSaveContents}" />
|
||||
Grid.Column="1"
|
||||
MinWidth="210"
|
||||
PlaceholderText="Type your file contents here..."
|
||||
Text="{Binding FileToSaveContents}" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="3" Margin="0,16,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -225,15 +210,15 @@
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:Button
|
||||
Command="{Binding ViewModel.SaveFileCommand}"
|
||||
Content="Save a file"
|
||||
Grid.Column="0" />
|
||||
Grid.Column="0"
|
||||
Command="{Binding SaveFileCommand}"
|
||||
Content="Save a file" />
|
||||
<ui:TextBlock
|
||||
Grid.Column="1"
|
||||
Margin="16,0,0,0"
|
||||
Text="{Binding ViewModel.SavedFileNotice}"
|
||||
VerticalAlignment="Center"
|
||||
Visibility="{Binding ViewModel.SavedFileNoticeVisibility}" />
|
||||
Grid.Column="1"
|
||||
Margin="16,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding SavedFileNotice}"
|
||||
Visibility="{Binding SavedFileNoticeVisibility}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
@@ -6,12 +6,9 @@ namespace WPFluent.Gallery.Views.Pages;
|
||||
|
||||
public partial class OpSystemPage
|
||||
{
|
||||
public OpSystemViewModel ViewModel { get; }
|
||||
|
||||
public OpSystemPage()
|
||||
{
|
||||
ViewModel = new OpSystemViewModel();
|
||||
DataContext = ViewModel;
|
||||
DataContext = new OpSystemViewModel();
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
@@ -8,8 +8,9 @@
|
||||
xmlns:local="clr-namespace:WPFluent.Gallery.Views.Pages"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="https://github.com/ShrlAlgo/WPFluent"
|
||||
xmlns:vm="clr-namespace:WPFluent.Gallery.ViewModels.Pages"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance local:SettingsPage,
|
||||
d:DataContext="{d:DesignInstance vm:SettingsViewModel,
|
||||
IsDesignTimeCreatable=False}"
|
||||
Title="Settings Page">
|
||||
<StackPanel Margin="0,0,0,24">
|
||||
@@ -37,7 +38,7 @@
|
||||
<ComboBox
|
||||
Grid.Column="1"
|
||||
MinWidth="200"
|
||||
SelectedIndex="{Binding ViewModel.CurrentApplicationTheme, Converter={StaticResource ThemeToIndexConverter}, Mode=TwoWay}">
|
||||
SelectedIndex="{Binding CurrentApplicationTheme, Converter={StaticResource ThemeToIndexConverter}, Mode=TwoWay}">
|
||||
<ComboBoxItem Content="Light" />
|
||||
<ComboBoxItem Content="Dark" />
|
||||
</ComboBox>
|
||||
@@ -70,7 +71,7 @@
|
||||
Margin="0,0,16,0"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
|
||||
Text="{Binding ViewModel.AppVersion, Mode=OneWay}" />
|
||||
Text="{Binding AppVersion, Mode=OneWay}" />
|
||||
<ui:TextBlock
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
@@ -126,7 +127,7 @@
|
||||
<ui:SymbolIcon Grid.Column="1" Symbol="Link24" />
|
||||
</Grid>
|
||||
</ui:Anchor>
|
||||
<TextBlock Margin="16" Text="{Binding ViewModel.AppVersion, Mode=OneWay}" />
|
||||
<TextBlock Margin="16" Text="{Binding AppVersion, Mode=OneWay}" />
|
||||
</StackPanel>
|
||||
</ui:CardExpander>
|
||||
</StackPanel>
|
||||
|
||||
@@ -5,12 +5,9 @@ namespace WPFluent.Gallery.Views.Pages;
|
||||
|
||||
public partial class SettingsPage
|
||||
{
|
||||
public SettingsViewModel ViewModel { get; }
|
||||
|
||||
public SettingsPage()
|
||||
{
|
||||
ViewModel = new SettingsViewModel();
|
||||
DataContext = ViewModel;
|
||||
DataContext = new SettingsViewModel();
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
@@ -1,209 +1,150 @@
|
||||
<Page
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Title="StatusAndInfoPage"
|
||||
|
||||
d:DataContext="{d:DesignInstance pages:StatusAndInfoPage,
|
||||
IsDesignTimeCreatable=False}"
|
||||
mc:Ignorable="d"
|
||||
|
||||
|
||||
x:Class="WPFluent.Gallery.Views.Pages.StatusAndInfoPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:WPFluent.Gallery.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:models="clr-namespace:WPFluent.Gallery.Models"
|
||||
xmlns:pages="clr-namespace:WPFluent.Gallery.Views.Pages"
|
||||
xmlns:ui="https://github.com/ShrlAlgo/WPFluent"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance pages:StatusAndInfoPage,
|
||||
IsDesignTimeCreatable=False}"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Title="StatusAndInfoPage">
|
||||
|
||||
<ui:StackPanel Spacing="5">
|
||||
<GroupBox
|
||||
Header="WPF UI NavigationView."
|
||||
Padding="0">
|
||||
</GroupBox>
|
||||
<GroupBox Header="Different InfoBadge Styles" >
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<ui:InfoBadge
|
||||
CornerRadius="30"
|
||||
Icon="{ui:SymbolIcon Alert16}"
|
||||
Margin="10"
|
||||
Severity="{Binding ViewModel.InfoBadgeSeverity}"
|
||||
Style="{DynamicResource IconInfoBadgeStyle}" />
|
||||
|
||||
<ui:InfoBadge
|
||||
Margin="10"
|
||||
Severity="{Binding ViewModel.InfoBadgeSeverity}"
|
||||
Style="{DynamicResource ValueInfoBadgeStyle}"
|
||||
Value="1" />
|
||||
|
||||
<ui:InfoBadge
|
||||
Margin="10"
|
||||
Severity="{Binding ViewModel.InfoBadgeSeverity}"
|
||||
Style="{DynamicResource DotInfoBadgeStyle}"
|
||||
Value="2" />
|
||||
</WrapPanel>
|
||||
<StackPanel Grid.Column="1" Margin="12,0,0,0">
|
||||
|
||||
<ui:TextBlock Text="InfoBadge Severity" />
|
||||
<ComboBox
|
||||
Margin="0,8,0,0"
|
||||
MinWidth="140"
|
||||
SelectedIndex="{Binding ViewModel.InfoBadgeSeverityComboBoxSelectedIndex, Mode=TwoWay}">
|
||||
<ComboBoxItem Content="Attention" />
|
||||
<ComboBoxItem Content="Informational" />
|
||||
<ComboBoxItem Content="Success" />
|
||||
<ComboBoxItem Content="Caution" />
|
||||
<ComboBoxItem Content="Critical" />
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="InfoBadge with Dynamic Value" >
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:InfoBadge
|
||||
Padding="6,0"
|
||||
Severity="{Binding ViewModel.InfoBadgeSeverity}"
|
||||
Value="{Binding Value, ElementName=ValueNumberBox}" />
|
||||
<StackPanel Grid.Column="1" Margin="12,0,0,0">
|
||||
<ui:TextBlock Text="InfoBadge Value" />
|
||||
<ui:NumberBox
|
||||
Maximum="100"
|
||||
Minimum="0"
|
||||
Value="1"
|
||||
x:Name="ValueNumberBox" />
|
||||
<ui:TextBlock Text="InfoBadge Severity" />
|
||||
<ComboBox
|
||||
Margin="0,8,0,0"
|
||||
MinWidth="140"
|
||||
SelectedIndex="{Binding ViewModel.InfoBadgeSeverityComboBoxSelectedIndex, Mode=TwoWay}">
|
||||
<ComboBoxItem Content="Attention" />
|
||||
<ComboBoxItem Content="Informational" />
|
||||
<ComboBoxItem Content="Success" />
|
||||
<ComboBoxItem Content="Caution" />
|
||||
<ComboBoxItem Content="Critical" />
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="Placing an InfoBadge Inside Another">
|
||||
<Grid>
|
||||
<GroupBox Header="InfoBadge">
|
||||
<UniformGrid Rows="1">
|
||||
<ui:Button
|
||||
Height="60"
|
||||
HorizontalAlignment="Center"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
Padding="0"
|
||||
ToolTip="Refresh required"
|
||||
VerticalAlignment="Center"
|
||||
Width="200">
|
||||
Width="200"
|
||||
Height="60"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
Padding="0"
|
||||
ToolTip="Refresh required">
|
||||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<ui:InfoBadge
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,-10,5,0"
|
||||
Severity="Critical"
|
||||
Style="{DynamicResource DotInfoBadgeStyle}"
|
||||
Value="{Binding Value, ElementName=ValueNumberBox}"
|
||||
VerticalAlignment="Top" />
|
||||
Margin="0,-10,5,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Width="10"
|
||||
Height="10"
|
||||
Value="{Binding Value, ElementName=ValueNumberBox}"
|
||||
Severity="{Binding SelectedItem, ElementName=CBInfoBadgeSeverity}"
|
||||
Style="{StaticResource DotInfoBadgeStyle}" />
|
||||
<ui:SymbolIcon
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Center"
|
||||
Symbol="ArrowSync24" />
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Center"
|
||||
Symbol="ArrowSync24" />
|
||||
</Grid>
|
||||
</ui:Button>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="A closable InfoBar." >
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:InfoBar
|
||||
Grid.Column="0"
|
||||
IsOpen="{Binding ViewModel.IsShortInfoBarOpened, Mode=TwoWay}"
|
||||
Message="Essential app message."
|
||||
Severity="{Binding ViewModel.ShortInfoBarSeverity, Mode=OneWay}"
|
||||
Title="Title" />
|
||||
<Grid Grid.Column="1" Margin="12,0,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<CheckBox
|
||||
Content="Is open"
|
||||
Grid.Row="0"
|
||||
IsChecked="{Binding ViewModel.IsShortInfoBarOpened, Mode=TwoWay}"
|
||||
MinWidth="0" />
|
||||
<ComboBox
|
||||
Grid.Row="1"
|
||||
Margin="0,8,0,0"
|
||||
MinWidth="140"
|
||||
SelectedIndex="{Binding ViewModel.ShortInfoBarSeverityComboBoxSelectedIndex, Mode=TwoWay}">
|
||||
<ComboBoxItem Content="Informational" />
|
||||
<ComboBoxItem Content="Success" />
|
||||
<ComboBoxItem Content="Warning" />
|
||||
<ComboBoxItem Content="Error" />
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<ui:InfoBadge
|
||||
Margin="10"
|
||||
CornerRadius="30"
|
||||
Icon="{ui:SymbolIcon Alert16}"
|
||||
Severity="{Binding SelectedItem, ElementName=CBInfoBadgeSeverity}"
|
||||
Style="{StaticResource IconInfoBadgeStyle}" />
|
||||
|
||||
<GroupBox Header="A closable InfoBar with a long message." >
|
||||
<ui:InfoBadge
|
||||
Value="{Binding Value, ElementName=ValueNumberBox}"
|
||||
Padding="6,0"
|
||||
Severity="{Binding SelectedItem, ElementName=CBInfoBadgeSeverity}" />
|
||||
|
||||
<ui:InfoBadge
|
||||
Margin="10"
|
||||
Value="2"
|
||||
Severity="{Binding SelectedItem, ElementName=CBInfoBadgeSeverity}"
|
||||
Style="{StaticResource DotInfoBadgeStyle}" />
|
||||
</WrapPanel>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Grid.Column="1" Margin="12,0,0,0">
|
||||
<ui:TextBlock Text="InfoBadge Value" />
|
||||
<ui:NumberBox
|
||||
x:Name="ValueNumberBox"
|
||||
Value="1"
|
||||
Maximum="100"
|
||||
Minimum="0" />
|
||||
<ui:TextBlock Text="InfoBadge Severity" />
|
||||
<ComboBox
|
||||
x:Name="CBInfoBadgeSeverity"
|
||||
MinWidth="140"
|
||||
Margin="0,8,0,0"
|
||||
SelectedIndex="0">
|
||||
<ComboBox.ItemsSource>
|
||||
<x:Array Type="{x:Type ui:InfoBadgeSeverity}">
|
||||
<ui:InfoBadgeSeverity>Attention</ui:InfoBadgeSeverity>
|
||||
<ui:InfoBadgeSeverity>Success</ui:InfoBadgeSeverity>
|
||||
<ui:InfoBadgeSeverity>Caution</ui:InfoBadgeSeverity>
|
||||
<ui:InfoBadgeSeverity>Critical</ui:InfoBadgeSeverity>
|
||||
</x:Array>
|
||||
</ComboBox.ItemsSource>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="InfoBar">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:InfoBar
|
||||
Grid.Column="0"
|
||||
IsOpen="{Binding ViewModel.IsLongInfoBarOpened, Mode=TwoWay}"
|
||||
Message="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
|
||||
Severity="{Binding ViewModel.LongInfoBarSeverity, Mode=OneWay}"
|
||||
Title="Title" />
|
||||
Grid.Column="0"
|
||||
IsOpen="{Binding ElementName=CBOpen,Path=IsChecked, Mode=TwoWay}"
|
||||
Message="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
|
||||
Severity="{Binding ElementName=CBInfoBarSeverity,Path=SelectedItem, Mode=OneWay}"
|
||||
Title="Title" />
|
||||
<Grid Grid.Column="1" Margin="12,0,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<CheckBox
|
||||
Content="Is open"
|
||||
Grid.Row="0"
|
||||
IsChecked="{Binding ViewModel.IsLongInfoBarOpened, Mode=TwoWay}"
|
||||
MinWidth="0" />
|
||||
x:Name="CBOpen"
|
||||
Grid.Row="0"
|
||||
MinWidth="0"
|
||||
Content="Is open"
|
||||
IsChecked="True" />
|
||||
<ComboBox
|
||||
Grid.Row="1"
|
||||
Margin="0,8,0,0"
|
||||
MinWidth="140"
|
||||
SelectedIndex="{Binding ViewModel.LongInfoBarSeverityComboBoxSelectedIndex, Mode=TwoWay}">
|
||||
<ComboBoxItem Content="Informational" />
|
||||
<ComboBoxItem Content="Success" />
|
||||
<ComboBoxItem Content="Warning" />
|
||||
<ComboBoxItem Content="Error" />
|
||||
x:Name="CBInfoBarSeverity"
|
||||
Grid.Row="1"
|
||||
MinWidth="140"
|
||||
Margin="0,8,0,0"
|
||||
SelectedIndex="0">
|
||||
<ComboBox.ItemsSource>
|
||||
<x:Array Type="{x:Type ui:InfoBarSeverity}">
|
||||
<ui:InfoBarSeverity>Attention</ui:InfoBarSeverity>
|
||||
<ui:InfoBarSeverity>Success</ui:InfoBarSeverity>
|
||||
<ui:InfoBarSeverity>Caution</ui:InfoBarSeverity>
|
||||
<ui:InfoBarSeverity>Critical</ui:InfoBarSeverity>
|
||||
</x:Array>
|
||||
</ComboBox.ItemsSource>
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="An indeterminate progress bar." >
|
||||
<ProgressBar IsIndeterminate="True" Margin="24" />
|
||||
<GroupBox Header="Progress">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ProgressBar Margin="24" IsIndeterminate="True" />
|
||||
<ui:ProgressRing IsIndeterminate="True" />
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Header="An indeterminate WPF UI progress ring." >
|
||||
<ui:ProgressRing IsIndeterminate="True" />
|
||||
</GroupBox>
|
||||
<GroupBox Header="A button with a simple ToolTip." >
|
||||
<GroupBox Header="ToolTip">
|
||||
<Button
|
||||
Content="Button with a simple ToolTip."
|
||||
ToolTipService.InitialShowDelay="100"
|
||||
ToolTipService.Placement="MousePoint"
|
||||
ToolTipService.ToolTip="Simple ToolTip" />
|
||||
Content="带提示的按钮"
|
||||
ToolTipService.InitialShowDelay="100"
|
||||
ToolTipService.Placement="MousePoint"
|
||||
ToolTipService.ToolTip="简单提示" />
|
||||
</GroupBox>
|
||||
<!--<controls:GalleryNavigationPresenter
|
||||
Grid.Row="1"
|
||||
|
||||
@@ -1,26 +1,12 @@
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
|
||||
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
|
||||
// All Rights Reserved.
|
||||
|
||||
|
||||
|
||||
using WPFluent.Gallery.ViewModels;
|
||||
|
||||
using StatusAndInfoViewModel = WPFluent.Gallery.ViewModels.Pages.StatusAndInfoViewModel;
|
||||
|
||||
using WPFluent.Gallery.ViewModels.Pages;
|
||||
|
||||
namespace WPFluent.Gallery.Views.Pages;
|
||||
|
||||
public partial class StatusAndInfoPage
|
||||
{
|
||||
|
||||
public StatusAndInfoViewModel ViewModel { get; }
|
||||
|
||||
public StatusAndInfoPage()
|
||||
{
|
||||
ViewModel = new StatusAndInfoViewModel();
|
||||
DataContext = ViewModel;
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,9 @@
|
||||
xmlns:models="clr-namespace:WPFluent.Gallery.Models"
|
||||
xmlns:pages="clr-namespace:WPFluent.Gallery.ViewModels.Pages"
|
||||
xmlns:ui="https://github.com/ShrlAlgo/WPFluent"
|
||||
xmlns:vm="clr-namespace:WPFluent.Gallery.ViewModels.Pages"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance Type=pages:TextViewModel}"
|
||||
d:DataContext="{d:DesignInstance Type=vm:TextViewModel}"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
Title="TextPage">
|
||||
|
||||
@@ -69,9 +70,7 @@
|
||||
HeaderPlacement="Left"
|
||||
PlaceholderText="文本框"
|
||||
Prefix="前缀:"
|
||||
Suffix="后缀"
|
||||
Text="{Binding Number, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
Suffix="后缀" />
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Header="TextBox(多行)">
|
||||
|
||||
@@ -1,52 +1,59 @@
|
||||
<ui:FluentWindow
|
||||
x:Class="WPFluent.Gallery.Views.Windows.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:WPFluent.Gallery.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WPFluent.Gallery.Views.Windows"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:tray="https://github.com/ShrlAlgo/WPFluent/tray"
|
||||
xmlns:ui="https://github.com/ShrlAlgo/WPFluent"
|
||||
Width="1450"
|
||||
Height="800"
|
||||
MinWidth="900"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance local:MainWindow,
|
||||
IsDesignTimeCreatable=False}"
|
||||
d:DesignHeight="650"
|
||||
d:DesignWidth="1000"
|
||||
ExtendsContentIntoTitleBar="True"
|
||||
Title="{Binding ViewModel.ApplicationTitle, Mode=OneWay}"
|
||||
|
||||
|
||||
WindowBackdropType="Mica"
|
||||
WindowCornerPreference="Default"
|
||||
WindowStartupLocation="CenterScreen">
|
||||
<!--<ui:FluentWindow.InputBindings>
|
||||
<ui:FluentWindow x:Class="WPFluent.Gallery.Views.Windows.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:WPFluent.Gallery.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WPFluent.Gallery.Views.Windows"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:tray="https://github.com/ShrlAlgo/WPFluent/tray"
|
||||
xmlns:ui="https://github.com/ShrlAlgo/WPFluent"
|
||||
xmlns:windows="clr-namespace:WPFluent.Gallery.ViewModels.Windows"
|
||||
Width="1450"
|
||||
Height="800"
|
||||
MinWidth="900"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance windows:MainWindowViewModel, IsDesignTimeCreatable=False}"
|
||||
d:DesignHeight="650"
|
||||
d:DesignWidth="1000"
|
||||
ExtendsContentIntoTitleBar="True"
|
||||
Title="{Binding ApplicationTitle, Mode=OneWay}"
|
||||
ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}"
|
||||
ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
WindowBackdropType="Mica"
|
||||
WindowCornerPreference="Default"
|
||||
WindowStartupLocation="CenterScreen">
|
||||
<!-- <ui:FluentWindow.InputBindings>
|
||||
<KeyBinding
|
||||
Key="F"
|
||||
Command="{Binding ElementName=AutoSuggestBox, Path=FocusCommand}"
|
||||
Modifiers="Control" />
|
||||
</ui:FluentWindow.InputBindings>-->
|
||||
<!--<ui:FluentWindow.Resources>
|
||||
</ui:FluentWindow.InputBindings> -->
|
||||
<!--<ui:FluentWindow.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ui:ThemesDictionary Theme="Light" />
|
||||
<ui:ThemesDictionary Theme="Dark" />
|
||||
<ui:ControlsDictionary />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</ui:FluentWindow.Resources>-->
|
||||
<DockPanel>
|
||||
<ui:TitleBar
|
||||
x:Name="TitleBar"
|
||||
CloseWindowByDoubleClickOnIcon="True"
|
||||
DockPanel.Dock="Top" Title="{Binding ViewModel.ApplicationTitle, Mode=OneWay}">
|
||||
</ui:FluentWindow.Resources>-->
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<ui:TitleBar x:Name="TitleBar"
|
||||
CloseWindowByDoubleClickOnIcon="True"
|
||||
DockPanel.Dock="Top"
|
||||
HelpClicked="TitleBar_HelpClicked"
|
||||
ShowHelp="True"
|
||||
Title="MainWindow">
|
||||
<ui:TitleBar.Icon>
|
||||
<ui:ImageIcon Source="pack://application:,,,/WPFluent.Gallery;component/wpfui.png" />
|
||||
</ui:TitleBar.Icon>
|
||||
</ui:TitleBar>
|
||||
<TabControl x:Name="NavigationView" Margin="5">
|
||||
<TabControl x:Name="NavigationView"
|
||||
Grid.Row="1"
|
||||
Margin="5">
|
||||
<TabItem Header="Icons">
|
||||
<Frame Source="pack://application:,,,/WPFluent.Gallery;component/Views/Pages/DesignGuidance/IconsPage.xaml" />
|
||||
</TabItem>
|
||||
@@ -77,22 +84,11 @@
|
||||
<Frame Source="pack://application:,,,/WPFluent.Gallery;component/Views/Pages/DateAndTimePage.xaml" />
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
|
||||
<TabItem Header="DialogsAndFlyouts">
|
||||
<ScrollViewer>
|
||||
<Frame Source="pack://application:,,,/WPFluent.Gallery;component/Views/Pages/DialogsAndFlyoutsPage.xaml" />
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
<TabItem Header="Layout">
|
||||
<ScrollViewer>
|
||||
<Frame Source="pack://application:,,,/WPFluent.Gallery;component/Views/Pages/LayoutPage.xaml" />
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
<TabItem Header="Media">
|
||||
<ScrollViewer>
|
||||
<Frame Source="pack://application:,,,/WPFluent.Gallery;component/Views/Pages/MediaPage.xaml" />
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
<TabItem Header="Navigation">
|
||||
<ScrollViewer>
|
||||
<Frame Source="pack://application:,,,/WPFluent.Gallery;component/Views/Pages/NavigationPage.xaml" />
|
||||
@@ -119,8 +115,5 @@
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
<!--<ContentPresenter x:Name="RootContentDialog" Grid.Row="0" />-->
|
||||
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</ui:FluentWindow>
|
||||
@@ -1,8 +1,4 @@
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
|
||||
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
|
||||
// All Rights Reserved.
|
||||
|
||||
using WPFluent.Appearance;
|
||||
using WPFluent.Gallery.ViewModels.Windows;
|
||||
|
||||
namespace WPFluent.Gallery.Views.Windows;
|
||||
@@ -16,4 +12,12 @@ public partial class MainWindow
|
||||
InitializeComponent();
|
||||
}
|
||||
public MainWindowViewModel ViewModel { get; }
|
||||
|
||||
private void TitleBar_HelpClicked(TitleBar sender, RoutedEventArgs args)
|
||||
{
|
||||
var theme = ThemeManager.GetAppTheme();
|
||||
ThemeManager.ChangeAppTheme(theme
|
||||
== ThemeType.Light ? ThemeType.Dark : ThemeType.Light);
|
||||
//var res = Application.Current.Resources;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user