Skip to content

Commit 55045f6

Browse files
Merge pull request #40 from WPFDevelopersOrg/dev
Dev
2 parents 0d206ad + 450680d commit 55045f6

File tree

15 files changed

+157
-96
lines changed

15 files changed

+157
-96
lines changed

src/WPFDevelopers.Net40/Themes/Theme.xaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4414,16 +4414,6 @@
44144414
</Setter>
44154415
</Style>
44164416
<Style BasedOn="{StaticResource WD.CircularProgressBar}" TargetType="{x:Type controls:CircularProgressBar}" />
4417-
<Style x:Key="WD.CropControl" BasedOn="{StaticResource WD.ControlBasicStyle}" TargetType="{x:Type controls:CropControl}">
4418-
<Setter Property="Template">
4419-
<Setter.Value>
4420-
<ControlTemplate TargetType="{x:Type controls:CropControl}">
4421-
<UniformGrid x:Name="PART_UniformGrid" Columns="{TemplateBinding RowColumn}" Rows="{TemplateBinding RowColumn}" />
4422-
</ControlTemplate>
4423-
</Setter.Value>
4424-
</Setter>
4425-
</Style>
4426-
<Style BasedOn="{StaticResource WD.CropControl}" TargetType="{x:Type controls:CropControl}" />
44274417
<Style x:Key="WD.EdgeLight" BasedOn="{StaticResource WD.ControlBasicStyle}" TargetType="{x:Type controls:EdgeLight}">
44284418
<Setter Property="BorderBrush" Value="{DynamicResource WD.PrimaryNormalSolidColorBrush}" />
44294419
<Setter Property="HorizontalContentAlignment" Value="Center" />

src/WPFDevelopers.Samples.Shared/App.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<ResourceDictionary Source="pack://application:,,,/WPFDevelopers.Samples;component/Controls/Prize/PrizeItemControl.xaml" />
2727
<ResourceDictionary Source="pack://application:,,,/WPFDevelopers.Samples;component/Controls/RainbowButtons/RainbowButtons.xaml" />
2828
<ResourceDictionary Source="pack://application:,,,/WPFDevelopers.Samples;component/Controls/SnowCanvas/SnowCanvas.xaml" />
29+
<ResourceDictionary Source="pack://application:,,,/WPFDevelopers.Samples;component/Controls/CropControl/CropControl.xaml" />
2930
</ResourceDictionary.MergedDictionaries>
3031
<Style TargetType="avalonedit:TextEditor">
3132
<Setter Property="Foreground" Value="{DynamicResource WD.PrimaryTextSolidColorBrush}" />

src/WPFDevelopers.Shared/Controls/CropControl/CropControl.cs renamed to src/WPFDevelopers.Samples.Shared/Controls/CropControl/CropControl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using System.Windows.Media.Imaging;
99
using System.Windows.Shapes;
1010

