This commit is contained in:
ShrlAlgo
2025-07-11 09:20:23 +08:00
parent c7b104f44f
commit 4d35cadb56
840 changed files with 102347 additions and 11595 deletions

View File

@@ -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>