Skip to content

Dev #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 2, 2023
Merged

Dev #31

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
64 changes: 30 additions & 34 deletions src/WPFDevelopers.Net40/Themes/Theme.xaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public partial class AnimationAudioExample : UserControl
public AnimationAudioExample()
{
InitializeComponent();
AnimationAudioLeft.AudioPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "Audio", "HelloWPFDevelopes_en.mp3");
AnimationAudioRight.AudioPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "Audio", "HelloWPFDevelopes_zh.mp3");
AnimationAudioLeft.AudioPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Audio", "HelloWPFDevelopes_en.mp3");
AnimationAudioRight.AudioPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Audio", "HelloWPFDevelopes_zh.mp3");
}

private void AnimationAudioLeft_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@
</WrapPanel>
<TextBlock Text="ToggleButton" FontSize="20" Margin="0,20,0,0"/>
<WrapPanel Margin="0,10">
<ToggleButton/>
<ToggleButton Margin="10,0" IsEnabled="False"/>
<ToggleButton IsChecked="True"/>
<ToggleButton Content="IsOpen"/>
<ToggleButton Margin="10,0" IsEnabled="False" Content="False"/>
<ToggleButton IsChecked="True" Content="启用" Padding="10,0"/>
</WrapPanel>

<TextBlock Text="DatePicker" FontSize="20" Margin="0,20,0,0"/>
Expand Down
8 changes: 7 additions & 1 deletion src/WPFDevelopers.Samples40/WPFDevelopers.Samples40.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@
<Resource Include="..\WPFDevelopers.Samples.Shared\Resources\Images\ZooSemy\1.png">
<Link>Resources\Images\ZooSemy\1.png</Link>
</Resource>
<Resource Include="..\WPFDevelopers.Samples.Shared\Resources\Audio\HelloWPFDevelopes_en.mp3">
<Link>Resources\Audio\HelloWPFDevelopes_en.mp3</Link>
</Resource>
<Resource Include="..\WPFDevelopers.Samples.Shared\Resources\Audio\HelloWPFDevelopes_zh.mp3">
<Link>Resources\Audio\HelloWPFDevelopes_zh.mp3</Link>
</Resource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="WPFDevelopers" Version="1.1.0.1-preview4" />
Expand All @@ -177,6 +183,6 @@
</PropertyGroup>
<Import Project="..\WPFDevelopers.Samples.Shared\WPFDevelopers.Samples.Shared.projitems" Label="Shared" />
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="if not exist &quot;$(OutDir)emoji&quot; mkdir &quot;$(OutDir)emoji&quot; Copy /Y &quot;$(SolutionDir)WPFDevelopers.Samples.Shared/Resources/emoji&quot; &quot;$(OutDir)emoji\&quot;" />
<Exec Command=" if not exist &quot;$(OutDir)emoji&quot; mkdir &quot;$(OutDir)emoji&quot;&#xD;&#xA;&#xD;&#xA; copy &quot;$(SolutionDir)WPFDevelopers.Samples.Shared/Resources/emoji&quot; &quot;$(OutDir)emoji\&quot;&#xD;&#xA;&#xD;&#xA; if not exist &quot;$(OutDir)Audio&quot; mkdir &quot;$(OutDir)Audio&quot;&#xD;&#xA;&#xD;&#xA; copy &quot;$(SolutionDir)WPFDevelopers.Samples.Shared/Resources/Audio&quot; &quot;$(OutDir)Audio\&quot;" />
</Target>
</Project>
12 changes: 11 additions & 1 deletion src/WPFDevelopers.Samples45x/WPFDevelopers.Samples45x.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@
<Resource Include="..\WPFDevelopers.Samples.Shared\Resources\Images\ZooSemy\1.png">
<Link>Resources\Images\ZooSemy\1.png</Link>
</Resource>
<Resource Include="..\WPFDevelopers.Samples.Shared\Resources\Audio\HelloWPFDevelopes_en.mp3">
<Link>Resources\Audio\HelloWPFDevelopes_en.mp3</Link>
</Resource>
<Resource Include="..\WPFDevelopers.Samples.Shared\Resources\Audio\HelloWPFDevelopes_zh.mp3">
<Link>Resources\Audio\HelloWPFDevelopes_zh.mp3</Link>
</Resource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WPFDevelopers.SamplesCode\WPFDevelopers.SamplesCode.csproj" />
Expand All @@ -171,6 +177,10 @@
</PropertyGroup>
<Import Project="..\WPFDevelopers.Samples.Shared\WPFDevelopers.Samples.Shared.projitems" Label="Shared" />
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="if not exist &quot;$(OutDir)emoji&quot; mkdir &quot;$(OutDir)emoji&quot; Copy /Y &quot;$(SolutionDir)WPFDevelopers.Samples.Shared/Resources/emoji&quot; &quot;$(OutDir)emoji\&quot;" />
<!--<Exec Command="if not exist &quot;$(OutDir)emoji&quot; mkdir &quot;$(OutDir)emoji&quot; Copy /Y &quot;$(SolutionDir)WPFDevelopers.Samples.Shared/Resources/emoji&quot; &quot;$(OutDir)emoji\&quot;" />-->