11-
namespace WPFDevelopers.Controls
11+
namespace WPFDevelopers.Samples.Controls
1212
{
1313
[TemplatePart(Name = UniformGridTemplateName, Type = typeof(UniformGrid))]
1414
public class CropControl : Control

src/WPFDevelopers.Shared/Themes/CropControl.xaml renamed to src/WPFDevelopers.Samples.Shared/Controls/CropControl/CropControl.xaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
<ResourceDictionary
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:controls="clr-namespace:WPFDevelopers.Controls">
5-
<ResourceDictionary.MergedDictionaries>
6-
<ResourceDictionary Source="Basic/ControlBasic.xaml" />
7-
<ResourceDictionary Source="Basic/Animations.xaml" />
8-
</ResourceDictionary.MergedDictionaries>
4+
xmlns:controls="clr-namespace:WPFDevelopers.Samples.Controls"
5+
xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers">
96
<Style
107
x:Key="WD.CropControl"
118
BasedOn="{StaticResource WD.ControlBasicStyle}"

src/WPFDevelopers.Samples.Shared/ExampleViews/AboutWindow.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
xmlns:ws="https://github.com/WPFDevelopersOrg/WPFDevelopers"
77
mc:Ignorable="d" WindowStartupLocation="CenterScreen"
8-
SnapsToDevicePixels="True" TextOptions.TextFormattingMode="Display"
8+
SnapsToDevicePixels="True" WindowStyle="None"
9+
TextOptions.TextFormattingMode="Display"
910
ResizeMode="NoResize"
1011
Height="400" Width="300"
1112
Background="{DynamicResource WD.BackgroundSolidColorBrush}"
Lines changed: 45 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,57 @@
1-
<UserControl x:Class="WPFDevelopers.Samples.ExampleViews.CountdownTimerExample"
2-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6-
xmlns:local="clr-namespace:WPFDevelopers.Samples.ExampleViews"
7-
xmlns:controls="clr-namespace:WPFDevelopers.Samples.Controls"
8-
mc:Ignorable="d"
9-
d:DesignHeight="450" d:DesignWidth="800">
1+
<UserControl
2+
x:Class="WPFDevelopers.Samples.ExampleViews.CountdownTimerExample"
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+
d:DesignHeight="450"
10+
d:DesignWidth="800"
11+
mc:Ignorable="d">
1012
<controls:CodeViewer>
1113
<TabControl TabStripPlacement="Bottom">
1214
<TabItem Header="Default">
13-
<controls:CountdownTimer Number="3" x:Name="CountdownTimer1" FontSize="120"/>
15+
<controls:CountdownTimer
16+
x:Name="CountdownTimer1"
17+
FontSize="120"
18+
Number="3" />
1419
</TabItem>
1520
<TabItem Header="MultiColor">
16-
<UniformGrid Columns="4" Visibility="Collapsed" x:Name="CountdownTimerGroup">
17-
<controls:CountdownTimer Number="2" CountdownTimerEffect="MultiColor" FontSize="150" IsFinishStart="True"/>
18-
<controls:CountdownTimer Number="0" CountdownTimerEffect="MultiColor" FontSize="150" IsFinishStart="True"/>
19-
<controls:CountdownTimer Number="2" CountdownTimerEffect="MultiColor" FontSize="150" IsFinishStart="True"/>
20-
<controls:CountdownTimer Number="2" CountdownTimerEffect="MultiColor" FontSize="150" IsFinishStart="True"/>
21+
<UniformGrid
22+
x:Name="CountdownTimerGroup"
23+
Columns="4"
24+
Visibility="Collapsed">
25+
<controls:CountdownTimer
26+
CountdownTimerEffect="MultiColor"
27+
FontSize="150"
28+
IsFinishStart="True"
29+
Number="2" />
30+
<controls:CountdownTimer
31+
CountdownTimerEffect="MultiColor"
32+
FontSize="150"
33+
IsFinishStart="True"
34+
Number="0" />
35+
<controls:CountdownTimer
36+
CountdownTimerEffect="MultiColor"
37+
FontSize="150"
38+
IsFinishStart="True"
39+
Number="2" />
40+
<controls:CountdownTimer
41+
CountdownTimerEffect="MultiColor"
42+
FontSize="150"
43+
IsFinishStart="True"
44+
Number="2" />
2145
</UniformGrid>
2246
</TabItem>
2347
</TabControl>
2448
<controls:CodeViewer.SourceCodes>
25-
<controls:SourceCodeModel
26-
CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/CountdownTimerExample.xaml"
27-
CodeType="Xaml"/>
28-
<controls:SourceCodeModel
29-
CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/CountdownTimerExample.xaml.cs"
30-
CodeType="CSharp"/>
49+
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/CountdownTimerExample.xaml" CodeType="Xaml" />
50+
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/CountdownTimerExample.xaml.cs" CodeType="CSharp" />
51+
<controls:SourceCodeModel
52+
CodeSource="/WPFDevelopers.SamplesCode;component/Controls/CountdownTimer/CountdownTimer.cs"
53+
CodeType="CSharp"
54+
Haader="CountdownTimer.cs" />
3155
</controls:CodeViewer.SourceCodes>
3256
</controls:CodeViewer>
3357
</UserControl>
Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1-
<UserControl x:Class="WPFDevelopers.Samples.ExampleViews.CropControlExample"
2-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6-
xmlns:local="clr-namespace:WPFDevelopers.Samples.ExampleViews"
7-
xmlns:wpfdev="https://github.com/WPFDevelopersOrg/WPFDevelopers"
8-
xmlns:controls="clr-namespace:WPFDevelopers.Samples.Controls"
9-
mc:Ignorable="d"
10-
d:DesignHeight="450" d:DesignWidth="800">
1+
<UserControl
2+
x:Class="WPFDevelopers.Samples.ExampleViews.CropControlExample"
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+
d:DesignHeight="450"
10+
d:DesignWidth="800"
11+
mc:Ignorable="d">
1112
<controls:CodeViewer>
12-
<wpfdev:CropControl ImageSource="pack://application:,,,/WPFDevelopers.Samples;component/Resources/Images/Crop/0.jpg"/>
13+
<controls:CropControl ImageSource="pack://application:,,,/WPFDevelopers.Samples;component/Resources/Images/Crop/0.jpg" />
1314
<controls:CodeViewer.SourceCodes>
14-
<controls:SourceCodeModel
15-
CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/CropControlExample.xaml"
16-
CodeType="Xaml"/>
17-
<controls:SourceCodeModel
18-
CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/CropControlExample.xaml.cs"
19-
CodeType="CSharp"/>
15+
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/CropControlExample.xaml" CodeType="Xaml" />
16+
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/CropControlExample.xaml.cs" CodeType="CSharp" />
17+
<controls:SourceCodeModel
18+
CodeSource="/WPFDevelopers.SamplesCode;component/Controls/CropControl/CropControl.xaml"
19+
CodeType="Xaml"
20+
Haader="CropControl" />
21+
<controls:SourceCodeModel
22+
CodeSource="/WPFDevelopers.SamplesCode;component/Controls/CropControl/CropControl.cs"
23+
CodeType="CSharp"
24+
Haader="CropControl.cs" />
2025
</controls:CodeViewer.SourceCodes>
2126
</controls:CodeViewer>
2227
</UserControl>
Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,53 @@
1-
<wpfdev:Window x:Class="WPFDevelopers.Samples.ExampleViews.TaskbarItemInfoExample"
2-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6-
xmlns:local="clr-namespace:WPFDevelopers.Samples"
7-
xmlns:wpfdev="https://github.com/WPFDevelopersOrg/WPFDevelopers"
8-
Owner="{x:Static local:App.CurrentMainWindow}"
9-
WindowStartupLocation="CenterOwner" Icon="/WPFDevelopers.ico"
10-
Title="TaskbarItemInfoExample" TitleHeight="40"
11-
WindowStyle="ToolWindow" ResizeMode="NoResize"
12-
mc:Ignorable="d" Height="211" Width="363"
13-
d:DesignHeight="450" d:DesignWidth="800">
1+
<wpfdev:Window
2+
x:Class="WPFDevelopers.Samples.ExampleViews.TaskbarItemInfoExample"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:local="clr-namespace:WPFDevelopers.Samples"
7+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
xmlns:wpfdev="https://github.com/WPFDevelopersOrg/WPFDevelopers"
9+
Title="TaskbarItemInfoExample"
10+
Width="363"
11+
Height="211"
12+
d:DesignHeight="450"
13+
d:DesignWidth="800"
14+
Icon="/WPFDevelopers.ico"
15+
Owner="{x:Static local:App.CurrentMainWindow}"
16+
ResizeMode="NoResize"
17+
TitleHeight="40"
18+
WindowStartupLocation="CenterOwner"
19+
WindowStyle="ToolWindow"
20+
mc:Ignorable="d">
1421
<Window.TaskbarItemInfo>
1522
<TaskbarItemInfo />
1623
</Window.TaskbarItemInfo>
1724
<Window.Resources>
1825
<DataTemplate x:Key="TaskbarIcon">
19-
<Border Width="20" Height="20"
20-
Background="{StaticResource WD.PrimaryPressedSolidColorBrush}"
21-
BorderBrush="{StaticResource WD.BackgroundSolidColorBrush}" BorderThickness="2">
22-
<TextBlock Text="{Binding}" TextAlignment="Center" Foreground="White"
23-
VerticalAlignment="Center"/>
26+
<Border
27+
Width="20"
28+
Height="20"
29+
Background="{StaticResource WD.PrimaryPressedSolidColorBrush}"
30+
BorderBrush="{StaticResource WD.BackgroundSolidColorBrush}"
31+
BorderThickness="2">
32+
<TextBlock
33+
VerticalAlignment="Center"
34+
Foreground="White"
35+
Text="{Binding}"
36+
TextAlignment="Center" />
2437
</Border>
2538
</DataTemplate>
2639
</Window.Resources>
27-
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
28-
<Button Content="增加" Click="Button_Click" Tag="add"
29-
Style="{StaticResource WD.DefaultButton}" />
30-
<Button Content="移除" Click="Button_Click" Tag="remove"/>
40+
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center">
41+
<Button
42+
Click="Button_Click"
43+
Content="增加"
44+
Style="{StaticResource WD.PrimaryButton}"
45+
Tag="add" />
46+
<Button
47+
Margin="10,0"
48+
Click="Button_Click"
49+
Content="移除"
50+
Style="{StaticResource WD.SuccessPrimaryButton}"
51+
Tag="remove" />
3152
</WrapPanel>
3253
</wpfdev:Window>

src/WPFDevelopers.Samples.Shared/WPFDevelopers.Samples.Shared.projitems

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<Compile Include="$(MSBuildThisFileDirectory)Controls\CodeViewer\CodeViewer.cs" />
1919
<Compile Include="$(MSBuildThisFileDirectory)Controls\CodeViewer\SourceCodeModel.cs" />
2020
<Compile Include="$(MSBuildThisFileDirectory)Controls\CountdownTimer\CountdownTimer.cs" />
21+
<Compile Include="$(MSBuildThisFileDirectory)Controls\CropControl\CropControl.cs" />
2122
<Compile Include="$(MSBuildThisFileDirectory)Controls\CutImage\CutImage.cs" />
2223
<Compile Include="$(MSBuildThisFileDirectory)Controls\CutImage\DragDrop.cs" />
2324
<Compile Include="$(MSBuildThisFileDirectory)Controls\Dashboard\Dashboard.cs" />
@@ -420,6 +421,10 @@
420421
<Generator>MSBuild:Compile</Generator>
421422
<SubType>Designer</SubType>
422423
</Page>
424+
<Page Include="$(MSBuildThisFileDirectory)Controls\CropControl\CropControl.xaml">
425+
<Generator>MSBuild:Compile</Generator>
426+
<SubType>Designer</SubType>
427+
</Page>
423428
<Page Include="$(MSBuildThisFileDirectory)Controls\CutImage\CutImage.xaml">
424429
<Generator>MSBuild:Compile</Generator>
425430
<SubType>Designer</SubType>

src/WPFDevelopers.SamplesCode/WPFDevelopers.SamplesCode.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
<Resource Include="..\WPFDevelopers.Samples.Shared\Controls\SongWords\SongWords.cs" Link="Controls\SongWords\SongWords.cs" />
130130
<Resource Include="..\WPFDevelopers.Samples.Shared\Controls\ElementAdorner\ElementAdorner.cs" Link="Controls\ElementAdorner\ElementAdorner.cs" />
131131
<Resource Include="..\WPFDevelopers.Samples.Shared\Controls\ElementAdorner\ThumbAngle.cs" Link="Controls\ElementAdorner\ThumbAngle.cs" />
132+
<Resource Include="..\WPFDevelopers.Samples.Shared\Controls\CropControl\CropControl.cs" Link="Controls\CropControl\CropControl.cs" />
132133
</ItemGroup>
133134
<ItemGroup>
134135
<Resource Include="..\WPFDevelopers.Samples.Shared\ExampleViews\AboutWindow.xaml">
@@ -431,5 +432,11 @@
431432
<Resource Include="..\WPFDevelopers.Samples.Shared\Controls\SnowCanvas\SnowCanvas.xaml">
432433
<Link>Controls\SnowCanvas\SnowCanvas.xaml</Link>
433434
</Resource>
435+
<Resource Include="..\WPFDevelopers.Samples.Shared\Controls\CropControl\CropControl.xaml">
436+
<Link>Controls\CropControl\CropControl.xaml</Link>
437+
</Resource>
438+
<Resource Include="..\WPFDevelopers.Samples.Shared\Controls\CropControl\CropControl.xaml">
439+
<Link>Controls\CropControl\CropControl.xaml</Link>
440+
</Resource>
434441
</ItemGroup>
435442
</Project>

0 commit comments

Comments
 (0)