feat: add scrollviewer to dialog demo.

This commit is contained in:
Dong Bin
2025-02-27 16:43:59 +08:00
parent 50ac16ff23
commit c09fc6860d

View File

@@ -12,193 +12,195 @@
x:DataType="vm:DialogDemoViewModel" x:DataType="vm:DialogDemoViewModel"
mc:Ignorable="d"> mc:Ignorable="d">
<Grid ColumnDefinitions="Auto, *"> <Grid ColumnDefinitions="Auto, *">
<TabControl Grid.Column="0" TabStripPlacement="Left"> <ScrollViewer>
<TabItem Header="Default Window Dialog"> <TabControl Grid.Column="0" TabStripPlacement="Left">
<u:Form <TabItem Header="Default Window Dialog">
Width="300" <u:Form
Margin="16,0" Width="300"
DataContext="{Binding DefaultWindowDialogDemoViewModel}" Margin="16,0"
LabelPosition="Top"> DataContext="{Binding DefaultWindowDialogDemoViewModel}"
<TextBox LabelPosition="Top">
HorizontalAlignment="Stretch" <TextBox
u:FormItem.Label="Title" HorizontalAlignment="Stretch"
Text="{Binding Title}" /> u:FormItem.Label="Title"
<u:EnumSelector Text="{Binding Title}" />
HorizontalAlignment="Stretch" <u:EnumSelector
u:FormItem.Label="Startup Location" HorizontalAlignment="Stretch"
EnumType="WindowStartupLocation" u:FormItem.Label="Startup Location"
Value="{Binding Location}" /> EnumType="WindowStartupLocation"
<u:FormItem Label="PixelPosition"> Value="{Binding Location}" />
<UniformGrid Columns="2" Rows="1"> <u:FormItem Label="PixelPosition">
<u:NumericIntUpDown InnerLeftContent="X" Value="{Binding X}" /> <UniformGrid Columns="2" Rows="1">
<u:NumericIntUpDown InnerLeftContent="Y" Value="{Binding Y}" /> <u:NumericIntUpDown InnerLeftContent="X" Value="{Binding X}" />
</UniformGrid> <u:NumericIntUpDown InnerLeftContent="Y" Value="{Binding Y}" />
</u:FormItem> </UniformGrid>
<u:EnumSelector </u:FormItem>
HorizontalAlignment="Stretch" <u:EnumSelector
u:FormItem.Label="Dialog Mode" HorizontalAlignment="Stretch"
EnumType="u:DialogMode" u:FormItem.Label="Dialog Mode"
Value="{Binding Mode}" /> EnumType="u:DialogMode"
<u:EnumSelector Value="{Binding Mode}" />
HorizontalAlignment="Stretch" <u:EnumSelector
u:FormItem.Label="Dialog Buttons" HorizontalAlignment="Stretch"
EnumType="u:DialogButton" u:FormItem.Label="Dialog Buttons"
Value="{Binding Button}" /> EnumType="u:DialogButton"
<CheckBox u:FormItem.Label="Show In Taskbar" IsChecked="{Binding ShowInTaskBar}" /> Value="{Binding Button}" />
<CheckBox <CheckBox u:FormItem.Label="Show In Taskbar" IsChecked="{Binding ShowInTaskBar}" />
u:FormItem.Label="Is Close Button Visible" <CheckBox
IsChecked="{Binding IsCloseButtonVisible}" u:FormItem.Label="Is Close Button Visible"
IsThreeState="True" /> IsChecked="{Binding IsCloseButtonVisible}"
<CheckBox u:FormItem.Label="CanDragMove" IsChecked="{Binding CanDragMove}" /> IsThreeState="True" />
<CheckBox u:FormItem.Label="CanResize" IsChecked="{Binding CanResize}" /> <CheckBox u:FormItem.Label="CanDragMove" IsChecked="{Binding CanDragMove}" />
<u:FormItem> <CheckBox u:FormItem.Label="CanResize" IsChecked="{Binding CanResize}" />
<u:FormItem.Label> <u:FormItem>
<StackPanel Orientation="Horizontal"> <u:FormItem.Label>
<TextBlock Text="Style Class" /> <StackPanel Orientation="Horizontal">
<PathIcon <TextBlock Text="Style Class" />
Theme="{StaticResource InnerPathIcon}" <PathIcon
VerticalAlignment="Center" VerticalAlignment="Center"
TextElement.FontWeight="Normal" Data="{DynamicResource SemiIconHelpCircle}"
Data="{DynamicResource SemiIconHelpCircle}" TextElement.FontWeight="Normal"
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" /> Theme="{StaticResource InnerPathIcon}"
</StackPanel> 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" />
</u:FormItem.Label> </StackPanel>
<TextBox HorizontalAlignment="Stretch" Text="{Binding StyleClass}" /> </u:FormItem.Label>
</u:FormItem> <TextBox HorizontalAlignment="Stretch" Text="{Binding StyleClass}" />
<Button </u:FormItem>
HorizontalAlignment="Left" <Button
u:FormItem.NoLabel="True" HorizontalAlignment="Left"
Command="{Binding ShowDialogCommand}" u:FormItem.NoLabel="True"
Content="Show" /> Command="{Binding ShowDialogCommand}"
</u:Form> Content="Show" />
</TabItem> </u:Form>
<TabItem Header="Custom Window Dialog"> </TabItem>
<u:Form <TabItem Header="Custom Window Dialog">
Width="300" <u:Form
Margin="16,0" Width="300"
DataContext="{Binding CustomWindowDialogDemoViewModel}" Margin="16,0"
LabelPosition="Top"> DataContext="{Binding CustomWindowDialogDemoViewModel}"
<TextBox LabelPosition="Top">
HorizontalAlignment="Stretch" <TextBox
u:FormItem.Label="Title" HorizontalAlignment="Stretch"
Text="{Binding Title}" /> u:FormItem.Label="Title"
<u:EnumSelector Text="{Binding Title}" />
HorizontalAlignment="Stretch" <u:EnumSelector
u:FormItem.Label="Startup Location" HorizontalAlignment="Stretch"
EnumType="WindowStartupLocation" u:FormItem.Label="Startup Location"
Value="{Binding Location}" /> EnumType="WindowStartupLocation"
<u:FormItem Label="PixelPosition"> Value="{Binding Location}" />
<UniformGrid Columns="2" Rows="1"> <u:FormItem Label="PixelPosition">
<u:NumericIntUpDown InnerLeftContent="X" Value="{Binding X}" /> <UniformGrid Columns="2" Rows="1">
<u:NumericIntUpDown InnerLeftContent="Y" Value="{Binding Y}" /> <u:NumericIntUpDown InnerLeftContent="X" Value="{Binding X}" />
</UniformGrid> <u:NumericIntUpDown InnerLeftContent="Y" Value="{Binding Y}" />
</u:FormItem> </UniformGrid>
<CheckBox u:FormItem.Label="Show In Taskbar" IsChecked="{Binding ShowInTaskBar}" /> </u:FormItem>
<CheckBox <CheckBox u:FormItem.Label="Show In Taskbar" IsChecked="{Binding ShowInTaskBar}" />
u:FormItem.Label="Is Close Button Visible" <CheckBox
IsChecked="{Binding IsCloseButtonVisible}" u:FormItem.Label="Is Close Button Visible"
IsThreeState="True" /> IsChecked="{Binding IsCloseButtonVisible}"
<CheckBox u:FormItem.Label="Modal" IsChecked="{Binding IsModal}" /> IsThreeState="True" />
<CheckBox u:FormItem.Label="CanDragMove" IsChecked="{Binding CanDragMove}" /> <CheckBox u:FormItem.Label="Modal" IsChecked="{Binding IsModal}" />
<CheckBox u:FormItem.Label="CanResize" IsChecked="{Binding CanResize}" /> <CheckBox u:FormItem.Label="CanDragMove" IsChecked="{Binding CanDragMove}" />
<Button <CheckBox u:FormItem.Label="CanResize" IsChecked="{Binding CanResize}" />
HorizontalAlignment="Left" <Button
u:FormItem.NoLabel="True" HorizontalAlignment="Left"
Command="{Binding ShowDialogCommand}" u:FormItem.NoLabel="True"
Content="Show" /> Command="{Binding ShowDialogCommand}"
</u:Form> Content="Show" />
</TabItem> </u:Form>
<TabItem Header="Default Overlay Dialog"> </TabItem>
<u:Form <TabItem Header="Default Overlay Dialog">
Width="300" <u:Form
Margin="16,0" Width="300"
DataContext="{Binding DefaultOverlayDialogDemoViewModel}" Margin="16,0"
LabelPosition="Top"> DataContext="{Binding DefaultOverlayDialogDemoViewModel}"
<TextBox LabelPosition="Top">
HorizontalAlignment="Stretch" <TextBox
u:FormItem.Label="Title" HorizontalAlignment="Stretch"
Text="{Binding Title}" /> u:FormItem.Label="Title"
<u:EnumSelector Text="{Binding Title}" />
HorizontalAlignment="Stretch" <u:EnumSelector
u:FormItem.Label="Dialog Mode" HorizontalAlignment="Stretch"
EnumType="u:DialogMode" u:FormItem.Label="Dialog Mode"
Value="{Binding Mode}" /> EnumType="u:DialogMode"
<u:EnumSelector Value="{Binding Mode}" />
HorizontalAlignment="Stretch" <u:EnumSelector
u:FormItem.Label="Dialog Buttons" HorizontalAlignment="Stretch"
EnumType="u:DialogButton" u:FormItem.Label="Dialog Buttons"
Value="{Binding Button}" /> EnumType="u:DialogButton"
<CheckBox Value="{Binding Button}" />
u:FormItem.Label="Is Close Button Visible" <CheckBox
IsChecked="{Binding IsCloseButtonVisible}" u:FormItem.Label="Is Close Button Visible"
IsThreeState="True" /> IsChecked="{Binding IsCloseButtonVisible}"
<CheckBox u:FormItem.Label="Modal" IsChecked="{Binding IsModal}" /> IsThreeState="True" />
<CheckBox u:FormItem.Label="Can DragMove" IsChecked="{Binding CanDragMove}" /> <CheckBox u:FormItem.Label="Modal" IsChecked="{Binding IsModal}" />
<CheckBox u:FormItem.Label="Can LightDismiss" IsChecked="{Binding CanLightDismiss}" /> <CheckBox u:FormItem.Label="Can DragMove" IsChecked="{Binding CanDragMove}" />
<CheckBox u:FormItem.Label="FullScreen" IsChecked="{Binding FullScreen}" /> <CheckBox u:FormItem.Label="Can LightDismiss" IsChecked="{Binding CanLightDismiss}" />
<CheckBox u:FormItem.Label="CanResize" IsChecked="{Binding CanResize}" /> <CheckBox u:FormItem.Label="FullScreen" IsChecked="{Binding FullScreen}" />
<ToggleSwitch <CheckBox u:FormItem.Label="CanResize" IsChecked="{Binding CanResize}" />
u:FormItem.Label="Global/Local OverlayHost" <ToggleSwitch
IsChecked="{Binding IsLocal}" u:FormItem.Label="Global/Local OverlayHost"
OffContent="Global" IsChecked="{Binding IsLocal}"
OnContent="Local" /> OffContent="Global"
<u:FormItem> OnContent="Local" />
<u:FormItem.Label> <u:FormItem>
<StackPanel Orientation="Horizontal"> <u:FormItem.Label>
<TextBlock Text="Style Class" /> <StackPanel Orientation="Horizontal">
<PathIcon <TextBlock Text="Style Class" />
Theme="{StaticResource InnerPathIcon}" <PathIcon
VerticalAlignment="Center" VerticalAlignment="Center"
TextElement.FontWeight="Normal" Data="{DynamicResource SemiIconHelpCircle}"
Data="{DynamicResource SemiIconHelpCircle}" TextElement.FontWeight="Normal"
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" /> Theme="{StaticResource InnerPathIcon}"
</StackPanel> 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" />
</u:FormItem.Label> </StackPanel>
<TextBox HorizontalAlignment="Stretch" Text="{Binding StyleClass}" /> </u:FormItem.Label>
</u:FormItem> <TextBox HorizontalAlignment="Stretch" Text="{Binding StyleClass}" />
<Button </u:FormItem>
HorizontalAlignment="Left" <Button
u:FormItem.NoLabel="True" HorizontalAlignment="Left"
Command="{Binding ShowDialogCommand}" u:FormItem.NoLabel="True"
Content="Show" /> Command="{Binding ShowDialogCommand}"
</u:Form> Content="Show" />
</TabItem> </u:Form>
<TabItem Header="Custom Overlay Dialog"> </TabItem>
<u:Form <TabItem Header="Custom Overlay Dialog">
Width="300" <u:Form
Margin="16,0" Width="300"
DataContext="{Binding CustomOverlayDialogDemoViewModel}" Margin="16,0"
LabelPosition="Top"> DataContext="{Binding CustomOverlayDialogDemoViewModel}"
<TextBox LabelPosition="Top">
HorizontalAlignment="Stretch" <TextBox
u:FormItem.Label="Title" HorizontalAlignment="Stretch"
Text="{Binding Title}" /> u:FormItem.Label="Title"
<CheckBox Text="{Binding Title}" />
u:FormItem.Label="Is Close Button Visible" <CheckBox
IsChecked="{Binding IsCloseButtonVisible}" u:FormItem.Label="Is Close Button Visible"
IsThreeState="True" /> IsChecked="{Binding IsCloseButtonVisible}"
<CheckBox u:FormItem.Label="Modal" IsChecked="{Binding IsModal}" /> IsThreeState="True" />
<CheckBox u:FormItem.Label="Can DragMove" IsChecked="{Binding CanDragMove}" /> <CheckBox u:FormItem.Label="Modal" IsChecked="{Binding IsModal}" />
<CheckBox u:FormItem.Label="Can LightDismiss" IsChecked="{Binding CanLightDismiss}" /> <CheckBox u:FormItem.Label="Can DragMove" IsChecked="{Binding CanDragMove}" />
<CheckBox u:FormItem.Label="FullScreen" IsChecked="{Binding FullScreen}" /> <CheckBox u:FormItem.Label="Can LightDismiss" IsChecked="{Binding CanLightDismiss}" />
<CheckBox u:FormItem.Label="CanResize" IsChecked="{Binding CanResize}" /> <CheckBox u:FormItem.Label="FullScreen" IsChecked="{Binding FullScreen}" />
<ToggleSwitch <CheckBox u:FormItem.Label="CanResize" IsChecked="{Binding CanResize}" />
u:FormItem.Label="Global/Local OverlayHost" <ToggleSwitch
IsChecked="{Binding IsLocal}" u:FormItem.Label="Global/Local OverlayHost"
OffContent="Global" IsChecked="{Binding IsLocal}"
OnContent="Local" /> OffContent="Global"
<Button OnContent="Local" />
HorizontalAlignment="Left" <Button
u:FormItem.NoLabel="True" HorizontalAlignment="Left"
Command="{Binding ShowDialogCommand}" u:FormItem.NoLabel="True"
Content="Show" /> Command="{Binding ShowDialogCommand}"
</u:Form> Content="Show" />
</TabItem> </u:Form>
</TabControl> </TabItem>
</TabControl>
</ScrollViewer>
<Grid Grid.Column="1"> <Grid Grid.Column="1">
<Border <Border
BorderBrush="{DynamicResource SemiGrey1}"
Background="{DynamicResource SemiColorBackground1}" Background="{DynamicResource SemiColorBackground1}"
BorderBrush="{DynamicResource SemiGrey1}"
BorderThickness="1" BorderThickness="1"
ClipToBounds="True" ClipToBounds="True"
CornerRadius="12"> CornerRadius="12">