Skip to content

Commit 7a08f6b

Browse files
Merge pull request #218 from WPFDevelopersOrg/0.0.0.3
Merge from 0.0.0.3 to master
2 parents 418523a + 1d0d1cf commit 7a08f6b

38 files changed

+1403
-294
lines changed

src/Resources.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@
8484
<Resource Include="..\WPFDevelopers.Samples.Shared\Resources\Audio\HelloWPFDevelopes_zh.mp3">
8585
<Link>Resources\Audio\HelloWPFDevelopes_zh.mp3</Link>
8686
</Resource>
87+
<Resource Include="..\WPFDevelopers.Samples.Shared\Resources\Svg\*.svg">
88+
<Link>Resources\Svg\%(Filename)%(Extension)</Link>
89+
</Resource>
8790
</ItemGroup>
8891
<PropertyGroup>
8992
<RootNamespace>WPFDevelopers.Samples</RootNamespace>

src/TargetFrameworks.props

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
11
<Project>
22
<PropertyGroup>
3-
<TargetFrameworks>net45;net46;net47;net48;net5.0-windows;net6.0-windows;net7.0-windows;net8.0-windows;netcoreapp3.0</TargetFrameworks>
3+
<TargetFrameworks>net45;net451;net452;net46;net461;net462;net47;net471;net472;net48;net481;net5.0-windows;net6.0-windows;net7.0-windows;net8.0-windows;net9.0-windows;netcoreapp3.0;netcoreapp3.1</TargetFrameworks>
44
</PropertyGroup>
55
<ItemGroup Condition="'$(TargetFramework)' == 'net47'">
66
<PackageReference Include="System.Drawing.Common">
77
<Version>7.0.0</Version>
88
</PackageReference>
99
</ItemGroup>
10+
<ItemGroup Condition="'$(TargetFramework)' == 'net471'">
11+
<PackageReference Include="System.Drawing.Common">
12+
<Version>7.0.0</Version>
13+
</PackageReference>
14+
</ItemGroup>
15+
<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
16+
<PackageReference Include="System.Drawing.Common">
17+
<Version>7.0.0</Version>
18+
</PackageReference>
19+
</ItemGroup>
1020
<ItemGroup Condition="'$(TargetFramework)' == 'net48'">
1121
<PackageReference Include="System.Drawing.Common">
1222
<Version>7.0.0</Version>
1323
</PackageReference>
1424
</ItemGroup>
25+
<ItemGroup Condition="'$(TargetFramework)' == 'net481'">
26+
<PackageReference Include="System.Drawing.Common">
27+
<Version>7.0.0</Version>
28+
</PackageReference>
29+
</ItemGroup>
1530
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0-windows'">
1631
<PackageReference Include="System.Drawing.Common">
1732
<Version>7.0.0</Version>
@@ -38,6 +53,11 @@
3853
<Version>7.0.0</Version>
3954
</PackageReference>
4055
</ItemGroup>
56+
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0-windows'">
57+
<PackageReference Include="System.Drawing.Common">
58+
<Version>7.0.0</Version>
59+
</PackageReference>
60+
</ItemGroup>
4161
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
4262
<PackageReference Include="System.Drawing.Common">
4363
<Version>7.0.0</Version>
@@ -46,4 +66,25 @@
4666
<Version>4.7.0</Version>
4767
</PackageReference>
4868
</ItemGroup>
69+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
70+
<PackageReference Include="System.Drawing.Common">
71+
<Version>7.0.0</Version>
72+
</PackageReference>
73+
<PackageReference Include="Microsoft.Win32.SystemEvents">
74+
<Version>4.7.0</Version>
75+
</PackageReference>
76+
</ItemGroup>
77+
<ItemGroup Condition="'$(TargetFramework)' == 'net45' Or
78+
'$(TargetFramework)' == 'net451' Or
79+
'$(TargetFramework)' == 'net452' Or
80+
'$(TargetFramework)' == 'net46' Or
81+
'$(TargetFramework)' == 'net461' Or
82+
'$(TargetFramework)' == 'net462' Or
83+
'$(TargetFramework)' == 'net47' Or
84+
'$(TargetFramework)' == 'net471' Or
85+
'$(TargetFramework)' == 'net472' Or
86+
'$(TargetFramework)' == 'net48' Or
87+
'$(TargetFramework)' == 'net481'">
88+
<Reference Include="Microsoft.CSharp" />
89+
</ItemGroup>
4990
</Project>

