updated DialogDemo
This commit is contained in:
1 parent
e4ae2d21d1
commit
cb4f5b4907
12 files changed
+96
-17
No files matched your search
@@ -37,7 +37,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<ToggleButton Name="ToggleButtonAudio" hc:BorderElement.CornerRadius="15" Width="30" Height="30" Padding="7" Margin="6" hc:IconSwitchElement.Geometry="{StaticResource AudioGeometry}" hc:IconSwitchElement.GeometrySelected="{StaticResource KeyboardGeometry}" Style="{StaticResource ToggleButtonIcon}"/>
|
||||
<Button Command="{Binding OpenImageCmd}" Grid.Column="2" Margin="6,0,6,0" hc:BorderElement.CornerRadius="15" Width="30" Height="30" Padding="7" hc:IconElement.Geometry="{StaticResource ImageGeometry}"/>
|
||||
<TextBox Grid.Column="1" Text="{Binding ChatString,UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding IsChecked,ElementName=ToggleButtonAudio,Converter={StaticResource Boolean2VisibilityReConverter}}">
|
||||
<TextBox VerticalAlignment="Center" Grid.Column="1" Text="{Binding ChatString,UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding IsChecked,ElementName=ToggleButtonAudio,Converter={StaticResource Boolean2VisibilityReConverter}}">
|
||||
<hc:Interaction.Triggers>
|
||||
<hc:EventTrigger EventName="KeyDown">
|
||||
<hc:EventToCommand Command="{Binding SendStringCmd}" PassEventArgsToCommand="True" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Border x:Class="HandyControlDemo.UserControl.Basic.InteractiveDialog"
|
||||
<Border x:Class="HandyControlDemo.UserControl.InteractiveDialog"
|
||||
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"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace HandyControlDemo.UserControl.Basic
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class InteractiveDialog
|
||||
{
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<Border x:Class="HandyControlDemo.UserControl.TextDialogWithTimer"
|
||||
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:hc="https://handyorg.github.io/handycontrol"
|
||||
CornerRadius="10"
|
||||
Width="400"
|
||||
Height="247"
|
||||
DataContext="{Binding InteractiveDialog, Source={StaticResource Locator}}"
|
||||
Background="{DynamicResource RegionBrush}">
|
||||
<hc:SimplePanel>
|
||||
<Viewbox Width="80" Height="80">
|
||||
<TextBlock TextWrapping="Wrap" Style="{StaticResource TextBlockLargeBold}" Text="{x:Static langs:Lang.PleaseWait}"/>
|
||||
</Viewbox>
|
||||
<Button Name="ButtonClose" Width="22" Height="22" Command="{Binding CloseCmd}" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource PrimaryBrush}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,4,4,0"/>
|
||||
<hc:CircleProgressBar Name="ProgressBarTimer" ShowText="False" Width="120" Height="120"/>
|
||||
</hc:SimplePanel>
|
||||
</Border>
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using HandyControl.Tools;
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class TextDialogWithTimer
|
||||
{
|
||||
public TextDialogWithTimer()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
var animation = AnimationHelper.CreateAnimation(100, 5000);
|
||||
animation.EasingFunction = null;
|
||||
animation.Completed += Animation_Completed;
|
||||
ProgressBarTimer.BeginAnimation(RangeBase.ValueProperty, animation);
|
||||
}
|
||||
|
||||
private void Animation_Completed(object sender, EventArgs e)
|
||||
{
|
||||
ButtonClose.Command.Execute(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user