close #624
This commit is contained in:
1 parent
9c9819af12
commit
74eaafc056
2 files changed
+20
-3
No files matched your search
@@ -5,14 +5,13 @@
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension"
|
||||
xmlns:data="clr-namespace:HandyControlDemo.Data"
|
||||
hc:Dialog.Token="{x:Static data:MessageToken.DialogDemoWindow}"
|
||||
DataContext="{Binding DialogDemo,Source={StaticResource Locator}}"
|
||||
Title="{ex:Lang Key={x:Static langs:LangKeys.DialogDemo}}"
|
||||
Width="800"
|
||||
Height="500">
|
||||
<hc:TransitioningContentControl>
|
||||
<StackPanel Margin="32" VerticalAlignment="Center">
|
||||
<Button Content="{ex:Lang Key={x:Static langs:LangKeys.ShowInCurrentWindow}}" Command="{Binding ShowWithTokenCmd}" CommandParameter="{x:Static data:MessageToken.DialogDemoWindow}"/>
|
||||
<Button Content="{ex:Lang Key={x:Static langs:LangKeys.ShowInCurrentWindow}}" Command="{Binding ShowWithTokenCmd}" CommandParameter="{Binding DialogToken,RelativeSource={RelativeSource AncestorType=Window}}"/>
|
||||
<Button Margin="0,10,0,0" Content="{ex:Lang Key={x:Static langs:LangKeys.ShowInMainWindow}}" Command="{Binding ShowWithTokenCmd}" CommandParameter="{x:Static data:MessageToken.MainWindow}"/>
|
||||
</StackPanel>
|
||||
</hc:TransitioningContentControl>
|
||||
|
||||
@@ -1,10 +1,28 @@
|
||||
namespace HandyControlDemo.Window
|
||||
using System;
|
||||
using System.Windows;
|
||||
using HandyControl.Controls;
|
||||
using HandyControlDemo.Data;
|
||||
|
||||
namespace HandyControlDemo.Window
|
||||
{
|
||||
public partial class DialogDemoWindow
|
||||
{
|
||||
public DialogDemoWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
var dialogToken = $"{MessageToken.DialogDemoWindow}+{DateTime.Now:yyyyMMddHHmmssfff}";
|
||||
DialogToken = dialogToken;
|
||||
Dialog.SetToken(this, dialogToken);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty DialogTokenProperty = DependencyProperty.Register(
|
||||
"DialogToken", typeof(string), typeof(DialogDemoWindow), new PropertyMetadata(default(string)));
|
||||
|
||||
public string DialogToken
|
||||
{
|
||||
get => (string) GetValue(DialogTokenProperty);
|
||||
set => SetValue(DialogTokenProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user