src/WPFDevelopers.Net40/Themes/Theme.xaml

Lines changed: 42 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4002,33 +4002,38 @@
40024002
<Setter Property="Template">
40034003
<Setter.Value>
40044004
<ControlTemplate TargetType="{x:Type controls:DefaultLoading}">
4005-
<ControlTemplate.Resources>
4006-
<Storyboard x:Key="WD.PlayStoryboard" RepeatBehavior="Forever">
4007-
<DoubleAnimation RepeatBehavior="Forever" Storyboard.TargetName="PART_Grid" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)" To="360" Duration="0:0:0.784" />
4008-
<DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" Storyboard.TargetName="PART_Arc" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)">
4009-
<SplineDoubleKeyFrame KeyTime="0" Value="0" />
4010-
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:0.666" Value="135" />
4011-
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:1.333" Value="270" />
4012-
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:1.999" Value="405" />
4013-
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:2.666" Value="540" />
4014-
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:3.333" Value="675" />
4015-
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:3.999" Value="810" />
4016-
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:4.666" Value="945" />
4017-
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:5.332" Value="1080" />
4018-
</DoubleAnimationUsingKeyFrames>
4019-
<DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" Storyboard.TargetName="PART_Arc" Storyboard.TargetProperty="(shapes:Arc.StartAngle)">
4020-
<SplineDoubleKeyFrame KeyTime="0" Value="-5" />
4021-
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:0.666" Value="-130" />
4022-
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:1.333" Value="-5" />
4023-
</DoubleAnimationUsingKeyFrames>
4024-
<DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" Storyboard.TargetName="PART_Arc" Storyboard.TargetProperty="(shapes:Arc.EndAngle)">
4025-
<SplineDoubleKeyFrame KeyTime="0" Value="5" />
4026-
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:0.666" Value="130" />
4027-
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:1.333" Value="5" />
4028-
</DoubleAnimationUsingKeyFrames>
4029-
</Storyboard>
4030-
</ControlTemplate.Resources>
40314005
<Grid x:Name="PART_Grid" RenderTransformOrigin=".5,.5">
4006+
<Grid.Resources>
4007+
<Storyboard x:Key="WD.PlayStoryboard" RepeatBehavior="Forever">
4008+
<DoubleAnimation RepeatBehavior="Forever" Storyboard.TargetName="PART_Grid" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)" To="360" Duration="0:0:0.784" />
4009+
<DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" Storyboard.TargetName="PART_Arc" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)">
4010+
<SplineDoubleKeyFrame KeyTime="0" Value="0" />
4011+
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:0.666" Value="135" />
4012+
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:1.333" Value="270" />
4013+
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:1.999" Value="405" />
4014+
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:2.666" Value="540" />
4015+
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:3.333" Value="675" />
4016+
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:3.999" Value="810" />
4017+
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:4.666" Value="945" />
4018+
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:5.332" Value="1080" />
4019+
</DoubleAnimationUsingKeyFrames>
4020+
<DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" Storyboard.TargetName="PART_Arc" Storyboard.TargetProperty="(shapes:Arc.StartAngle)">
4021+
<SplineDoubleKeyFrame KeyTime="0" Value="-5" />
4022+
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:0.666" Value="-130" />
4023+
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:1.333" Value="-5" />
4024+
</DoubleAnimationUsingKeyFrames>
4025+
<DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" Storyboard.TargetName="PART_Arc" Storyboard.TargetProperty="(shapes:Arc.EndAngle)">
4026+
<SplineDoubleKeyFrame KeyTime="0" Value="5" />
4027+
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:0.666" Value="130" />
4028+
<SplineDoubleKeyFrame KeySpline="0.4,0.0,0.2,1" KeyTime="0:0:1.333" Value="5" />
4029+
</DoubleAnimationUsingKeyFrames>
4030+
</Storyboard>
4031+
</Grid.Resources>
4032+
<Grid.Triggers>
4033+
<EventTrigger RoutedEvent="Grid.Loaded">
4034+
<BeginStoryboard Storyboard="{StaticResource WD.PlayStoryboard}" />
4035+
</EventTrigger>
4036+
</Grid.Triggers>
40324037
<Grid.RenderTransform>
40334038
<RotateTransform />
40344039
</Grid.RenderTransform>
@@ -4055,12 +4060,17 @@
40554060
<Setter Property="Template">
40564061
<Setter.Value>
40574062
<ControlTemplate TargetType="{x:Type controls:ProgressLoading}">
4058-
<ControlTemplate.Resources>
4059-
<Storyboard x:Key="WD.PlayStoryboard" RepeatBehavior="Forever">
4060-
<DoubleAnimation RepeatBehavior="Forever" Storyboard.TargetName="PART_Grid" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)" To="360" Duration="0:0:0.784" />
4061-
</Storyboard>
4062-
</ControlTemplate.Resources>
40634063
<Grid x:Name="PART_Grid" RenderTransformOrigin=".5,.5">
4064+
<Grid.Resources>
4065+
<Storyboard x:Key="WD.PlayStoryboard" RepeatBehavior="Forever">
4066+
<DoubleAnimation RepeatBehavior="Forever" Storyboard.TargetName="PART_Grid" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)" To="360" Duration="0:0:0.784" />
4067+
</Storyboard>
4068+
</Grid.Resources>
4069+
<Grid.Triggers>
4070+
<EventTrigger RoutedEvent="Grid.Loaded">
4071+
<BeginStoryboard Storyboard="{StaticResource WD.PlayStoryboard}" />
4072+
</EventTrigger>
4073+
</Grid.Triggers>
40644074
<Grid.RenderTransform>
40654075
<RotateTransform />
40664076
</Grid.RenderTransform>
@@ -5915,6 +5925,7 @@
59155925
<Trigger Property="ShowType" Value="Tag">
59165926
<Setter TargetName="PART_SimpleWrapPanel" Property="Visibility" Value="Visible" />
59175927
<Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Collapsed" />
5928+
<Setter TargetName="PART_SimpleWrapPanel" Property="MinHeight" Value="21.6" />
59185929
</Trigger>
59195930
<Trigger SourceName="PART_ToggleButton" Property="IsChecked" Value="True">
59205931
<Trigger.EnterActions>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<UserControl
2+
x:Class="WPFDevelopers.Samples.ExampleViews.DialExample"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:controls="clr-namespace:WPFDevelopers.Samples.Controls"
6+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
7+
xmlns:local="clr-namespace:WPFDevelopers.Samples.ExampleViews"
8+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
9+
xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers"
10+
d:DesignHeight="450"
11+
d:DesignWidth="800"
12+
mc:Ignorable="d">
13+
<controls:CodeViewer Header="{Binding NavigateMenuItem.Name}">
14+
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center">
15+
<StackPanel>
16+
<TextBlock HorizontalAlignment="Center" Text="{Binding ElementName=MyDial, Path=Value, StringFormat='{}{0:0}'}" />
17+
<wd:Dial
18+
x:Name="MyDial"
19+
Width="200"
20+
Height="200"
21+
Margin="10"
22+
Value="{Binding ElementName=MySlider, Path=Value}" />
23+
<Slider
24+
Name="MySlider"
25+
Width="200"
26+
Margin="0,0,0,20"
27+
HorizontalAlignment="Center"
28+
VerticalAlignment="Bottom"
29+
wd:ElementHelper.CornerRadius="4"
30+
IsSnapToTickEnabled="True"
31+
Maximum="100"
32+
Minimum="0" />
33+
</StackPanel>
34+
<StackPanel VerticalAlignment="Bottom">
35+
<TextBlock HorizontalAlignment="Center" Text="{Binding ElementName=MyDial1, Path=Value}" />
36+
<wd:Dial
37+
x:Name="MyDial1"
38+
Width="200"
39+
Height="200"
40+
Margin="10"
41+
Background="WhiteSmoke"
42+
BorderBrush="DodgerBlue"
43+
BorderThickness="5"
44+
Maximum="80"
45+
Minimum="50"
46+
Value="{Binding ElementName=MySlider2, Path=Value}" />
47+
<Slider
48+
Name="MySlider2"
49+
Width="200"
50+
Margin="0,0,0,20"
51+
HorizontalAlignment="Center"
52+
VerticalAlignment="Bottom"
53+
wd:ElementHelper.CornerRadius="4"
54+
Maximum="80"
55+
Minimum="50" />
56+
</StackPanel>
57+
</WrapPanel>
58+
<controls:CodeViewer.SourceCodes>
59+
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/DialExample.xaml" CodeType="Xaml" />
60+
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/DialExample.xaml.cs" CodeType="CSharp" />
61+
</controls:CodeViewer.SourceCodes>
62+
</controls:CodeViewer>
63+
</UserControl>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System.Windows.Controls;
2+
3+
namespace WPFDevelopers.Samples.ExampleViews
4+
{
5+
public partial class DialExample : UserControl
6+
{
7+
public DialExample()
8+
{
9+
InitializeComponent();
10+
}
11+
}
12+
}

