Merge pull request #334 from irihitech/enumAOT
Revert EnumSlector related demo page
This commit is contained in:
@@ -7,6 +7,11 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||||
|
<!-- Uncomment below to enable Native AOT compilation-->
|
||||||
|
<!--
|
||||||
|
<PublishAot>true</PublishAot>
|
||||||
|
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
|
||||||
|
-->
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|||||||
@@ -52,11 +52,11 @@
|
|||||||
OnContent="Yes" />
|
OnContent="Yes" />
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock VerticalAlignment="Center" Text="Buttons" />
|
<TextBlock VerticalAlignment="Center" Text="Buttons" />
|
||||||
<ComboBox ItemsSource="{Binding DialogButtons}" SelectedValue="{Binding SelectedButton}" />
|
<u:EnumSelector EnumType="{x:Type u:DialogButton}" Value="{Binding SelectedButton}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock VerticalAlignment="Center" Text="Mode" />
|
<TextBlock VerticalAlignment="Center" Text="Mode" />
|
||||||
<ComboBox ItemsSource="{Binding DialogModes}" SelectedValue="{Binding SelectedMode}" />
|
<u:EnumSelector EnumType="{x:Type u:DialogMode}" Value="{Binding SelectedMode}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Button Command="{Binding ShowDialogCommand}" Content="Show Dialog" />
|
<Button Command="{Binding ShowDialogCommand}" Content="Show Dialog" />
|
||||||
<TextBlock>
|
<TextBlock>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:u="https://irihi.tech/ursa"
|
xmlns:u="https://irihi.tech/ursa"
|
||||||
xmlns:vm="clr-namespace:Ursa.Demo.ViewModels;assembly=Ursa.Demo"
|
xmlns:vm="clr-namespace:Ursa.Demo.ViewModels;assembly=Ursa.Demo"
|
||||||
|
xmlns:common="clr-namespace:Ursa.Common;assembly=Ursa"
|
||||||
d:DesignHeight="450"
|
d:DesignHeight="450"
|
||||||
d:DesignWidth="800"
|
d:DesignWidth="800"
|
||||||
x:CompileBindings="True"
|
x:CompileBindings="True"
|
||||||
@@ -15,7 +16,7 @@
|
|||||||
<TabControl Grid.Column="0" Width="300">
|
<TabControl Grid.Column="0" Width="300">
|
||||||
<TabItem Header="Default">
|
<TabItem Header="Default">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<ComboBox ItemsSource="{Binding Positions}" SelectedValue="{Binding SelectedPosition}" />
|
<u:EnumSelector EnumType="common:Position" Value="{Binding SelectedPosition}" />
|
||||||
<ToggleSwitch
|
<ToggleSwitch
|
||||||
Content="Global/Local"
|
Content="Global/Local"
|
||||||
IsChecked="{Binding IsGlobal}"
|
IsChecked="{Binding IsGlobal}"
|
||||||
@@ -33,7 +34,7 @@
|
|||||||
OnContent="Yes" />
|
OnContent="Yes" />
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Text="Buttons" />
|
<TextBlock Text="Buttons" />
|
||||||
<ComboBox ItemsSource="{Binding DialogButtons}" SelectedValue="{Binding SelectedButton}" />
|
<u:EnumSelector EnumType="{x:Type u:DialogButton}" Value="{Binding SelectedButton}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Button Command="{Binding ShowDialogCommand}" Content="Show Default Drawer" />
|
<Button Command="{Binding ShowDialogCommand}" Content="Show Default Drawer" />
|
||||||
<TextBlock>
|
<TextBlock>
|
||||||
@@ -48,7 +49,7 @@
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="Custom">
|
<TabItem Header="Custom">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<ComboBox ItemsSource="{Binding Positions}" SelectedValue="{Binding SelectedPosition}" />
|
<u:EnumSelector EnumType="common:Position" Value="{Binding SelectedPosition}" />
|
||||||
<ToggleSwitch
|
<ToggleSwitch
|
||||||
Content="Global/Local"
|
Content="Global/Local"
|
||||||
IsChecked="{Binding IsGlobal}"
|
IsChecked="{Binding IsGlobal}"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<Setter Property="Width" Value="{Binding ItemSelfWidth}" />
|
<Setter Property="Width" Value="{Binding ItemSelfWidth}" />
|
||||||
<Setter Property="Height" Value="{Binding ItemSelfHeight}" />
|
<Setter Property="Height" Value="{Binding ItemSelfHeight}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="ComboBox">
|
<Style Selector="u|EnumSelector">
|
||||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||||
</Style>
|
</Style>
|
||||||
</UserControl.Styles>
|
</UserControl.Styles>
|
||||||
@@ -30,13 +30,13 @@
|
|||||||
Margin="4 0">
|
Margin="4 0">
|
||||||
<u:FormGroup>
|
<u:FormGroup>
|
||||||
<u:FormItem Label="Orientation">
|
<u:FormItem Label="Orientation">
|
||||||
<ComboBox ItemsSource="{Binding Orientations}" SelectedValue="{Binding SelectedOrientation}"/>
|
<u:EnumSelector EnumType="Orientation" Value="{Binding SelectedOrientation}" />
|
||||||
</u:FormItem>
|
</u:FormItem>
|
||||||
<u:FormItem Label="HorizontalScrollBar">
|
<u:FormItem Label="HorizontalScrollBar">
|
||||||
<ComboBox ItemsSource="{Binding ScrollBarVisibilities}" SelectedValue="{Binding HorizontalVisibility}"/>
|
<u:EnumSelector EnumType="ScrollBarVisibility" Value="{Binding HorizontalVisibility}" />
|
||||||
</u:FormItem>
|
</u:FormItem>
|
||||||
<u:FormItem Label="VerticalScrollBar">
|
<u:FormItem Label="VerticalScrollBar">
|
||||||
<ComboBox ItemsSource="{Binding ScrollBarVisibilities}" SelectedValue="{Binding VerticalVisibility}"/>
|
<u:EnumSelector EnumType="ScrollBarVisibility" Value="{Binding VerticalVisibility}" />
|
||||||
</u:FormItem>
|
</u:FormItem>
|
||||||
<u:FormItem>
|
<u:FormItem>
|
||||||
<u:FormItem.Label>
|
<u:FormItem.Label>
|
||||||
@@ -93,10 +93,10 @@
|
|||||||
Value="{Binding ItemSelfHeight}" />
|
Value="{Binding ItemSelfHeight}" />
|
||||||
</u:FormItem>
|
</u:FormItem>
|
||||||
<u:FormItem Label="HorizontalAlignment">
|
<u:FormItem Label="HorizontalAlignment">
|
||||||
<ComboBox ItemsSource="{Binding HorizontalAlignments}" SelectedValue="{Binding CmbHAlign}"/>
|
<u:EnumSelector EnumType="HorizontalAlignment" Value="{Binding CmbHAlign}" />
|
||||||
</u:FormItem>
|
</u:FormItem>
|
||||||
<u:FormItem Label="VerticalAlignment">
|
<u:FormItem Label="VerticalAlignment">
|
||||||
<ComboBox ItemsSource="{Binding VerticalAlignments}" SelectedValue="{Binding CmbVAlign}"/>
|
<u:EnumSelector EnumType="VerticalAlignment" Value="{Binding CmbVAlign}" />
|
||||||
</u:FormItem>
|
</u:FormItem>
|
||||||
</u:FormGroup>
|
</u:FormGroup>
|
||||||
</u:Form>
|
</u:Form>
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
x:DataType="vm:EnumSelectorDemoViewModel"
|
x:DataType="vm:EnumSelectorDemoViewModel"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<u:Banner Type="Warning" Header="Native AOT non-compatible" Content="EnumSelector highly relies on reflection, it is not compatible with NativeAOT compilation. " Classes="Warning"></u:Banner>
|
|
||||||
<ToggleSwitch Name="description" Content="Show Description" />
|
<ToggleSwitch Name="description" Content="Show Description" />
|
||||||
<TextBlock Text="Select Type" />
|
<TextBlock Text="Select Type" />
|
||||||
<ComboBox
|
<ComboBox
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Ursa.Demo.Pages.FormDemo"
|
x:Class="Ursa.Demo.Pages.FormDemo"
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:common="clr-namespace:Ursa.Common;assembly=Ursa"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:u="https://irihi.tech/ursa"
|
xmlns:u="https://irihi.tech/ursa"
|
||||||
@@ -14,21 +15,21 @@
|
|||||||
<ScrollViewer>
|
<ScrollViewer>
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<Grid RowDefinitions="Auto, Auto" ColumnDefinitions="Auto, Auto">
|
<Grid RowDefinitions="Auto, Auto" ColumnDefinitions="Auto, Auto">
|
||||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="Label Position" VerticalAlignment="Center" />
|
<TextBlock Grid.Row="0" Grid.Column="0" Text="Label Position" VerticalAlignment="Center"></TextBlock>
|
||||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="Label Alignment" VerticalAlignment="Center" />
|
<TextBlock Grid.Row="1" Grid.Column="0" Text="Label Alignment" VerticalAlignment="Center"></TextBlock>
|
||||||
<ComboBox Grid.Row="0" Grid.Column="1"
|
<u:EnumSelector Grid.Row="0" Grid.Column="1"
|
||||||
Name="position"
|
Name="position"
|
||||||
ItemsSource="{Binding Positions}"
|
EnumType="common:Position"
|
||||||
SelectedValue="{Binding SelectedPosition}" />
|
Value="{x:Static common:Position.Top}" />
|
||||||
<ComboBox Grid.Row="1" Grid.Column="1"
|
<u:EnumSelector Grid.Row="1" Grid.Column="1"
|
||||||
Name="alignment"
|
Name="alignment"
|
||||||
ItemsSource="{Binding HorizontalAlignments}"
|
EnumType="HorizontalAlignment"
|
||||||
SelectedValue="{Binding SelectedHorizontalAlignment}" />
|
Value="{x:Static HorizontalAlignment.Left}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<u:Form
|
<u:Form
|
||||||
DataContext="{Binding Model}"
|
DataContext="{Binding Model}"
|
||||||
LabelAlignment="{Binding #alignment.SelectedValue}"
|
LabelAlignment="{Binding #alignment.Value}"
|
||||||
LabelPosition="{Binding #position.SelectedValue}"
|
LabelPosition="{Binding #position.Value}"
|
||||||
LabelWidth="*">
|
LabelWidth="*">
|
||||||
<u:FormGroup Header="Information">
|
<u:FormGroup Header="Information">
|
||||||
<TextBox
|
<TextBox
|
||||||
|
|||||||
@@ -2,11 +2,10 @@
|
|||||||
x:Class="Ursa.Demo.Pages.IconButtonDemo"
|
x:Class="Ursa.Demo.Pages.IconButtonDemo"
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:common="clr-namespace:Ursa.Common;assembly=Ursa"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:u="https://irihi.tech/ursa"
|
xmlns:u="https://irihi.tech/ursa"
|
||||||
xmlns:vm="clr-namespace:Ursa.Demo.ViewModels"
|
|
||||||
x:DataType="vm:IconButtonDemoViewModel"
|
|
||||||
d:DesignHeight="450"
|
d:DesignHeight="450"
|
||||||
d:DesignWidth="800"
|
d:DesignWidth="800"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
@@ -15,16 +14,14 @@
|
|||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<StackPanel HorizontalAlignment="Left" Spacing="16">
|
<StackPanel HorizontalAlignment="Left" Spacing="16">
|
||||||
<ToggleSwitch Name="loading" Content="Toggle Loading" />
|
<ToggleSwitch Name="loading" Content="Toggle Loading" />
|
||||||
<ComboBox Name="placement"
|
<u:EnumSelector Name="placement" EnumType="{x:Type common:Position}" />
|
||||||
ItemsSource="{Binding Positions}"
|
|
||||||
SelectedValue="{Binding SelectedPosition}" />
|
|
||||||
<u:IconButton
|
<u:IconButton
|
||||||
Content="Hello World"
|
Content="Hello World"
|
||||||
IconPlacement="{Binding #placement.SelectedValue}"
|
IconPlacement="{Binding #placement.Value}"
|
||||||
IsLoading="{Binding #loading.IsChecked}" />
|
IsLoading="{Binding #loading.IsChecked}" />
|
||||||
<u:IconButton
|
<u:IconButton
|
||||||
Content="Hello Panda"
|
Content="Hello Panda"
|
||||||
IconPlacement="{Binding #placement.SelectedValue}"
|
IconPlacement="{Binding #placement.Value}"
|
||||||
IsLoading="{Binding #loading.IsChecked}">
|
IsLoading="{Binding #loading.IsChecked}">
|
||||||
<u:IconButton.Icon>
|
<u:IconButton.Icon>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
@@ -35,7 +32,7 @@
|
|||||||
</u:IconButton>
|
</u:IconButton>
|
||||||
<u:IconButton
|
<u:IconButton
|
||||||
Content="GitHub"
|
Content="GitHub"
|
||||||
IconPlacement="{Binding #placement.SelectedValue}"
|
IconPlacement="{Binding #placement.Value}"
|
||||||
IsLoading="{Binding #loading.IsChecked}">
|
IsLoading="{Binding #loading.IsChecked}">
|
||||||
<u:IconButton.Icon>
|
<u:IconButton.Icon>
|
||||||
<PathIcon
|
<PathIcon
|
||||||
@@ -47,7 +44,7 @@
|
|||||||
<u:IconButton
|
<u:IconButton
|
||||||
Width="150"
|
Width="150"
|
||||||
Content="GitHub"
|
Content="GitHub"
|
||||||
IconPlacement="{Binding #placement.SelectedValue}"
|
IconPlacement="{Binding #placement.Value}"
|
||||||
IsLoading="{Binding #loading.IsChecked}">
|
IsLoading="{Binding #loading.IsChecked}">
|
||||||
<u:IconButton.Icon>
|
<u:IconButton.Icon>
|
||||||
<PathIcon
|
<PathIcon
|
||||||
@@ -60,7 +57,7 @@
|
|||||||
Width="150"
|
Width="150"
|
||||||
Classes="Warning"
|
Classes="Warning"
|
||||||
Content="GitHub"
|
Content="GitHub"
|
||||||
IconPlacement="{Binding #placement.SelectedValue}"
|
IconPlacement="{Binding #placement.Value}"
|
||||||
IsLoading="{Binding #loading.IsChecked}">
|
IsLoading="{Binding #loading.IsChecked}">
|
||||||
<u:IconButton.Icon>
|
<u:IconButton.Icon>
|
||||||
<PathIcon
|
<PathIcon
|
||||||
@@ -72,7 +69,7 @@
|
|||||||
<u:IconButton
|
<u:IconButton
|
||||||
Width="150"
|
Width="150"
|
||||||
Content="GitHub"
|
Content="GitHub"
|
||||||
IconPlacement="{Binding #placement.SelectedValue}"
|
IconPlacement="{Binding #placement.Value}"
|
||||||
IsLoading="{Binding #loading.IsChecked}"
|
IsLoading="{Binding #loading.IsChecked}"
|
||||||
Theme="{DynamicResource SolidIconButton}">
|
Theme="{DynamicResource SolidIconButton}">
|
||||||
<u:IconButton.Icon>
|
<u:IconButton.Icon>
|
||||||
@@ -86,7 +83,7 @@
|
|||||||
Width="150"
|
Width="150"
|
||||||
Classes="Warning"
|
Classes="Warning"
|
||||||
Content="GitHub"
|
Content="GitHub"
|
||||||
IconPlacement="{Binding #placement.SelectedValue}"
|
IconPlacement="{Binding #placement.Value}"
|
||||||
IsLoading="{Binding #loading.IsChecked}"
|
IsLoading="{Binding #loading.IsChecked}"
|
||||||
Theme="{DynamicResource SolidIconButton}">
|
Theme="{DynamicResource SolidIconButton}">
|
||||||
<u:IconButton.Icon>
|
<u:IconButton.Icon>
|
||||||
|
|||||||
@@ -19,13 +19,11 @@
|
|||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<Grid ColumnDefinitions="Auto, Auto, *" RowDefinitions="Auto, Auto, *">
|
<Grid ColumnDefinitions="Auto, Auto, *" RowDefinitions="Auto, Auto, *">
|
||||||
<ComboBox Name="Orientation"
|
<u:EnumSelector Name="Orientation" EnumType="Orientation" />
|
||||||
ItemsSource="{Binding Orientations}"
|
|
||||||
SelectedValue="{Binding SelectedOrientation}"/>
|
|
||||||
<u:ToolBar
|
<u:ToolBar
|
||||||
DockPanel.Dock="Top"
|
DockPanel.Dock="Top"
|
||||||
Header="Hello World"
|
Header="Hello World"
|
||||||
Orientation="{Binding #Orientation.SelectedValue}">
|
Orientation="{Binding #Orientation.Value}">
|
||||||
<Button u:ToolBar.OverflowMode="Never" Content="Button 1" />
|
<Button u:ToolBar.OverflowMode="Never" Content="Button 1" />
|
||||||
<u:ToolBarSeparator />
|
<u:ToolBarSeparator />
|
||||||
<TextBox Width="100" VerticalAlignment="Center"></TextBox>
|
<TextBox Width="100" VerticalAlignment="Center"></TextBox>
|
||||||
@@ -54,7 +52,7 @@
|
|||||||
<u:ToolBar
|
<u:ToolBar
|
||||||
DockPanel.Dock="Top"
|
DockPanel.Dock="Top"
|
||||||
ItemsSource="{Binding Items}"
|
ItemsSource="{Binding Items}"
|
||||||
Orientation="{Binding #Orientation.SelectedValue}">
|
Orientation="{Binding #Orientation.Value}">
|
||||||
<u:ToolBar.ItemTemplate>
|
<u:ToolBar.ItemTemplate>
|
||||||
<template:ToolBarItemTemplateSelector />
|
<template:ToolBarItemTemplateSelector />
|
||||||
</u:ToolBar.ItemTemplate>
|
</u:ToolBar.ItemTemplate>
|
||||||
|
|||||||
@@ -25,25 +25,6 @@ public partial class DialogDemoViewModel: ObservableObject
|
|||||||
[ObservableProperty] private DateTime? _date;
|
[ObservableProperty] private DateTime? _date;
|
||||||
[ObservableProperty] private bool _fullScreen;
|
[ObservableProperty] private bool _fullScreen;
|
||||||
[ObservableProperty] private bool _showInTaskBar;
|
[ObservableProperty] private bool _showInTaskBar;
|
||||||
|
|
||||||
public ObservableCollection<DialogButton> DialogButtons =>
|
|
||||||
[
|
|
||||||
DialogButton.None,
|
|
||||||
DialogButton.OK,
|
|
||||||
DialogButton.OKCancel,
|
|
||||||
DialogButton.YesNo,
|
|
||||||
DialogButton.YesNoCancel,
|
|
||||||
];
|
|
||||||
|
|
||||||
public ObservableCollection<DialogMode> DialogModes =>
|
|
||||||
[
|
|
||||||
DialogMode.Info,
|
|
||||||
DialogMode.Warning,
|
|
||||||
DialogMode.Error,
|
|
||||||
DialogMode.Question,
|
|
||||||
DialogMode.None,
|
|
||||||
DialogMode.Success,
|
|
||||||
];
|
|
||||||
|
|
||||||
public DialogDemoViewModel()
|
public DialogDemoViewModel()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
@@ -25,23 +24,6 @@ public partial class DrawerDemoViewModel : ObservableObject
|
|||||||
[ObservableProperty] private bool _isModal;
|
[ObservableProperty] private bool _isModal;
|
||||||
[ObservableProperty] private DateTime? _date;
|
[ObservableProperty] private DateTime? _date;
|
||||||
|
|
||||||
public ObservableCollection<Position> Positions =>
|
|
||||||
[
|
|
||||||
Position.Left,
|
|
||||||
Position.Top,
|
|
||||||
Position.Right,
|
|
||||||
Position.Bottom,
|
|
||||||
];
|
|
||||||
|
|
||||||
public ObservableCollection<DialogButton> DialogButtons =>
|
|
||||||
[
|
|
||||||
DialogButton.None,
|
|
||||||
DialogButton.OK,
|
|
||||||
DialogButton.OKCancel,
|
|
||||||
DialogButton.YesNo,
|
|
||||||
DialogButton.YesNoCancel,
|
|
||||||
];
|
|
||||||
|
|
||||||
public DrawerDemoViewModel()
|
public DrawerDemoViewModel()
|
||||||
{
|
{
|
||||||
ShowDialogCommand = new AsyncRelayCommand(ShowDefaultDialog);
|
ShowDialogCommand = new AsyncRelayCommand(ShowDefaultDialog);
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System.Collections.ObjectModel;
|
using Avalonia.Controls.Primitives;
|
||||||
using Avalonia.Controls.Primitives;
|
|
||||||
using Avalonia.Layout;
|
using Avalonia.Layout;
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
|
|
||||||
@@ -24,35 +23,6 @@ public partial class ElasticWrapPanelDemoViewModel : ObservableObject
|
|||||||
[ObservableProperty] private HorizontalAlignment _cmbHAlign = HorizontalAlignment.Left;
|
[ObservableProperty] private HorizontalAlignment _cmbHAlign = HorizontalAlignment.Left;
|
||||||
[ObservableProperty] private VerticalAlignment _cmbVAlign = VerticalAlignment.Stretch;
|
[ObservableProperty] private VerticalAlignment _cmbVAlign = VerticalAlignment.Stretch;
|
||||||
|
|
||||||
public ObservableCollection<Orientation> Orientations =>
|
|
||||||
[
|
|
||||||
Orientation.Horizontal,
|
|
||||||
Orientation.Vertical,
|
|
||||||
];
|
|
||||||
|
|
||||||
public ObservableCollection<ScrollBarVisibility> ScrollBarVisibilities =>
|
|
||||||
[
|
|
||||||
ScrollBarVisibility.Auto,
|
|
||||||
ScrollBarVisibility.Hidden,
|
|
||||||
ScrollBarVisibility.Visible,
|
|
||||||
];
|
|
||||||
|
|
||||||
public ObservableCollection<HorizontalAlignment> HorizontalAlignments =>
|
|
||||||
[
|
|
||||||
HorizontalAlignment.Left,
|
|
||||||
HorizontalAlignment.Center,
|
|
||||||
HorizontalAlignment.Right,
|
|
||||||
HorizontalAlignment.Stretch,
|
|
||||||
];
|
|
||||||
|
|
||||||
public ObservableCollection<VerticalAlignment> VerticalAlignments =>
|
|
||||||
[
|
|
||||||
VerticalAlignment.Top,
|
|
||||||
VerticalAlignment.Center,
|
|
||||||
VerticalAlignment.Bottom,
|
|
||||||
VerticalAlignment.Stretch,
|
|
||||||
];
|
|
||||||
|
|
||||||
private double _oldItemSelfWidth;
|
private double _oldItemSelfWidth;
|
||||||
private double _oldItemSelfHeight;
|
private double _oldItemSelfHeight;
|
||||||
|
|
||||||
|
|||||||
@@ -1,33 +1,12 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using Avalonia.Layout;
|
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
using Ursa.Common;
|
|
||||||
|
|
||||||
namespace Ursa.Demo.ViewModels;
|
namespace Ursa.Demo.ViewModels;
|
||||||
|
|
||||||
public partial class FormDemoViewModel : ObservableObject
|
public partial class FormDemoViewModel : ObservableObject
|
||||||
{
|
{
|
||||||
[ObservableProperty] private DataModel _model;
|
[ObservableProperty] private DataModel _model;
|
||||||
[ObservableProperty] private Position _selectedPosition = Position.Top;
|
|
||||||
[ObservableProperty] private HorizontalAlignment _selectedHorizontalAlignment = HorizontalAlignment.Left;
|
|
||||||
|
|
||||||
public ObservableCollection<Position> Positions =>
|
|
||||||
[
|
|
||||||
Position.Left,
|
|
||||||
Position.Top,
|
|
||||||
Position.Right,
|
|
||||||
Position.Bottom,
|
|
||||||
];
|
|
||||||
|
|
||||||
public ObservableCollection<HorizontalAlignment> HorizontalAlignments =>
|
|
||||||
[
|
|
||||||
HorizontalAlignment.Stretch,
|
|
||||||
HorizontalAlignment.Left,
|
|
||||||
HorizontalAlignment.Center,
|
|
||||||
HorizontalAlignment.Right,
|
|
||||||
];
|
|
||||||
|
|
||||||
public FormDemoViewModel()
|
public FormDemoViewModel()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,18 +1,7 @@
|
|||||||
using System.Collections.ObjectModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
|
||||||
using Ursa.Common;
|
|
||||||
|
|
||||||
namespace Ursa.Demo.ViewModels;
|
namespace Ursa.Demo.ViewModels;
|
||||||
|
|
||||||
public partial class IconButtonDemoViewModel : ObservableObject
|
public class IconButtonDemoViewModel : ObservableObject
|
||||||
{
|
{
|
||||||
[ObservableProperty] private Position _selectedPosition = Position.Top;
|
|
||||||
|
|
||||||
public ObservableCollection<Position> Positions =>
|
|
||||||
[
|
|
||||||
Position.Left,
|
|
||||||
Position.Top,
|
|
||||||
Position.Right,
|
|
||||||
Position.Bottom,
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using Avalonia.Layout;
|
|
||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
using CommunityToolkit.Mvvm.Input;
|
using CommunityToolkit.Mvvm.Input;
|
||||||
using Ursa.Controls;
|
using Ursa.Controls;
|
||||||
@@ -9,14 +8,6 @@ namespace Ursa.Demo.ViewModels;
|
|||||||
|
|
||||||
public partial class ToolBarDemoViewModel : ObservableObject
|
public partial class ToolBarDemoViewModel : ObservableObject
|
||||||
{
|
{
|
||||||
[ObservableProperty] private Orientation _selectedOrientation;
|
|
||||||
|
|
||||||
public ObservableCollection<Orientation> Orientations =>
|
|
||||||
[
|
|
||||||
Orientation.Horizontal,
|
|
||||||
Orientation.Vertical
|
|
||||||
];
|
|
||||||
|
|
||||||
public ObservableCollection<ToolBarItemViewModel> Items { get; set; }
|
public ObservableCollection<ToolBarItemViewModel> Items { get; set; }
|
||||||
|
|
||||||
public ToolBarDemoViewModel()
|
public ToolBarDemoViewModel()
|
||||||
@@ -76,6 +67,7 @@ public class ToolBarComboBoxItemViewModel : ToolBarItemViewModel
|
|||||||
public ObservableCollection<string>? Items { get; set; }
|
public ObservableCollection<string>? Items { get; set; }
|
||||||
|
|
||||||
private string? _selectedItem;
|
private string? _selectedItem;
|
||||||
|
|
||||||
public string? SelectedItem
|
public string? SelectedItem
|
||||||
{
|
{
|
||||||
get => _selectedItem;
|
get => _selectedItem;
|
||||||
|
|||||||
Reference in New Issue
Block a user