Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\ConfettiCannonDemo.xaml.cs">
<DependentUpon>ConfettiCannonDemo.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\DragDialogDemo.xaml.cs">
<DependentUpon>DragDialogDemo.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\ElementGroupDemo.xaml.cs">
<DependentUpon>ElementGroupDemo.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -555,6 +558,10 @@
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\ConfettiCannonDemo.xaml" />
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\DragDialogDemo.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\ElementGroupDemo.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down Expand Up @@ -1080,4 +1087,4 @@
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)app.manifest" />
</ItemGroup>
</Project>
</Project>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -810,4 +810,7 @@
<data name="ConfettiCannon" xml:space="preserve">
<value>ConfettiCannon</value>
</data>
</root>
<data name="DragDialog" xml:space="preserve">
<value>Přetahovatelný dialog</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -810,4 +810,7 @@
<data name="ConfettiCannon" xml:space="preserve">
<value>ConfettiCannon</value>
</data>
<data name="DragDialog" xml:space="preserve">
<value>Draggable dialog</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -810,4 +810,7 @@
<data name="ConfettiCannon" xml:space="preserve">
<value>ConfettiCannon</value>
</data>
<data name="DragDialog" xml:space="preserve">
<value>Diálogo arrastrable</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -810,4 +810,7 @@
<data name="ConfettiCannon" xml:space="preserve">
<value>ConfettiCannon</value>
</data>
<data name="DragDialog" xml:space="preserve">
<value>کادر محاوره‌ای قابل کشیدن</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -810,4 +810,7 @@
<data name="ConfettiCannon" xml:space="preserve">
<value>ConfettiCannon</value>
</data>
<data name="DragDialog" xml:space="preserve">
<value>Boîte de dialogue déplaçable</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -810,4 +810,7 @@
<data name="ConfettiCannon" xml:space="preserve">
<value>ConfettiCannon</value>
</data>
<data name="DragDialog" xml:space="preserve">
<value>ドラッグ可能なダイアログ</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -810,4 +810,7 @@
<data name="ConfettiCannon" xml:space="preserve">
<value>ConfettiCannon</value>
</data>
<data name="DragDialog" xml:space="preserve">
<value>드래그 가능한 대화상자</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -810,4 +810,7 @@
<data name="ConfettiCannon" xml:space="preserve">
<value>ConfettiCannon</value>
</data>
<data name="DragDialog" xml:space="preserve">
<value>Przeciągane okno dialogowe</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -810,4 +810,7 @@
<data name="ConfettiCannon" xml:space="preserve">
<value>ConfettiCannon</value>
</data>
<data name="DragDialog" xml:space="preserve">
<value>Diálogo arrastável</value>
</data>
</root>
3 changes: 3 additions & 0 deletions src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx
Original file line number Diff line number Diff line change
Expand Up @@ -810,4 +810,7 @@
<data name="ConfettiCannon" xml:space="preserve">
<value>礼炮</value>
</data>
<data name="DragDialog" xml:space="preserve">
<value>可拖拽对话框</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -810,4 +810,7 @@
<data name="ConfettiCannon" xml:space="preserve">
<value>ConfettiCannon</value>
</data>
<data name="DragDialog" xml:space="preserve">
<value>Перетаскиваемое диалоговое окно</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -810,4 +810,7 @@
<data name="ConfettiCannon" xml:space="preserve">
<value>ConfettiCannon</value>
</data>
<data name="DragDialog" xml:space="preserve">
<value>Sürüklemeyle taşınabilir iletişim kutusu</value>
</data>
</root>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.ComponentModel;
using System.ComponentModel;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
Expand Down Expand Up @@ -101,6 +101,7 @@ private void UpdateLangs()
OnPropertyChanged(nameof(Doc_cn));
OnPropertyChanged(nameof(Doc_en));
OnPropertyChanged(nameof(Documentation));
OnPropertyChanged(nameof(DragDialog));
OnPropertyChanged(nameof(DragHere));
OnPropertyChanged(nameof(Drawer));
OnPropertyChanged(nameof(Effects));
Expand Down Expand Up @@ -569,7 +570,10 @@ private void UpdateLangs()
/// 查找类似 文献资料 的本地化字符串。
/// </summary>
public string Documentation => Lang.Documentation;