src/WPFDevelopers.Samples.Shared/ExampleViews/ScreenCutExample.xaml.cs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,22 @@ public ScreenCutExample()
2828

2929
private void Button_Click(object sender, RoutedEventArgs e)
3030
{
31-
32-
Dispatcher.Invoke(new Action(delegate
31+
if (IsChecked)
32+
{
33+
App.CurrentMainWindow.WindowState = WindowState.Minimized;
34+
}
35+
ThreadPool.QueueUserWorkItem(state =>
3336
{
34-
ScreenCapture screenCapturer;
35-
if (IsChecked)
37+
Thread.Sleep(350);
38+
Dispatcher.BeginInvoke(new Action(() =>
3639
{
37-
App.CurrentMainWindow.WindowState = WindowState.Minimized;
38-
}
39-
screenCapturer = new ScreenCapture();
40-
screenCapturer.SnapCompleted += ScreenCapturer_SnapCompleted;
41-
screenCapturer.SnapCanceled += ScreenCapturer_SnapCanceled;
42-
screenCapturer.SnapSaveFullPath += ScreenCapturer_SnapSaveFullPath;
43-
screenCapturer.Capture();
44-
}));
45-
40+
ScreenCapture screenCapturer = new ScreenCapture();
41+
screenCapturer.SnapCompleted += ScreenCapturer_SnapCompleted;
42+
screenCapturer.SnapCanceled += ScreenCapturer_SnapCanceled;
43+
screenCapturer.SnapSaveFullPath += ScreenCapturer_SnapSaveFullPath;
44+
screenCapturer.Capture();
45+
}));
46+
});
4647
}
4748