</Target>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command=" if not exist &quot;$(OutDir)emoji&quot; mkdir &quot;$(OutDir)emoji&quot;&#xD;&#xA;&#xD;&#xA; copy &quot;$(SolutionDir)WPFDevelopers.Samples.Shared/Resources/emoji&quot; &quot;$(OutDir)emoji\&quot;&#xD;&#xA;&#xD;&#xA; if not exist &quot;$(OutDir)Audio&quot; mkdir &quot;$(OutDir)Audio&quot;&#xD;&#xA;&#xD;&#xA; copy &quot;$(SolutionDir)WPFDevelopers.Samples.Shared/Resources/Audio&quot; &quot;$(OutDir)Audio\&quot;" />
</Target>
</Project>
11 changes: 1 addition & 10 deletions src/WPFDevelopers.Shared/Helpers/ElementHelper.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Media3D;
using System.Xml.Linq;
using WPFDevelopers.Controls;
using WPFDevelopers.Utilities;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox;
using System.Windows;

namespace WPFDevelopers.Helpers
{
Expand Down
2 changes: 1 addition & 1 deletion src/WPFDevelopers.Shared/Styles/Styles.CheckBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<Style x:Key="DefaultCheckBox" TargetType="{x:Type CheckBox}" BasedOn="{StaticResource ControlBasicStyle}">
<!--<Setter Property="FocusVisualStyle" Value="{x:Null}" />-->
<Setter Property="Padding" Value="2,0,0,0"/>
<Setter Property="Padding" Value="4,0"/>

<Setter Property="Template">
<Setter.Value>
Expand Down
4 changes: 2 additions & 2 deletions src/WPFDevelopers.Shared/Styles/Styles.RadioButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="Background" Value="{DynamicResource WindowForegroundColorBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="2,1"/>
<Setter Property="Padding" Value="4,0"/>

<Setter Property="Template">
<Setter.Value>
Expand All @@ -36,7 +36,7 @@
</BulletDecorator.Bullet>
<ContentPresenter x:Name="PART_ContentPresenter"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}" Grid.Column="1"
Content="{TemplateBinding Content}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
Expand Down
40 changes: 21 additions & 19 deletions src/WPFDevelopers.Shared/Styles/Styles.ToggleButton.xaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:controls="clr-namespace:WPFDevelopers.Controls"
xmlns:helpers="clr-namespace:WPFDevelopers.Helpers">

<ResourceDictionary.MergedDictionaries>
Expand All @@ -10,23 +11,27 @@

<Style x:Key="DefaultToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource ControlBasicStyle}">
<Setter Property="Focusable" Value="False" />

<Setter Property="Padding" Value="4,0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border x:Name="PART_Border"
<BulletDecorator Background="Transparent">
<BulletDecorator.Bullet>
<Border x:Name="PART_Border"
Width="40"
Height="20"
Background="{DynamicResource BaseSolidColorBrush}"
CornerRadius="10">
<Ellipse x:Name="PART_Ellipse" Width="16" Height="16"
<Ellipse x:Name="PART_Ellipse" Width="16" Height="16"
Margin="2,0"
VerticalAlignment="Center" HorizontalAlignment="Left"
Fill="{DynamicResource WindowForegroundColorBrush}">
<Ellipse.RenderTransform>
<TranslateTransform/>
</Ellipse.RenderTransform>
</Ellipse>
<Ellipse.RenderTransform>
<TranslateTransform/>
</Ellipse.RenderTransform>
</Ellipse>
</Border>
</BulletDecorator.Bullet>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CheckStates">
<VisualState x:Name="Checked">
Expand All @@ -36,12 +41,6 @@
To="20"
Duration="00:00:.3"
EasingFunction="{StaticResource CubicEaseInOut}"/>

<!--<ColorAnimation Duration="00:00:0.3"
Storyboard.TargetName="PART_Border"
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
To="{DynamicResource PrimaryNormalColor}"
EasingFunction="{StaticResource CubicEaseInOut}"/>-->
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked">
Expand All @@ -51,17 +50,20 @@
To="0"
Duration="00:00:.3"
EasingFunction="{StaticResource CubicEaseInOut}"/>
<!--<ColorAnimation Duration="00:00:0.3"
Storyboard.TargetName="PART_Border"
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
To="{DynamicResource BaseColor}"
EasingFunction="{StaticResource CubicEaseInOut}"/>-->
</Storyboard>
</VisualState>
<VisualState x:Name="Indeterminate" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Border>
<ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</BulletDecorator>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Background" TargetName="PART_Border"
Expand Down