Revert "feat: remove EnumSelector in demo."
This reverts commit f7dc4d35
This commit is contained in:
@@ -52,11 +52,11 @@
|
||||
OnContent="Yes" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" Text="Buttons" />
|
||||
<ComboBox ItemsSource="{Binding DialogButtons}" SelectedValue="{Binding SelectedButton}" />
|
||||
<u:EnumSelector EnumType="{x:Type u:DialogButton}" Value="{Binding SelectedButton}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock VerticalAlignment="Center" Text="Mode" />
|
||||
<ComboBox ItemsSource="{Binding DialogModes}" SelectedValue="{Binding SelectedMode}" />
|
||||
<u:EnumSelector EnumType="{x:Type u:DialogMode}" Value="{Binding SelectedMode}" />
|
||||
</StackPanel>
|
||||
<Button Command="{Binding ShowDialogCommand}" Content="Show Dialog" />
|
||||
<TextBlock>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:u="https://irihi.tech/ursa"
|
||||
xmlns:vm="clr-namespace:Ursa.Demo.ViewModels;assembly=Ursa.Demo"
|
||||
xmlns:common="clr-namespace:Ursa.Common;assembly=Ursa"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
x:CompileBindings="True"
|
||||
@@ -15,7 +16,7 @@
|
||||
<TabControl Grid.Column="0" Width="300">
|
||||
<TabItem Header="Default">
|
||||
<StackPanel>
|
||||
<ComboBox ItemsSource="{Binding Positions}" SelectedValue="{Binding SelectedPosition}" />
|
||||
<u:EnumSelector EnumType="common:Position" Value="{Binding SelectedPosition}" />
|
||||
<ToggleSwitch
|
||||
Content="Global/Local"
|
||||
IsChecked="{Binding IsGlobal}"
|
||||
@@ -33,7 +34,7 @@
|
||||
OnContent="Yes" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Buttons" />
|
||||
<ComboBox ItemsSource="{Binding DialogButtons}" SelectedValue="{Binding SelectedButton}" />
|
||||
<u:EnumSelector EnumType="{x:Type u:DialogButton}" Value="{Binding SelectedButton}" />
|
||||
</StackPanel>
|
||||
<Button Command="{Binding ShowDialogCommand}" Content="Show Default Drawer" />
|
||||
<TextBlock>
|
||||
@@ -48,7 +49,7 @@
|
||||
</TabItem>
|
||||
<TabItem Header="Custom">
|
||||
<StackPanel>
|
||||
<ComboBox ItemsSource="{Binding Positions}" SelectedValue="{Binding SelectedPosition}" />
|
||||
<u:EnumSelector EnumType="common:Position" Value="{Binding SelectedPosition}" />
|
||||
<ToggleSwitch
|
||||
Content="Global/Local"
|
||||
IsChecked="{Binding IsGlobal}"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<Setter Property="Width" Value="{Binding ItemSelfWidth}" />
|
||||
<Setter Property="Height" Value="{Binding ItemSelfHeight}" />
|
||||
</Style>
|
||||
<Style Selector="ComboBox">
|
||||
<Style Selector="u|EnumSelector">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
</UserControl.Styles>
|
||||
@@ -30,13 +30,13 @@
|
||||
Margin="4 0">
|
||||
<u:FormGroup>
|
||||
<u:FormItem Label="Orientation">
|
||||
<ComboBox ItemsSource="{Binding Orientations}" SelectedValue="{Binding SelectedOrientation}"/>
|
||||
<u:EnumSelector EnumType="Orientation" Value="{Binding SelectedOrientation}" />
|
||||
</u:FormItem>
|
||||
<u:FormItem Label="HorizontalScrollBar">
|
||||
<ComboBox ItemsSource="{Binding ScrollBarVisibilities}" SelectedValue="{Binding HorizontalVisibility}"/>
|
||||
<u:EnumSelector EnumType="ScrollBarVisibility" Value="{Binding HorizontalVisibility}" />
|
||||
</u:FormItem>
|
||||
<u:FormItem Label="VerticalScrollBar">
|
||||
<ComboBox ItemsSource="{Binding ScrollBarVisibilities}" SelectedValue="{Binding VerticalVisibility}"/>
|
||||
<u:EnumSelector EnumType="ScrollBarVisibility" Value="{Binding VerticalVisibility}" />
|
||||
</u:FormItem>
|
||||
<u:FormItem>
|
||||
<u:FormItem.Label>
|
||||
@@ -93,10 +93,10 @@
|
||||
Value="{Binding ItemSelfHeight}" />
|
||||
</u:FormItem>
|
||||
<u:FormItem Label="HorizontalAlignment">
|
||||
<ComboBox ItemsSource="{Binding HorizontalAlignments}" SelectedValue="{Binding CmbHAlign}"/>
|
||||
<u:EnumSelector EnumType="HorizontalAlignment" Value="{Binding CmbHAlign}" />
|
||||
</u:FormItem>
|
||||
<u:FormItem Label="VerticalAlignment">
|
||||
<ComboBox ItemsSource="{Binding VerticalAlignments}" SelectedValue="{Binding CmbVAlign}"/>
|
||||
<u:EnumSelector EnumType="VerticalAlignment" Value="{Binding CmbVAlign}" />
|
||||
</u:FormItem>
|
||||
</u:FormGroup>
|
||||
</u:Form>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
x:Class="Ursa.Demo.Pages.FormDemo"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:u="https://irihi.tech/ursa"
|
||||
@@ -14,21 +15,21 @@
|
||||
<ScrollViewer>
|
||||
<StackPanel>
|
||||
<Grid RowDefinitions="Auto, Auto" ColumnDefinitions="Auto, Auto">
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="Label Position" VerticalAlignment="Center" />
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="Label Alignment" VerticalAlignment="Center" />
|
||||
<ComboBox Grid.Row="0" Grid.Column="1"
|
||||
Name="position"
|
||||
ItemsSource="{Binding Positions}"
|
||||
SelectedValue="{Binding SelectedPosition}" />
|
||||
<ComboBox Grid.Row="1" Grid.Column="1"
|
||||
Name="alignment"
|
||||
ItemsSource="{Binding HorizontalAlignments}"
|
||||
SelectedValue="{Binding SelectedHorizontalAlignment}" />
|
||||
<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>
|
||||
<u:EnumSelector Grid.Row="0" Grid.Column="1"
|
||||
Name="position"
|
||||
EnumType="common:Position"
|
||||
Value="{x:Static common:Position.Top}" />
|
||||
<u:EnumSelector Grid.Row="1" Grid.Column="1"
|
||||
Name="alignment"
|
||||
EnumType="HorizontalAlignment"
|
||||
Value="{x:Static HorizontalAlignment.Left}" />
|
||||
</Grid>
|
||||
<u:Form
|
||||
DataContext="{Binding Model}"
|
||||
LabelAlignment="{Binding #alignment.SelectedValue}"
|
||||
LabelPosition="{Binding #position.SelectedValue}"
|
||||
LabelAlignment="{Binding #alignment.Value}"
|
||||
LabelPosition="{Binding #position.Value}"
|
||||
LabelWidth="*">
|
||||
<u:FormGroup Header="Information">
|
||||
<TextBox
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
x:Class="Ursa.Demo.Pages.IconButtonDemo"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:u="https://irihi.tech/ursa"
|
||||
xmlns:vm="clr-namespace:Ursa.Demo.ViewModels"
|
||||
x:DataType="vm:IconButtonDemoViewModel"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
@@ -15,16 +14,14 @@
|
||||
</UserControl.Resources>
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="16">
|
||||
<ToggleSwitch Name="loading" Content="Toggle Loading" />
|
||||
<ComboBox Name="placement"
|
||||
ItemsSource="{Binding Positions}"
|
||||
SelectedValue="{Binding SelectedPosition}" />
|
||||
<u:EnumSelector Name="placement" EnumType="{x:Type common:Position}" />
|
||||
<u:IconButton
|
||||
Content="Hello World"
|
||||
IconPlacement="{Binding #placement.SelectedValue}"
|
||||
IconPlacement="{Binding #placement.Value}"
|
||||
IsLoading="{Binding #loading.IsChecked}" />
|
||||
<u:IconButton
|
||||
Content="Hello Panda"
|
||||
IconPlacement="{Binding #placement.SelectedValue}"
|
||||
IconPlacement="{Binding #placement.Value}"
|
||||
IsLoading="{Binding #loading.IsChecked}">
|
||||
<u:IconButton.Icon>
|
||||
<TextBlock
|
||||
@@ -35,7 +32,7 @@
|
||||
</u:IconButton>
|
||||
<u:IconButton
|
||||
Content="GitHub"
|
||||
IconPlacement="{Binding #placement.SelectedValue}"
|
||||
IconPlacement="{Binding #placement.Value}"
|
||||
IsLoading="{Binding #loading.IsChecked}">
|
||||
<u:IconButton.Icon>
|
||||
<PathIcon
|
||||
@@ -47,7 +44,7 @@
|
||||
<u:IconButton
|
||||
Width="150"
|
||||
Content="GitHub"
|
||||
IconPlacement="{Binding #placement.SelectedValue}"
|
||||
IconPlacement="{Binding #placement.Value}"
|
||||
IsLoading="{Binding #loading.IsChecked}">
|
||||
<u:IconButton.Icon>
|
||||
<PathIcon
|
||||
@@ -60,7 +57,7 @@
|
||||
Width="150"
|
||||
Classes="Warning"
|
||||
Content="GitHub"
|
||||
IconPlacement="{Binding #placement.SelectedValue}"
|
||||
IconPlacement="{Binding #placement.Value}"
|
||||
IsLoading="{Binding #loading.IsChecked}">
|
||||
<u:IconButton.Icon>
|
||||
<PathIcon
|
||||
@@ -72,7 +69,7 @@
|
||||
<u:IconButton
|
||||
Width="150"
|
||||
Content="GitHub"
|
||||
IconPlacement="{Binding #placement.SelectedValue}"
|
||||
IconPlacement="{Binding #placement.Value}"
|
||||
IsLoading="{Binding #loading.IsChecked}"
|
||||
Theme="{DynamicResource SolidIconButton}">
|
||||
<u:IconButton.Icon>
|
||||
@@ -86,7 +83,7 @@
|
||||
Width="150"
|
||||
Classes="Warning"
|
||||
Content="GitHub"
|
||||
IconPlacement="{Binding #placement.SelectedValue}"
|
||||
IconPlacement="{Binding #placement.Value}"
|
||||
IsLoading="{Binding #loading.IsChecked}"
|
||||
Theme="{DynamicResource SolidIconButton}">
|
||||
<u:IconButton.Icon>
|
||||
|
||||
@@ -19,13 +19,11 @@
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<Grid ColumnDefinitions="Auto, Auto, *" RowDefinitions="Auto, Auto, *">
|
||||
<ComboBox Name="Orientation"
|
||||
ItemsSource="{Binding Orientations}"
|
||||
SelectedValue="{Binding SelectedOrientation}"/>
|
||||
<u:EnumSelector Name="Orientation" EnumType="Orientation" />
|
||||
<u:ToolBar
|
||||
DockPanel.Dock="Top"
|
||||
Header="Hello World"
|
||||
Orientation="{Binding #Orientation.SelectedValue}">
|
||||
Orientation="{Binding #Orientation.Value}">
|
||||
<Button u:ToolBar.OverflowMode="Never" Content="Button 1" />
|
||||
<u:ToolBarSeparator />
|
||||
<TextBox Width="100" VerticalAlignment="Center"></TextBox>
|
||||
@@ -54,7 +52,7 @@
|
||||
<u:ToolBar
|
||||
DockPanel.Dock="Top"
|
||||
ItemsSource="{Binding Items}"
|
||||
Orientation="{Binding #Orientation.SelectedValue}">
|
||||
Orientation="{Binding #Orientation.Value}">
|
||||
<u:ToolBar.ItemTemplate>
|
||||
<template:ToolBarItemTemplateSelector />
|
||||
</u:ToolBar.ItemTemplate>
|
||||
|
||||
Reference in New Issue
Block a user