mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-03-03 00:00:55 +08:00
misc: format code for consistency and readability.
This commit is contained in:
@@ -2,10 +2,8 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
using Avalonia.Platform.Storage;
|
using Avalonia.Platform.Storage;
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
using CommunityToolkit.Mvvm.Input;
|
using CommunityToolkit.Mvvm.Input;
|
||||||
@@ -31,7 +29,7 @@ public partial class AboutUs : UserControl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public partial class AboutUsViewModel: ObservableObject
|
public partial class AboutUsViewModel : ObservableObject
|
||||||
{
|
{
|
||||||
public ICommand NavigateCommand { get; set; }
|
public ICommand NavigateCommand { get; set; }
|
||||||
|
|
||||||
@@ -55,6 +53,5 @@ public partial class AboutUsViewModel: ObservableObject
|
|||||||
{
|
{
|
||||||
await Launcher.LaunchUriAsync(new Uri(uri));
|
await Launcher.LaunchUriAsync(new Uri(uri));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
using System.Collections.ObjectModel;
|
|
||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using Avalonia.Controls;
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
@@ -16,14 +14,13 @@ public partial class AutoCompleteBoxDemo : UserControl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AutoCompleteBoxDemoViewModel: ObservableObject
|
public class AutoCompleteBoxDemoViewModel : ObservableObject
|
||||||
{
|
{
|
||||||
public ObservableCollection<StateData> States { get; set; }
|
public ObservableCollection<StateData> States { get; set; }
|
||||||
|
|
||||||
public AutoCompleteBoxDemoViewModel()
|
public AutoCompleteBoxDemoViewModel()
|
||||||
{
|
{
|
||||||
States = new ObservableCollection<StateData>(GetStates());
|
States = new ObservableCollection<StateData>(GetStates());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<StateData> GetStates()
|
private static List<StateData> GetStates()
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -112,14 +112,14 @@
|
|||||||
IsEnabled="False" />
|
IsEnabled="False" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||||
<DropDownButton Content="Default" Classes="Success"/>
|
<DropDownButton Content="Default" Classes="Success" />
|
||||||
<DropDownButton Content="Solid" Theme="{DynamicResource SolidDropDownButton}" Classes="Success"/>
|
<DropDownButton Content="Solid" Theme="{DynamicResource SolidDropDownButton}" Classes="Success" />
|
||||||
<DropDownButton Content="Outline" Theme="{DynamicResource OutlineDropDownButton}" Classes="Success"/>
|
<DropDownButton Content="Outline" Theme="{DynamicResource OutlineDropDownButton}" Classes="Success" />
|
||||||
<DropDownButton Content="Borderless" Theme="{DynamicResource BorderlessDropDownButton}" Classes="Success"/>
|
<DropDownButton Content="Borderless" Theme="{DynamicResource BorderlessDropDownButton}" Classes="Success" />
|
||||||
<DropDownButton Content="Default" Classes="Success" IsEnabled="False"/>
|
<DropDownButton Content="Default" Classes="Success" IsEnabled="False" />
|
||||||
<DropDownButton Content="Solid" Theme="{DynamicResource SolidDropDownButton}" Classes="Success" IsEnabled="False"/>
|
<DropDownButton Content="Solid" Theme="{DynamicResource SolidDropDownButton}" Classes="Success" IsEnabled="False" />
|
||||||
<DropDownButton Content="Outline" Theme="{DynamicResource OutlineDropDownButton}" Classes="Success" IsEnabled="False"/>
|
<DropDownButton Content="Outline" Theme="{DynamicResource OutlineDropDownButton}" Classes="Success" IsEnabled="False" />
|
||||||
<DropDownButton Content="Borderless" Theme="{DynamicResource BorderlessDropDownButton}" Classes="Success" IsEnabled="False"/>
|
<DropDownButton Content="Borderless" Theme="{DynamicResource BorderlessDropDownButton}" Classes="Success" IsEnabled="False" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||||
<DropDownButton Classes="Small" Content="Small" />
|
<DropDownButton Classes="Small" Content="Small" />
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||||
<SplitButton Content="Default" Classes="Success" />
|
<SplitButton Content="Default" Classes="Success" />
|
||||||
<SplitButton Content="Solid" Theme="{DynamicResource SolidSplitButton}" Classes="Success" />
|
<SplitButton Content="Solid" Theme="{DynamicResource SolidSplitButton}" Classes="Success" />
|
||||||
<SplitButton Content="Outline" Theme="{DynamicResource OutlineSplitButton}" Classes="Success" />
|
<SplitButton Content="Outline" Theme="{DynamicResource OutlineSplitButton}" Classes="Success" />
|
||||||
<SplitButton Content="Borderless" Theme="{DynamicResource BorderlessSplitButton}" Classes="Success" />
|
<SplitButton Content="Borderless" Theme="{DynamicResource BorderlessSplitButton}" Classes="Success" />
|
||||||
<SplitButton Content="Default" Classes="Success" IsEnabled="False" />
|
<SplitButton Content="Default" Classes="Success" IsEnabled="False" />
|
||||||
@@ -165,7 +165,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||||
<ToggleSplitButton Content="Default" Classes="Success" />
|
<ToggleSplitButton Content="Default" Classes="Success" />
|
||||||
<ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" />
|
<ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" />
|
||||||
<ToggleSplitButton Content="Default" Classes="Success" IsEnabled="False" />
|
<ToggleSplitButton Content="Default" Classes="Success" IsEnabled="False" />
|
||||||
<ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" IsEnabled="False" />
|
<ToggleSplitButton Content="Checked" Classes="Success" IsChecked="True" IsEnabled="False" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -31,7 +29,6 @@ public partial class ButtonSpinnerDemo : UserControl
|
|||||||
|
|
||||||
txtBox.Text = _mountains[value];
|
txtBox.Text = _mountains[value];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly string[] _mountains = new[]
|
private readonly string[] _mountains = new[]
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -10,9 +8,4 @@ public partial class CalendarDemo : UserControl
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Interactivity;
|
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -28,13 +28,13 @@
|
|||||||
<ComboBox Classes="Bordered" />
|
<ComboBox Classes="Bordered" />
|
||||||
<ComboBox Classes="Bordered" IsEnabled="False" />
|
<ComboBox Classes="Bordered" IsEnabled="False" />
|
||||||
<ComboBox>
|
<ComboBox>
|
||||||
<ComboBox.SelectionBoxItemTemplate>
|
<ComboBox.SelectionBoxItemTemplate>
|
||||||
<DataTemplate DataType="x:String">
|
<DataTemplate DataType="x:String">
|
||||||
<ContentControl BorderThickness="1"
|
<ContentControl BorderThickness="1"
|
||||||
BorderBrush="Gold"
|
BorderBrush="Gold"
|
||||||
Content="{Binding}" />
|
Content="{Binding}" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ComboBox.SelectionBoxItemTemplate>
|
</ComboBox.SelectionBoxItemTemplate>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
|
|||||||
@@ -12,54 +12,54 @@
|
|||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<TabControl>
|
<TabControl>
|
||||||
<TabItem Header="DataGrid">
|
<TabItem Header="DataGrid">
|
||||||
<Grid RowDefinitions="Auto, *">
|
<Grid RowDefinitions="Auto, *">
|
||||||
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
||||||
<ToggleSwitch Content="Enable" Name="enable" IsChecked="True" />
|
<ToggleSwitch Content="Enable" Name="enable" IsChecked="True" />
|
||||||
<ToggleSwitch Content="Inset Content" Name="inset" />
|
<ToggleSwitch Content="Inset Content" Name="inset" />
|
||||||
<ToggleSwitch Content="ScrollBar Auto Hide" Name="autohide" />
|
<ToggleSwitch Content="ScrollBar Auto Hide" Name="autohide" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<DataGrid Grid.Row="1"
|
<DataGrid Grid.Row="1"
|
||||||
Margin="8"
|
Margin="8"
|
||||||
CanUserReorderColumns="True"
|
CanUserReorderColumns="True"
|
||||||
CanUserResizeColumns="True"
|
CanUserResizeColumns="True"
|
||||||
CanUserSortColumns="True"
|
CanUserSortColumns="True"
|
||||||
HeadersVisibility="All"
|
HeadersVisibility="All"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
Classes.InsetContent="{Binding #inset.IsChecked}"
|
Classes.InsetContent="{Binding #inset.IsChecked}"
|
||||||
ScrollViewer.AllowAutoHide="{Binding #autohide.IsChecked}"
|
ScrollViewer.AllowAutoHide="{Binding #autohide.IsChecked}"
|
||||||
IsEnabled="{Binding #enable.IsChecked}"
|
IsEnabled="{Binding #enable.IsChecked}"
|
||||||
ItemsSource="{Binding GridData1}">
|
ItemsSource="{Binding GridData1}">
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
Width="6*"
|
Width="6*"
|
||||||
x:DataType="vm:Song"
|
x:DataType="vm:Song"
|
||||||
Binding="{Binding Title}"
|
Binding="{Binding Title}"
|
||||||
Header="Title" />
|
Header="Title" />
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
Width="6*"
|
Width="6*"
|
||||||
x:DataType="vm:Song"
|
x:DataType="vm:Song"
|
||||||
Binding="{Binding Artist}"
|
Binding="{Binding Artist}"
|
||||||
Header="Artist" />
|
Header="Artist" />
|
||||||
<DataGridTextColumn
|
<DataGridTextColumn
|
||||||
Width="6*"
|
Width="6*"
|
||||||
x:DataType="vm:Song"
|
x:DataType="vm:Song"
|
||||||
Binding="{Binding Album}"
|
Binding="{Binding Album}"
|
||||||
Header="Album" />
|
Header="Album" />
|
||||||
<DataGridTemplateColumn Header="Duration" SortMemberPath="Duration">
|
<DataGridTemplateColumn Header="Duration" SortMemberPath="Duration">
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="8,0,0,0"
|
Margin="8,0,0,0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Text="{Binding Duration}" />
|
Text="{Binding Duration}" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn>
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
|
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="Grouping">
|
<TabItem Header="Grouping">
|
||||||
<DataGrid
|
<DataGrid
|
||||||
|
|||||||
@@ -1,18 +1,4 @@
|
|||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
using Avalonia;
|
|
||||||
using Avalonia.Collections;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls.Primitives;
|
|
||||||
using Avalonia.Data;
|
|
||||||
using Avalonia.Input;
|
|
||||||
using Avalonia.Input.Raw;
|
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
using Avalonia.Threading;
|
|
||||||
using Semi.Avalonia.Demo.ViewModels;
|
using Semi.Avalonia.Demo.ViewModels;
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -10,9 +8,4 @@ public partial class DataValidationErrorsDemo : UserControl
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
using Avalonia.Media;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -11,14 +8,4 @@ public partial class DatePickerDemo : UserControl
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Render(DrawingContext context)
|
|
||||||
{
|
|
||||||
base.Render(context);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.LogicalTree;
|
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -9,9 +8,4 @@ public partial class GridSplitterDemo : UserControl
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,4 @@
|
|||||||
using System;
|
|
||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
ColumnDefinitions="Auto, *"
|
ColumnDefinitions="Auto, *"
|
||||||
RowDefinitions="*,*,*,*,*,*,*,*,*,*,*">
|
RowDefinitions="*,*,*,*,*,*,*,*,*,*,*">
|
||||||
<TextBlock Grid.Row="0" Grid.Column="0">Classes</TextBlock>
|
<TextBlock Grid.Row="0" Grid.Column="0">Classes</TextBlock>
|
||||||
<TextBlock Grid.Row="1" Grid.Column="0">-</TextBlock>
|
<TextBlock Grid.Row="1" Grid.Column="0">-</TextBlock>
|
||||||
<TextBlock Grid.Row="2" Grid.Column="0">Secondary</TextBlock>
|
<TextBlock Grid.Row="2" Grid.Column="0">Secondary</TextBlock>
|
||||||
<TextBlock Grid.Row="3" Grid.Column="0">Tertiary</TextBlock>
|
<TextBlock Grid.Row="3" Grid.Column="0">Tertiary</TextBlock>
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
Header="Default">
|
Header="Default">
|
||||||
<ScrollViewer>
|
<ScrollViewer>
|
||||||
<StackPanel Spacing="20">
|
<StackPanel Spacing="20">
|
||||||
<TextBlock Text="Theme: Default"/>
|
<TextBlock Text="Theme: Default" />
|
||||||
<ListBox ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
<ListBox ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||||
<ListBox IsEnabled="False">
|
<ListBox IsEnabled="False">
|
||||||
<ListBoxItem IsSelected="True">Avalonia</ListBoxItem>
|
<ListBoxItem IsSelected="True">Avalonia</ListBoxItem>
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
Theme="{DynamicResource GroupBox}"
|
Theme="{DynamicResource GroupBox}"
|
||||||
Header="RadioGroupListBox">
|
Header="RadioGroupListBox">
|
||||||
<StackPanel Spacing="20">
|
<StackPanel Spacing="20">
|
||||||
<TextBlock Text="Theme: RadioGroupListBox"/>
|
<TextBlock Text="Theme: RadioGroupListBox" />
|
||||||
<ListBox
|
<ListBox
|
||||||
Theme="{DynamicResource RadioGroupListBox}"
|
Theme="{DynamicResource RadioGroupListBox}"
|
||||||
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
<ListBoxItem IsSelected="True">WPF</ListBoxItem>
|
<ListBoxItem IsSelected="True">WPF</ListBoxItem>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
|
|
||||||
<TextBlock Text="Theme: ButtonRadioGroupListBox"/>
|
<TextBlock Text="Theme: ButtonRadioGroupListBox" />
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Border HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
|
<Border HorizontalAlignment="Left" Theme="{StaticResource RadioButtonGroupBorder}">
|
||||||
<ListBox Theme="{DynamicResource ButtonRadioGroupListBox}">
|
<ListBox Theme="{DynamicResource ButtonRadioGroupListBox}">
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
</Border>
|
</Border>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<TextBlock Text="Theme: CardRadioGroupListBox"/>
|
<TextBlock Text="Theme: CardRadioGroupListBox" />
|
||||||
<ListBox Theme="{DynamicResource CardRadioGroupListBox}"
|
<ListBox Theme="{DynamicResource CardRadioGroupListBox}"
|
||||||
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||||
<ListBox Theme="{DynamicResource CardRadioGroupListBox}" IsEnabled="False">
|
<ListBox Theme="{DynamicResource CardRadioGroupListBox}" IsEnabled="False">
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
<ListBoxItem>WPF</ListBoxItem>
|
<ListBoxItem>WPF</ListBoxItem>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
|
|
||||||
<TextBlock Text="Theme: PureCardRadioGroupListBox"/>
|
<TextBlock Text="Theme: PureCardRadioGroupListBox" />
|
||||||
<ListBox Theme="{DynamicResource PureCardRadioGroupListBox}"
|
<ListBox Theme="{DynamicResource PureCardRadioGroupListBox}"
|
||||||
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
ItemsSource="{Binding $parent[local:ListBoxDemo].Items}" />
|
||||||
<ListBox Theme="{DynamicResource PureCardRadioGroupListBox}" IsEnabled="False">
|
<ListBox Theme="{DynamicResource PureCardRadioGroupListBox}" IsEnabled="False">
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
Header="CheckGroupListBox">
|
Header="CheckGroupListBox">
|
||||||
<ScrollViewer>
|
<ScrollViewer>
|
||||||
<StackPanel Spacing="20">
|
<StackPanel Spacing="20">
|
||||||
<TextBlock Text="Theme: CheckGroupListBox"/>
|
<TextBlock Text="Theme: CheckGroupListBox" />
|
||||||
<ListBox
|
<ListBox
|
||||||
SelectionMode="Multiple,Toggle"
|
SelectionMode="Multiple,Toggle"
|
||||||
Theme="{DynamicResource CheckGroupListBox}"
|
Theme="{DynamicResource CheckGroupListBox}"
|
||||||
@@ -129,7 +129,7 @@
|
|||||||
<ListBoxItem>WPF</ListBoxItem>
|
<ListBoxItem>WPF</ListBoxItem>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
|
|
||||||
<TextBlock Text="Theme: CardCheckGroupListBox"/>
|
<TextBlock Text="Theme: CardCheckGroupListBox" />
|
||||||
<ListBox
|
<ListBox
|
||||||
SelectionMode="Multiple,Toggle"
|
SelectionMode="Multiple,Toggle"
|
||||||
Theme="{DynamicResource CardCheckGroupListBox}"
|
Theme="{DynamicResource CardCheckGroupListBox}"
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -11,8 +9,4 @@ public partial class MenuDemo : UserControl
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -11,8 +9,4 @@ public partial class NumericUpDownDemo : UserControl
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Media;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls;
|
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
Minimum="{Binding #slider.Minimum}"
|
Minimum="{Binding #slider.Minimum}"
|
||||||
Theme="{DynamicResource ProgressRing}"
|
Theme="{DynamicResource ProgressRing}"
|
||||||
Value="{Binding #slider.Value}"
|
Value="{Binding #slider.Value}"
|
||||||
ShowProgressText="True"/>
|
ShowProgressText="True" />
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
Width="100"
|
Width="100"
|
||||||
Height="100"
|
Height="100"
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
Maximum="{Binding #slider.Maximum}"
|
Maximum="{Binding #slider.Maximum}"
|
||||||
Minimum="{Binding #slider.Minimum}"
|
Minimum="{Binding #slider.Minimum}"
|
||||||
Theme="{DynamicResource ProgressRing}"
|
Theme="{DynamicResource ProgressRing}"
|
||||||
ShowProgressText="True"/>
|
ShowProgressText="True" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Slider
|
<Slider
|
||||||
Name="slider"
|
Name="slider"
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -10,9 +8,4 @@ public partial class ProgressBarDemo : UserControl
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -10,9 +8,4 @@ public partial class ScrollViewerDemo : UserControl
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -11,8 +9,4 @@ public partial class SelectableTextBlockDemo : UserControl
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -11,8 +9,4 @@ public partial class SliderDemo : UserControl
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -114,8 +114,7 @@
|
|||||||
Theme="{DynamicResource IconBorderlessToggleSwitch}"
|
Theme="{DynamicResource IconBorderlessToggleSwitch}"
|
||||||
Content="{StaticResource SemiIconSidebar}"
|
Content="{StaticResource SemiIconSidebar}"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
IsChecked="{Binding #SplitView.IsPaneOpen}">
|
IsChecked="{Binding #SplitView.IsPaneOpen}" />
|
||||||
</ToggleSwitch>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</SplitView.Pane>
|
</SplitView.Pane>
|
||||||
|
|
||||||
@@ -205,8 +204,7 @@
|
|||||||
Theme="{DynamicResource IconBorderlessToggleSwitch}"
|
Theme="{DynamicResource IconBorderlessToggleSwitch}"
|
||||||
Content="{StaticResource SemiIconSidebar}"
|
Content="{StaticResource SemiIconSidebar}"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
IsChecked="{Binding #SplitView2.IsPaneOpen}">
|
IsChecked="{Binding #SplitView2.IsPaneOpen}" />
|
||||||
</ToggleSwitch>
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="8,12"
|
Margin="8,12"
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
@@ -12,11 +11,6 @@ public partial class SplitViewDemo : UserControl
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.DataContext = new SplitViewDemoViewModel();
|
this.DataContext = new SplitViewDemoViewModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SplitViewDemoViewModel : ObservableObject
|
public class SplitViewDemoViewModel : ObservableObject
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
using Semi.Avalonia.Demo.ViewModels;
|
using Semi.Avalonia.Demo.ViewModels;
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
|
|||||||
@@ -17,9 +17,9 @@
|
|||||||
<TimePicker Classes="Large" />
|
<TimePicker Classes="Large" />
|
||||||
<TimePicker Classes="Small" />
|
<TimePicker Classes="Small" />
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TimePicker Classes="Large" ClockIdentifier="12HourClock"/>
|
<TimePicker Classes="Large" ClockIdentifier="12HourClock" />
|
||||||
<TimePicker ClockIdentifier="12HourClock"/>
|
<TimePicker ClockIdentifier="12HourClock" />
|
||||||
<TimePicker Classes="Small" ClockIdentifier="12HourClock"/>
|
<TimePicker Classes="Small" ClockIdentifier="12HourClock" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TimePicker IsEnabled="False" />
|
<TimePicker IsEnabled="False" />
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -10,9 +8,4 @@ public partial class TimePickerDemo : UserControl
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -10,9 +8,4 @@ public partial class ToggleButtonDemo : UserControl
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -10,9 +8,4 @@ public partial class ToggleSwitchDemo : UserControl
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
|
|
||||||
@@ -10,9 +8,4 @@ public partial class ToolTipDemo : UserControl
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
AvaloniaXamlLoader.Load(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using Avalonia;
|
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Markup.Xaml;
|
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Pages;
|
namespace Semi.Avalonia.Demo.Pages;
|
||||||
@@ -25,14 +23,16 @@ public class TreeViewVm : ObservableObject
|
|||||||
{
|
{
|
||||||
Items = new ObservableCollection<TreeViewItemVm>()
|
Items = new ObservableCollection<TreeViewItemVm>()
|
||||||
{
|
{
|
||||||
new TreeViewItemVm() {Name = "Item 1", Id = "1"},
|
new TreeViewItemVm() { Name = "Item 1", Id = "1" },
|
||||||
new TreeViewItemVm() {Name = "Item 2", Id = "2"},
|
new TreeViewItemVm() { Name = "Item 2", Id = "2" },
|
||||||
new TreeViewItemVm() {Name = "Item 3", Id = "3", Items = new ObservableCollection<TreeViewItemVm>()
|
new TreeViewItemVm()
|
||||||
{
|
{
|
||||||
new TreeViewItemVm() {Name = "Item 3.1", Id = "3.1"},
|
Name = "Item 3", Id = "3", Items = new ObservableCollection<TreeViewItemVm>()
|
||||||
new TreeViewItemVm() {Name = "Item 3.2", Id = "3.2"},
|
{
|
||||||
new TreeViewItemVm() {Name = "Item 3.3", Id = "3.3"},
|
new TreeViewItemVm() { Name = "Item 3.1", Id = "3.1" },
|
||||||
},
|
new TreeViewItemVm() { Name = "Item 3.2", Id = "3.2" },
|
||||||
|
new TreeViewItemVm() { Name = "Item 3.3", Id = "3.3" },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -50,8 +50,10 @@ public class TreeViewVm : ObservableObject
|
|||||||
ThirdItem thirdItem = new ThirdItem { Id = k, Name = $"ThirdItem {k}" };
|
ThirdItem thirdItem = new ThirdItem { Id = k, Name = $"ThirdItem {k}" };
|
||||||
secondItem.ThirdItemItems.Add(thirdItem);
|
secondItem.ThirdItemItems.Add(thirdItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
firstItem.SecondItems.Add(secondItem);
|
firstItem.SecondItems.Add(secondItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
MultipleLevelItems.Add(firstItem);
|
MultipleLevelItems.Add(firstItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -69,18 +71,17 @@ public class ItemBase
|
|||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public string? Name { get; set; }
|
public string? Name { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class FirstItem : ItemBase
|
public class FirstItem : ItemBase
|
||||||
{
|
{
|
||||||
public ObservableCollection<SecondItem>? SecondItems { get; set; }
|
public ObservableCollection<SecondItem>? SecondItems { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SecondItem : ItemBase
|
public class SecondItem : ItemBase
|
||||||
{
|
{
|
||||||
public ObservableCollection<ThirdItem>? ThirdItemItems { get; set; }
|
public ObservableCollection<ThirdItem>? ThirdItemItems { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ThirdItem : ItemBase
|
public class ThirdItem : ItemBase
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,10 @@ using Avalonia;
|
|||||||
using Avalonia.Controls.ApplicationLifetimes;
|
using Avalonia.Controls.ApplicationLifetimes;
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
using CommunityToolkit.Mvvm.Input;
|
using CommunityToolkit.Mvvm.Input;
|
||||||
using Semi.Avalonia.Demo.Views;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.ViewModels;
|
namespace Semi.Avalonia.Demo.ViewModels;
|
||||||
|
|
||||||
public partial class ApplicationViewModel: ObservableObject
|
public partial class ApplicationViewModel : ObservableObject
|
||||||
{
|
{
|
||||||
[RelayCommand]
|
[RelayCommand]
|
||||||
private void Exit()
|
private void Exit()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using CommunityToolkit.Mvvm.ComponentModel;
|
|||||||
|
|
||||||
namespace Semi.Avalonia.Demo.ViewModels;
|
namespace Semi.Avalonia.Demo.ViewModels;
|
||||||
|
|
||||||
public class TreeDataGridDemoViewModel: ObservableObject
|
public class TreeDataGridDemoViewModel : ObservableObject
|
||||||
{
|
{
|
||||||
public SongsPageViewModel SongsContext { get; } = new();
|
public SongsPageViewModel SongsContext { get; } = new();
|
||||||
public FilesPageViewModel FilesContext { get; } = new();
|
public FilesPageViewModel FilesContext { get; } = new();
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls.Notifications;
|
|
||||||
|
|
||||||
namespace Semi.Avalonia.Demo.Views;
|
namespace Semi.Avalonia.Demo.Views;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user