/// <summary>
/// 查找类似 在这里拖拽 的本地化字符串。
/// </summary>
public string DragDialog => Lang.DragDialog;
/// <summary>
/// 查找类似 在这里拖拽 的本地化字符串。
/// </summary>
Expand Down Expand Up @@ -1733,7 +1737,10 @@ public class LangKeys
/// 查找类似 文献资料 的本地化字符串。
/// </summary>
public static string Documentation = nameof(Documentation);

/// <summary>
/// 查找类似 可拖拽对话框 的本地化字符串。
/// </summary>
public static string DragDialog = nameof(DragDialog);
/// <summary>
/// 查找类似 在这里拖拽 的本地化字符串。
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<UserControl x:Class="HandyControlDemo.UserControl.DialogDemo"
<UserControl x:Class="HandyControlDemo.UserControl.DialogDemo"
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"
Expand All @@ -24,6 +24,7 @@
<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}"/>
<Button Margin="0,32,0,0" Content="{ex:Lang Key={x:Static langs:LangKeys.DragDialog}}" Command="{Binding DragDialogCmd}"/>
</StackPanel>
</hc:SimplePanel>
</hc:TransitioningContentControl>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<Border x:Class="HandyControlDemo.UserControl.DragDialogDemo"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension"
x:Name="DraggableRoot"
mc:Ignorable="d"
Height="220" Width="360">
<Grid>
<Border CornerRadius="8" Background="{DynamicResource DefaultBrush}">
<DockPanel Margin="20,10,20,0">
<Border DockPanel.Dock="Top">
<DockPanel>
<DockPanel>
<Path Stretch="UniformToFill" Fill="{DynamicResource PrimaryTextBrush}"
Data="{DynamicResource InfoGeometry}"
Width="20" Height="20"></Path>
<TextBlock Text="{ex:Lang Key={x:Static langs:LangKeys.Dialog}}" FontSize="{DynamicResource SubHeadFontSize}" FontWeight="Bold"
Margin="5,10"/>
<Rectangle Margin="5,5,20,5"
Style="{DynamicResource RectangleFocusVisual}"
Stroke="{DynamicResource PrimaryBrush}"
Fill="{DynamicResource BorderBrush}" StrokeDashArray="4 4" StrokeThickness="1"
hc:DragAdornerElement.IsDraggable="True"
hc:DragAdornerElement.DragTarget="{Binding ElementName=DraggableRoot}"></Rectangle>
</DockPanel>
</DockPanel>
</Border>
<TextBlock Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}"
FontSize="{DynamicResource TextFontSize}"
Foreground="{DynamicResource SecondaryTextBrush}"
TextWrapping="Wrap"
Margin="20"/>
</DockPanel>
</Border>
<Button Width="30" Height="30" BorderThickness="0"
Style="{DynamicResource ButtonIconCircular}"
HorizontalAlignment="Right" VerticalAlignment="Top"
Command="{x:Static hc:ControlCommands.Close}"
Margin="0,12,10,0"
hc:IconElement.Geometry="{DynamicResource CloseGeometry}"
Padding="8"></Button>
</Grid>
</Border>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace HandyControlDemo.UserControl;

/// <summary>
/// DragDialogDemo.xaml 的交互逻辑
/// </summary>
public partial class DragDialogDemo
{
public DragDialogDemo()
{
InitializeComponent();
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Windows;
using System.Windows;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
#if !NET40
Expand Down Expand Up @@ -82,4 +82,8 @@ private async Task ShowInteractiveDialog(bool withTimer)
public RelayCommand<string> ShowWithTokenCmd => new(token => Dialog.Show(new TextDialog(), token));

public RelayCommand<string> CloseMainWindowDialogCmd => new(Dialog.Close);

public RelayCommand DragDialogCmd => new(() => {
Dialog.Show(new DragDialogDemo(), MessageToken.MainWindow);
});
}
Loading