221 lines
12 KiB
XML
221 lines
12 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, *">
|
|
<ScrollViewer>
|
|
<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}" />
|
|
<CheckBox u:FormItem.Label="CanResize" IsChecked="{Binding CanResize}" />
|
|
<u:FormItem>
|
|
<u:FormItem.Label>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Text="Style Class" />
|
|
<PathIcon
|
|
VerticalAlignment="Center"
|
|
Data="{DynamicResource SemiIconHelpCircle}"
|
|
TextElement.FontWeight="Normal"
|
|
Theme="{StaticResource InnerPathIcon}"
|
|
ToolTip.Tip="Pass a Style Class to the created Dialog. In this example, if you set StyleClass as 'Custom', You will get Special Style for OK Button. These styles usually are defined in the root of your App/Window" />
|
|
</StackPanel>
|
|
</u:FormItem.Label>
|
|
<TextBox HorizontalAlignment="Stretch" Text="{Binding StyleClass}" />
|
|
</u:FormItem>
|
|
<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}" />
|
|
<CheckBox u:FormItem.Label="CanResize" IsChecked="{Binding CanResize}" />
|
|
<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}" />
|
|
<CheckBox u:FormItem.Label="CanResize" IsChecked="{Binding CanResize}" />
|
|
<ToggleSwitch
|
|
u:FormItem.Label="Global/Local OverlayHost"
|
|
IsChecked="{Binding IsLocal}"
|
|
OffContent="Global"
|
|
OnContent="Local" />
|
|
<u:FormItem>
|
|
<u:FormItem.Label>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Text="Style Class" />
|
|
<PathIcon
|
|
VerticalAlignment="Center"
|
|
Data="{DynamicResource SemiIconHelpCircle}"
|
|
TextElement.FontWeight="Normal"
|
|
Theme="{StaticResource InnerPathIcon}"
|
|
ToolTip.Tip="Pass a Style Class to the created Dialog. In this example, if you set StyleClass as 'Custom', You will get Special Style for OK Button. These styles usually are defined in the root of your App/Window" />
|
|
</StackPanel>
|
|
</u:FormItem.Label>
|
|
<TextBox HorizontalAlignment="Stretch" Text="{Binding StyleClass}" />
|
|
</u:FormItem>
|
|
<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}" />
|
|
<CheckBox u:FormItem.Label="CanResize" IsChecked="{Binding CanResize}" />
|
|
<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>
|
|
</ScrollViewer>
|
|
<Grid Grid.Column="1">
|
|
<Border
|
|
Background="{DynamicResource SemiColorBackground1}"
|
|
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>
|