4849
private void ScreenCapturer_SnapSaveFullPath(string text)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<UserControl
2+
x:Class="WPFDevelopers.Samples.ExampleViews.SvgViewerExample"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:controls="clr-namespace:WPFDevelopers.Samples.Controls"
6+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
7+
xmlns:local="clr-namespace:WPFDevelopers.Samples.ExampleViews"
8+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
9+
xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers"
10+
d:DesignHeight="450"
11+
d:DesignWidth="800"
12+
mc:Ignorable="d">
13+
<controls:CodeViewer Header="{Binding NavigateMenuItem.Name}">
14+
<UniformGrid>
15+
<wd:SvgViewer
16+
Width="50"
17+
Height="50"
18+
Source="pack://application:,,,/WPFDevelopers.Samples;component/Resources/Svg/Star.svg" />
19+
<Button Style="{StaticResource WD.PathButton}">
20+
<wd:SvgViewer
21+
Width="50"
22+
Height="50"
23+
Source="pack://application:,,,/WPFDevelopers.Samples;component/Resources/Svg/Github.svg" />
24+
</Button>
25+
<Button Width="100" Height="100">
26+
<wd:SvgViewer
27+
Width="50"
28+
Height="50"
29+
Source="pack://application:,,,/WPFDevelopers.Samples;component/Resources/Svg/Climbing.svg" />
30+
</Button>
31+
</UniformGrid>
32+
<controls:CodeViewer.SourceCodes>
33+
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/SvgViewerExample.xaml" CodeType="Xaml" />
34+
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/SvgViewerExample.xaml.cs" CodeType="CSharp" />
35+
</controls:CodeViewer.SourceCodes>
36+
</controls:CodeViewer>
37+
</UserControl>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System.Windows.Controls;
2+
3+
namespace WPFDevelopers.Samples.ExampleViews
4+
{
5+
public partial class SvgViewerExample : UserControl
6+
{
7+
public SvgViewerExample()
8+
{
9+
InitializeComponent();
10+
}
11+
}
12+
}

src/WPFDevelopers.Samples.Shared/Helpers/MenuEnum.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ public enum MenuEnum
9797
GestureUnlock,
9898
AnimationGrid,
9999
AllPathIcon,
100+
Dial,
101+
SvgViewer,
100102
VirtualizingWrapPanel,
101103
AcrylicBlur,
102104
TaskbarInfo

0 commit comments

Comments
 (0)