Files
HandyControl/src/Shared/HandyControlDemo_Shared/UserControl/Controls/DialogDemoCtl.xaml
T
2020-05-25 23:09:15 +08:00

32 lines
2.3 KiB
XML

<UserControl x:Class="HandyControlDemo.UserControl.DialogDemoCtl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:data="clr-namespace:HandyControlDemo.Data"
xmlns:system="clr-namespace:System;assembly=System.Runtime"
hc:Dialog.Token="{x:Static data:MessageToken.DialogContainer}"
Background="{DynamicResource RegionBrush}"
MinWidth="500"
DataContext="{Binding DialogDemo,Source={StaticResource Locator}}">
<hc:DialogContainer>
<hc:TransitioningContentControl>
<hc:SimplePanel>
<StackPanel Margin="32" VerticalAlignment="Center">
<Button Content="{ex:Lang Key={x:Static langs:LangKeys.TextDialog}}" Command="{Binding ShowTextCmd}" />
<Button Margin="0,32,0,0" Content="{ex:Lang Key={x:Static langs:LangKeys.TextDialogInControl}}" Command="{Binding ShowTextCmd}" CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType=UserControl}}"/>
<Button Margin="0,32,0,0" Content="{ex:Lang Key={x:Static langs:LangKeys.TextDialogWithTimer}}" Command="{Binding ShowInteractiveDialogCmd}">
<Button.CommandParameter>
<system:Boolean>True</system:Boolean>
</Button.CommandParameter>
</Button>
<TextBox Margin="0,32,0,0" Text="{Binding DialogResult,UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource TextBoxExtend}" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PleaseInput}}"/>
<Button Margin="0,10,0,0" Content="{ex:Lang Key={x:Static langs:LangKeys.InteractiveDialog}}" Command="{Binding ShowInteractiveDialogCmd}"/>
<Button Margin="0,32,0,0" Content="{ex:Lang Key={x:Static langs:LangKeys.NewWindow}}" Command="{Binding NewWindowCmd}"/>
</StackPanel>
</hc:SimplePanel>
</hc:TransitioningContentControl>
</hc:DialogContainer>
</UserControl>