186 lines
9.0 KiB
XML
186 lines
9.0 KiB
XML
<UserControl
|
|
x:Class="Ursa.Demo.Pages.DialogDemo"
|
|
xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
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="using:Ursa.Demo.ViewModels"
|
|
d:DesignHeight="1200"
|
|
d:DesignWidth="800"
|
|
x:CompileBindings="True"
|
|
x:DataType="vm:DialogDemoViewModel"
|
|
mc:Ignorable="d">
|
|
<Grid ColumnDefinitions="Auto, *">
|
|
<TabControl Grid.Column="0" TabStripPlacement="Left">
|
|
<TabItem Header="Default Window Dialog">
|
|
<u:Form
|
|
Width="300"
|
|
Margin="16,0"
|
|
DataContext="{Binding DefaultWindowDialogDemoViewModel}"
|
|
LabelPosition="Top">
|
|
<TextBox
|
|
HorizontalAlignment="Stretch"
|
|
u:FormItem.Label="Title"
|
|
Text="{Binding Title}" />
|
|
<u:EnumSelector
|
|
HorizontalAlignment="Stretch"
|
|
u:FormItem.Label="Startup Location"
|
|
EnumType="WindowStartupLocation"
|
|
Value="{Binding Location}" />
|
|
<u:FormItem Label="PixelPosition">
|
|
<UniformGrid Columns="2" Rows="1">
|
|
<u:NumericIntUpDown InnerLeftContent="X" Value="{Binding X}" />
|
|
<u:NumericIntUpDown InnerLeftContent="Y" Value="{Binding Y}" />
|
|
</UniformGrid>
|
|
</u:FormItem>
|
|
<u:EnumSelector
|
|
HorizontalAlignment="Stretch"
|
|
u:FormItem.Label="Dialog Mode"
|
|
EnumType="u:DialogMode"
|
|
Value="{Binding Mode}" />
|
|
<u:EnumSelector
|
|
HorizontalAlignment="Stretch"
|
|
u:FormItem.Label="Dialog Buttons"
|
|
EnumType="u:DialogButton"
|
|
Value="{Binding Button}" />
|
|
<CheckBox u:FormItem.Label="Show In Taskbar" IsChecked="{Binding ShowInTaskBar}" />
|
|
<CheckBox
|
|
u:FormItem.Label="Is Close Button Visible"
|
|
IsChecked="{Binding IsCloseButtonVisible}"
|
|
IsThreeState="True" />
|
|
<CheckBox u:FormItem.Label="CanDragMove" IsChecked="{Binding CanDragMove}" />
|
|
<Button
|
|
HorizontalAlignment="Left"
|
|
u:FormItem.NoLabel="True"
|
|
Command="{Binding ShowDialogCommand}"
|
|
Content="Show" />
|
|
</u:Form>
|
|
</TabItem>
|
|
<TabItem Header="Custom Window Dialog">
|
|
<u:Form
|
|
Width="300"
|
|
Margin="16,0"
|
|
DataContext="{Binding CustomWindowDialogDemoViewModel}"
|
|
LabelPosition="Top">
|
|
<TextBox
|
|
HorizontalAlignment="Stretch"
|
|
u:FormItem.Label="Title"
|
|
Text="{Binding Title}" />
|
|
<u:EnumSelector
|
|
HorizontalAlignment="Stretch"
|
|
u:FormItem.Label="Startup Location"
|
|
EnumType="WindowStartupLocation"
|
|
Value="{Binding Location}" />
|
|
<u:FormItem Label="PixelPosition">
|
|
<UniformGrid Columns="2" Rows="1">
|
|
<u:NumericIntUpDown InnerLeftContent="X" Value="{Binding X}" />
|
|
<u:NumericIntUpDown InnerLeftContent="Y" Value="{Binding Y}" />
|
|
</UniformGrid>
|
|
</u:FormItem>
|
|
<CheckBox u:FormItem.Label="Show In Taskbar" IsChecked="{Binding ShowInTaskBar}" />
|
|
<CheckBox
|
|
u:FormItem.Label="Is Close Button Visible"
|
|
IsChecked="{Binding IsCloseButtonVisible}"
|
|
IsThreeState="True" />
|
|
<CheckBox u:FormItem.Label="Modal" IsChecked="{Binding IsModal}" />
|
|
<CheckBox u:FormItem.Label="CanDragMove" IsChecked="{Binding CanDragMove}" />
|
|
<Button
|
|
HorizontalAlignment="Left"
|
|
u:FormItem.NoLabel="True"
|
|
Command="{Binding ShowDialogCommand}"
|
|
Content="Show" />
|
|
</u:Form>
|
|
</TabItem>
|
|
<TabItem Header="Default Overlay Dialog">
|
|
<u:Form
|
|
Width="300"
|
|
Margin="16,0"
|
|
DataContext="{Binding DefaultOverlayDialogDemoViewModel}"
|
|
LabelPosition="Top">
|
|
<TextBox
|
|
HorizontalAlignment="Stretch"
|
|
u:FormItem.Label="Title"
|
|
Text="{Binding Title}" />
|
|
<u:EnumSelector
|
|
HorizontalAlignment="Stretch"
|
|
u:FormItem.Label="Dialog Mode"
|
|
EnumType="u:DialogMode"
|
|
Value="{Binding Mode}" />
|
|
<u:EnumSelector
|
|
HorizontalAlignment="Stretch"
|
|
u:FormItem.Label="Dialog Buttons"
|
|
EnumType="u:DialogButton"
|
|
Value="{Binding Button}" />
|
|
<CheckBox
|
|
u:FormItem.Label="Is Close Button Visible"
|
|
IsChecked="{Binding IsCloseButtonVisible}"
|
|
IsThreeState="True" />
|
|
<CheckBox u:FormItem.Label="Modal" IsChecked="{Binding IsModal}" />
|
|
<CheckBox u:FormItem.Label="Can DragMove" IsChecked="{Binding CanDragMove}" />
|
|
<CheckBox u:FormItem.Label="Can LightDismiss" IsChecked="{Binding CanLightDismiss}" />
|
|
<CheckBox u:FormItem.Label="FullScreen" IsChecked="{Binding FullScreen}" />
|
|
<ToggleSwitch
|
|
u:FormItem.Label="Global/Local OverlayHost"
|
|
IsChecked="{Binding IsLocal}"
|
|
OffContent="Global"
|
|
OnContent="Local" />
|
|
<Button
|
|
HorizontalAlignment="Left"
|
|
u:FormItem.NoLabel="True"
|
|
Command="{Binding ShowDialogCommand}"
|
|
Content="Show" />
|
|
</u:Form>
|
|
</TabItem>
|
|
<TabItem Header="Custom Overlay Dialog">
|
|
<u:Form
|
|
Width="300"
|
|
Margin="16,0"
|
|
DataContext="{Binding CustomOverlayDialogDemoViewModel}"
|
|
LabelPosition="Top">
|
|
<TextBox
|
|
HorizontalAlignment="Stretch"
|
|
u:FormItem.Label="Title"
|
|
Text="{Binding Title}" />
|
|
<CheckBox
|
|
u:FormItem.Label="Is Close Button Visible"
|
|
IsChecked="{Binding IsCloseButtonVisible}"
|
|
IsThreeState="True" />
|
|
<CheckBox u:FormItem.Label="Modal" IsChecked="{Binding IsModal}" />
|
|
<CheckBox u:FormItem.Label="Can DragMove" IsChecked="{Binding CanDragMove}" />
|
|
<CheckBox u:FormItem.Label="Can LightDismiss" IsChecked="{Binding CanLightDismiss}" />
|
|
<CheckBox u:FormItem.Label="FullScreen" IsChecked="{Binding FullScreen}" />
|
|
<ToggleSwitch
|
|
u:FormItem.Label="Global/Local OverlayHost"
|
|
IsChecked="{Binding IsLocal}"
|
|
OffContent="Global"
|
|
OnContent="Local" />
|
|
<Button
|
|
HorizontalAlignment="Left"
|
|
u:FormItem.NoLabel="True"
|
|
Command="{Binding ShowDialogCommand}"
|
|
Content="Show" />
|
|
</u:Form>
|
|
</TabItem>
|
|
</TabControl>
|
|
<Grid Grid.Column="1">
|
|
<Border
|
|
BorderBrush="{DynamicResource SemiGrey1}"
|
|
BorderThickness="1"
|
|
ClipToBounds="True"
|
|
CornerRadius="12">
|
|
<u:OverlayDialogHost HostId="{x:Static vm:DialogDemoViewModel.LocalHost}">
|
|
<u:OverlayDialogHost.DialogDataTemplates>
|
|
<DataTemplate DataType="x:String">
|
|
<TextBlock
|
|
Margin="24,24,48,24"
|
|
Foreground="Red"
|
|
Text="{Binding Path=.}" />
|
|
</DataTemplate>
|
|
</u:OverlayDialogHost.DialogDataTemplates>
|
|
</u:OverlayDialogHost>
|
|
</Border>
|
|
</Grid>
|
|
</Grid>
|
|
</UserControl>
|