25 files changed
+247
-12
No files matched your search
@@ -1,9 +1,69 @@
|
|||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using HandyControl.Interactivity;
|
||||||
|
using HandyControl.Tools;
|
||||||
|
|
||||||
namespace HandyControl.Controls
|
namespace HandyControl.Controls
|
||||||
{
|
{
|
||||||
public class Dialog : ContentControl
|
public class Dialog : ContentControl
|
||||||
{
|
{
|
||||||
|
private Adorner _container;
|
||||||
|
|
||||||
|
public Dialog()
|
||||||
|
{
|
||||||
|
CommandBindings.Add(new CommandBinding(ControlCommands.Close, (s, e) => Close()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Dialog Show(object content)
|
||||||
|
{
|
||||||
|
var dialog = new Dialog
|
||||||
|
{
|
||||||
|
Content = content
|
||||||
|
};
|
||||||
|
|
||||||
|
var window = VisualHelper.GetActiveWindow();
|
||||||
|
if (window != null)
|
||||||
|
{
|
||||||
|
var decorator = VisualHelper.GetChild<AdornerDecorator>(window);
|
||||||
|
if (decorator != null)
|
||||||
|
{
|
||||||
|
if (decorator.Child != null)
|
||||||
|
{
|
||||||
|
decorator.Child.IsEnabled = false;
|
||||||
|
}
|
||||||
|
var layer = decorator.AdornerLayer;
|
||||||
|
if (layer != null)
|
||||||
|
{
|
||||||
|
var container = new AdornerContainer(layer)
|
||||||
|
{
|
||||||
|
Child = dialog
|
||||||
|
};
|
||||||
|
dialog._container = container;
|
||||||
|
layer.Add(container);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return dialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Close()
|
||||||
|
{
|
||||||
|
var window = VisualHelper.GetActiveWindow();
|
||||||
|
if (window != null)
|
||||||
|
{
|
||||||
|
var decorator = VisualHelper.GetChild<AdornerDecorator>(window);
|
||||||
|
if (decorator != null)
|
||||||
|
{
|
||||||
|
if (decorator.Child != null)
|
||||||
|
{
|
||||||
|
decorator.Child.IsEnabled = true;
|
||||||
|
}
|
||||||
|
var layer = decorator.AdornerLayer;
|
||||||
|
layer?.Remove(_container);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -30,7 +30,7 @@ namespace HandyControl.Controls
|
|||||||
{
|
{
|
||||||
_scrollViewer.ScrollChanged -= ScrollViewer_ScrollChanged;
|
_scrollViewer.ScrollChanged -= ScrollViewer_ScrollChanged;
|
||||||
}
|
}
|
||||||
_scrollViewer = VisualHelper.GetGetChild<System.Windows.Controls.ScrollViewer>(obj);
|
_scrollViewer = VisualHelper.GetChild<System.Windows.Controls.ScrollViewer>(obj);
|
||||||
if (_scrollViewer != null)
|
if (_scrollViewer != null)
|
||||||
{
|
{
|
||||||
_scrollViewer.ScrollChanged += ScrollViewer_ScrollChanged;
|
_scrollViewer.ScrollChanged += ScrollViewer_ScrollChanged;
|
||||||
|
|||||||
@@ -398,6 +398,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="Themes\Styles\Base\DialogBaseStyle.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="Themes\Styles\Base\GotoTopBaseStyle.xaml">
|
<Page Include="Themes\Styles\Base\GotoTopBaseStyle.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@@ -450,6 +454,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="Themes\Styles\Dialog.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="Themes\Styles\FlipClock.xaml">
|
<Page Include="Themes\Styles\FlipClock.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|||||||
@@ -14,8 +14,7 @@ namespace HandyControl.Interactivity
|
|||||||
|
|
||||||
public UIElement Child
|
public UIElement Child
|
||||||
{
|
{
|
||||||
get =>
|
get => _child;
|
||||||
_child;
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
AddVisualChild(value);
|
AddVisualChild(value);
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||||
|
|
||||||
|
<Style x:Key="DialogBaseStyle" TargetType="controls:Dialog">
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="controls:Dialog">
|
||||||
|
<Border Background="{DynamicResource DarkOpacityBrush}">
|
||||||
|
<ContentPresenter Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||||
|
|
||||||
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
<ResourceDictionary Source="Base/DialogBaseStyle.xaml"/>
|
||||||
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
|
||||||
|
<Style BasedOn="{StaticResource DialogBaseStyle}" TargetType="controls:Dialog"/>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -60,6 +60,7 @@
|
|||||||
<ResourceDictionary Source="GotoTop.xaml"/>
|
<ResourceDictionary Source="GotoTop.xaml"/>
|
||||||
<ResourceDictionary Source="Gravatar.xaml"/>
|
<ResourceDictionary Source="Gravatar.xaml"/>
|
||||||
<ResourceDictionary Source="Badge.xaml"/>
|
<ResourceDictionary Source="Badge.xaml"/>
|
||||||
|
<ResourceDictionary Source="Dialog.xaml"/>
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -27,18 +27,18 @@ namespace HandyControl.Tools
|
|||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static T GetGetChild<T>(DependencyObject d) where T : DependencyObject
|
internal static T GetChild<T>(DependencyObject d) where T : DependencyObject
|
||||||
{
|
{
|
||||||
if (d is T scrollViewer)
|
if (d is T t)
|
||||||
{
|
{
|
||||||
return scrollViewer;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(d); i++)
|
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(d); i++)
|
||||||
{
|
{
|
||||||
var child = VisualTreeHelper.GetChild(d, i);
|
var child = VisualTreeHelper.GetChild(d, i);
|
||||||
|
|
||||||
var result = GetGetChild<T>(child);
|
var result = GetChild<T>(child);
|
||||||
if (result != null) return result;
|
if (result != null) return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
<ObjectDataProvider x:Key="DemoTypes" MethodName="GetValues" ObjectType="sys:Enum">
|
<ObjectDataProvider x:Key="DemoTypes" MethodName="GetValues" ObjectType="sys:Enum">
|
||||||
<ObjectDataProvider.MethodParameters>
|
<ObjectDataProvider.MethodParameters>
|
||||||
<x:Type Type="data:DemoType"></x:Type>
|
<x:Type Type="data:DemoType"/>
|
||||||
</ObjectDataProvider.MethodParameters>
|
</ObjectDataProvider.MethodParameters>
|
||||||
</ObjectDataProvider>
|
</ObjectDataProvider>
|
||||||
|
|
||||||
|
|||||||
@@ -88,6 +88,8 @@
|
|||||||
|
|
||||||
public static readonly string GravatarDemoCtl = nameof(GravatarDemoCtl);
|
public static readonly string GravatarDemoCtl = nameof(GravatarDemoCtl);
|
||||||
|
|
||||||
|
public static readonly string DialogDemoCtl = nameof(DialogDemoCtl);
|
||||||
|
|
||||||
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
|
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
|
||||||
|
|
||||||
public static readonly string ToggleButtonDemoCtl = nameof(ToggleButtonDemoCtl);
|
public static readonly string ToggleButtonDemoCtl = nameof(ToggleButtonDemoCtl);
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ var controlList = new List<string>
|
|||||||
"ChatBubbleDemoCtl",
|
"ChatBubbleDemoCtl",
|
||||||
"GotoTopDemoCtl",
|
"GotoTopDemoCtl",
|
||||||
"BadgeDemoCtl",
|
"BadgeDemoCtl",
|
||||||
"GravatarDemoCtl"
|
"GravatarDemoCtl",
|
||||||
|
"DialogDemoCtl"
|
||||||
};
|
};
|
||||||
var styleList = new List<string>
|
var styleList = new List<string>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -130,6 +130,9 @@
|
|||||||
<Compile Include="UserControl\Basic\ChatBox.xaml.cs">
|
<Compile Include="UserControl\Basic\ChatBox.xaml.cs">
|
||||||
<DependentUpon>ChatBox.xaml</DependentUpon>
|
<DependentUpon>ChatBox.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="UserControl\Basic\TextDialog.xaml.cs">
|
||||||
|
<DependentUpon>TextDialog.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="UserControl\Controls\AnimationPathDemoCtl.xaml.cs">
|
<Compile Include="UserControl\Controls\AnimationPathDemoCtl.xaml.cs">
|
||||||
<DependentUpon>AnimationPathDemoCtl.xaml</DependentUpon>
|
<DependentUpon>AnimationPathDemoCtl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -148,6 +151,9 @@
|
|||||||
<Compile Include="UserControl\Controls\CirclePanelDemoCtl.xaml.cs">
|
<Compile Include="UserControl\Controls\CirclePanelDemoCtl.xaml.cs">
|
||||||
<DependentUpon>CirclePanelDemoCtl.xaml</DependentUpon>
|
<DependentUpon>CirclePanelDemoCtl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="UserControl\Controls\DialogDemoCtl.xaml.cs">
|
||||||
|
<DependentUpon>DialogDemoCtl.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="UserControl\Controls\ProgressBarDemoCtl.xaml.cs">
|
<Compile Include="UserControl\Controls\ProgressBarDemoCtl.xaml.cs">
|
||||||
<DependentUpon>ProgressBarDemoCtl.xaml</DependentUpon>
|
<DependentUpon>ProgressBarDemoCtl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -352,6 +358,7 @@
|
|||||||
<Compile Include="ViewModel\Basic\ChatBoxViewModel.cs" />
|
<Compile Include="ViewModel\Basic\ChatBoxViewModel.cs" />
|
||||||
<Compile Include="ViewModel\Common\ComboBoxDemoViewModel.cs" />
|
<Compile Include="ViewModel\Common\ComboBoxDemoViewModel.cs" />
|
||||||
<Compile Include="ViewModel\Controls\CoverViewModel.cs" />
|
<Compile Include="ViewModel\Controls\CoverViewModel.cs" />
|
||||||
|
<Compile Include="ViewModel\Controls\DialogDemoViewModel.cs" />
|
||||||
<Compile Include="ViewModel\DemoViewModelBase!1.cs" />
|
<Compile Include="ViewModel\DemoViewModelBase!1.cs" />
|
||||||
<Compile Include="ViewModel\Main\ContributorsViewModel.cs" />
|
<Compile Include="ViewModel\Main\ContributorsViewModel.cs" />
|
||||||
<Compile Include="ViewModel\Controls\GrowlDemoViewModel.cs" />
|
<Compile Include="ViewModel\Controls\GrowlDemoViewModel.cs" />
|
||||||
@@ -440,6 +447,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="UserControl\Basic\TextDialog.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="UserControl\Controls\AnimationPathDemoCtl.xaml">
|
<Page Include="UserControl\Controls\AnimationPathDemoCtl.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@@ -464,6 +475,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="UserControl\Controls\DialogDemoCtl.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="UserControl\Controls\ProgressBarDemoCtl.xaml">
|
<Page Include="UserControl\Controls\ProgressBarDemoCtl.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@@ -774,6 +789,7 @@
|
|||||||
<Generator>TextTemplatingFileGenerator</Generator>
|
<Generator>TextTemplatingFileGenerator</Generator>
|
||||||
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Resource Include="Resources\Img\LeftMainContent\Dialog_16x.png" />
|
||||||
<Resource Include="Resources\Img\under_construction.gif" />
|
<Resource Include="Resources\Img\under_construction.gif" />
|
||||||
<Resource Include="Resources\Img\LeftMainContent\User_16x.png" />
|
<Resource Include="Resources\Img\LeftMainContent\User_16x.png" />
|
||||||
<Resource Include="Resources\Img\LeftMainContent\DotLarge_16x.png" />
|
<Resource Include="Resources\Img\LeftMainContent\DotLarge_16x.png" />
|
||||||
|
|||||||
+27
@@ -393,6 +393,15 @@ namespace HandyControlDemo.Properties.Langs {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 对话框 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string Dialog {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Dialog", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 在这里拖拽 的本地化字符串。
|
/// 查找类似 在这里拖拽 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -789,6 +798,15 @@ namespace HandyControlDemo.Properties.Langs {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 请稍后... 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string PleaseWait {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("PleaseWait", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 请输入内容 的本地化字符串。
|
/// 查找类似 请输入内容 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1104,6 +1122,15 @@ namespace HandyControlDemo.Properties.Langs {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 文本对话框 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string TextDialog {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("TextDialog", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 时间条 的本地化字符串。
|
/// 查找类似 时间条 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -513,4 +513,13 @@
|
|||||||
<data name="Reply" xml:space="preserve">
|
<data name="Reply" xml:space="preserve">
|
||||||
<value>Reply</value>
|
<value>Reply</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Dialog" xml:space="preserve">
|
||||||
|
<value>Dialog</value>
|
||||||
|
</data>
|
||||||
|
<data name="TextDialog" xml:space="preserve">
|
||||||
|
<value>TextDialog</value>
|
||||||
|
</data>
|
||||||
|
<data name="PleaseWait" xml:space="preserve">
|
||||||
|
<value>Please wait...</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -513,4 +513,13 @@
|
|||||||
<data name="Reply" xml:space="preserve">
|
<data name="Reply" xml:space="preserve">
|
||||||
<value>回复</value>
|
<value>回复</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Dialog" xml:space="preserve">
|
||||||
|
<value>对话框</value>
|
||||||
|
</data>
|
||||||
|
<data name="TextDialog" xml:space="preserve">
|
||||||
|
<value>文本对话框</value>
|
||||||
|
</data>
|
||||||
|
<data name="PleaseWait" xml:space="preserve">
|
||||||
|
<value>请稍后...</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 183 B |
@@ -0,0 +1,15 @@
|
|||||||
|
<Border x:Class="HandyControlDemo.UserControl.TextDialog"
|
||||||
|
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:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
|
||||||
|
xmlns:interactivity="clr-namespace:HandyControl.Interactivity;assembly=HandyControl"
|
||||||
|
CornerRadius="10"
|
||||||
|
Width="400"
|
||||||
|
Height="247"
|
||||||
|
Background="{DynamicResource RegionBrush}">
|
||||||
|
<Grid>
|
||||||
|
<TextBlock Style="{StaticResource TextBlockLargeBold}" Text="{x:Static langs:Lang.PleaseWait}"/>
|
||||||
|
<Button Width="22" Height="22" Command="interactivity:ControlCommands.Close" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource PrimaryBrush}" controls:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,4,4,0"/>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace HandyControlDemo.UserControl
|
||||||
|
{
|
||||||
|
public partial class TextDialog
|
||||||
|
{
|
||||||
|
public TextDialog()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<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"
|
||||||
|
Background="{DynamicResource RegionBrush}"
|
||||||
|
DataContext="{Binding DialogDemo,Source={StaticResource Locator}}">
|
||||||
|
<Button Margin="32" Content="{x:Static langs:Lang.TextDialog}" Command="{Binding ShowTextCmd}"/>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
namespace HandyControlDemo.UserControl
|
||||||
|
{
|
||||||
|
public partial class DialogDemoCtl
|
||||||
|
{
|
||||||
|
public DialogDemoCtl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -208,7 +208,7 @@
|
|||||||
<Image Source="../../Resources/Img/LeftMainContent/ProgressButton_16x.png"/>
|
<Image Source="../../Resources/Img/LeftMainContent/ProgressButton_16x.png"/>
|
||||||
</controls:EdgeElement.LeftContent>
|
</controls:EdgeElement.LeftContent>
|
||||||
</ListBoxItem>
|
</ListBoxItem>
|
||||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.ChatBubbleDemoCtl}" Content="{x:Static langs:Lang.ChatBubble}">
|
<ListBoxItem Tag="{x:Static data:MessageToken.ChatBubbleDemoCtl}" Content="{x:Static langs:Lang.ChatBubble}">
|
||||||
<controls:EdgeElement.LeftContent>
|
<controls:EdgeElement.LeftContent>
|
||||||
<Image Source="../../Resources/Img/LeftMainContent/Bubble_16xLG.png"/>
|
<Image Source="../../Resources/Img/LeftMainContent/Bubble_16xLG.png"/>
|
||||||
</controls:EdgeElement.LeftContent>
|
</controls:EdgeElement.LeftContent>
|
||||||
@@ -388,6 +388,11 @@
|
|||||||
<Image Source="../../Resources/Img/LeftMainContent/ScrollBox_16x.png"/>
|
<Image Source="../../Resources/Img/LeftMainContent/ScrollBox_16x.png"/>
|
||||||
</controls:EdgeElement.LeftContent>
|
</controls:EdgeElement.LeftContent>
|
||||||
</ListBoxItem>
|
</ListBoxItem>
|
||||||
|
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.DialogDemoCtl}" Content="{x:Static langs:Lang.Dialog}">
|
||||||
|
<controls:EdgeElement.LeftContent>
|
||||||
|
<Image Source="../../Resources/Img/LeftMainContent/Dialog_16x.png"/>
|
||||||
|
</controls:EdgeElement.LeftContent>
|
||||||
|
</ListBoxItem>
|
||||||
<ListBoxItem Tag="{x:Static data:MessageToken.WindowDemoCtl}" Content="{x:Static langs:Lang.Window}">
|
<ListBoxItem Tag="{x:Static data:MessageToken.WindowDemoCtl}" Content="{x:Static langs:Lang.Window}">
|
||||||
<controls:EdgeElement.LeftContent>
|
<controls:EdgeElement.LeftContent>
|
||||||
<Image Source="../../Resources/Img/LeftMainContent/WindowsForm_16x.png"/>
|
<Image Source="../../Resources/Img/LeftMainContent/WindowsForm_16x.png"/>
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using GalaSoft.MvvmLight;
|
||||||
|
using GalaSoft.MvvmLight.CommandWpf;
|
||||||
|
using HandyControl.Controls;
|
||||||
|
using HandyControlDemo.UserControl;
|
||||||
|
|
||||||
|
namespace HandyControlDemo.ViewModel
|
||||||
|
{
|
||||||
|
public class DialogDemoViewModel : ViewModelBase
|
||||||
|
{
|
||||||
|
public RelayCommand ShowTextCmd => new Lazy<RelayCommand>(() =>
|
||||||
|
new RelayCommand(ShowText)).Value;
|
||||||
|
|
||||||
|
private void ShowText()
|
||||||
|
{
|
||||||
|
Dialog.Show(new TextDialog());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,6 +24,7 @@ namespace HandyControlDemo.ViewModel
|
|||||||
SimpleIoc.Default.Register<PaginationDemoViewModel>();
|
SimpleIoc.Default.Register<PaginationDemoViewModel>();
|
||||||
SimpleIoc.Default.Register<ChatBoxViewModel>();
|
SimpleIoc.Default.Register<ChatBoxViewModel>();
|
||||||
SimpleIoc.Default.Register<CoverViewModel>();
|
SimpleIoc.Default.Register<CoverViewModel>();
|
||||||
|
SimpleIoc.Default.Register<DialogDemoViewModel>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ViewModelLocator Instance => new Lazy<ViewModelLocator>(() =>
|
public static ViewModelLocator Instance => new Lazy<ViewModelLocator>(() =>
|
||||||
@@ -51,6 +52,8 @@ namespace HandyControlDemo.ViewModel
|
|||||||
|
|
||||||
public CoverViewModel CoverView => ServiceLocator.Current.GetInstance<CoverViewModel>();
|
public CoverViewModel CoverView => ServiceLocator.Current.GetInstance<CoverViewModel>();
|
||||||
|
|
||||||
|
public DialogDemoViewModel DialogDemo => ServiceLocator.Current.GetInstance<DialogDemoViewModel>();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -39,6 +39,10 @@ Step 3:enjoy coding
|
|||||||
|
|
||||||
## Latest examples
|
## Latest examples
|
||||||
|
|
||||||
|
### Dialog
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
### WaveProgressBar
|
### WaveProgressBar
|
||||||
|
|
||||||

|

|
||||||
@@ -55,12 +59,12 @@ Step 3:enjoy coding
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
## History publication
|
||||||
|
|
||||||
### Transfer
|
### Transfer
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## History publication
|
|
||||||
|
|
||||||
### ProgressButton
|
### ProgressButton
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
Reference in new issue
Block a user