Skip to content

Commit

Permalink
消息框动画
Browse files Browse the repository at this point in the history
  • Loading branch information
Adu committed Jan 2, 2020
1 parent 6eb4897 commit 1af1d3b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 20 deletions.
1 change: 1 addition & 0 deletions src/AduSkin.Demo/Style/BaseStyle.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
<Geometry x:Key="Icon_Logo">M628.493689 713.609741 293.925774 1021.320984 0.020978 1021.320984l350.126262-1021.320984 316.803319 0 346.794377 1021.320984L722.097554 1021.320984M503.90309 264.670985 353.128131 713.609741l275.365558 0</Geometry>
<Geometry x:Key="Icon_Logo2">M927.57504 886.99904h-198.80448l-64.83456-168.5504H365.7216l-60.50304 168.5504H115.05152L434.87744 143.63136h157.75232l334.94528 743.36768z m-313.33376-293.89312l-101.56544-276.59776-99.4048 276.59776h200.97024z</Geometry>
<!-- 增删改查刷新 -->
<Geometry x:Key="Icon_CopyCode">M917.796571 0.146286H342.747429c-58.587429 0-106.130286 47.542857-106.203429 106.130285v129.316572H91.428571C40.96 235.52 0 276.48 0 326.948571v605.622858c0 50.541714 40.96 91.428571 91.428571 91.428571h605.696c50.468571 0 91.428571-40.886857 91.428572-91.428571v-143.945143h129.243428c58.660571 0 106.203429-47.542857 106.203429-106.203429V106.276571c0-58.587429-47.542857-106.130286-106.203429-106.130285zM694.857143 950.857143H102.546286c-12.214857 0-25.088-10.093714-25.088-22.601143V330.605714c0-12.434286 12.873143-22.528 25.088-22.528H694.857143c12.214857 0 22.089143 10.093714 22.089143 22.528v597.723429c0 12.434286-9.874286 22.601143-22.089143 22.601143z m248.685714-279.405714c0 20.553143-16.676571 37.229714-37.156571 37.229714h-117.76V325.924571c0-49.883429-50.395429-90.331429-100.278857-90.331428H311.954286V117.613714c0-20.48 16.603429-37.156571 37.156571-37.156571h557.275429c20.48 0 37.156571 16.676571 37.156571 37.156571V671.451429z M546.742857 492.690286H243.419429a34.304 34.304 0 1 0-0.731429 68.608h303.323429a34.304 34.304 0 1 0 0.731428-68.608z m0 205.750857H243.419429a34.304 34.304 0 1 0-0.731429 68.608h303.323429a34.304 34.304 0 1 0 0.731428-68.608z</Geometry>
<Geometry x:Key="Icon_InsertImage">M975 755.1H853.2V632.9c0-27-21.9-48.9-48.8-48.9s-48.8 21.9-48.8 48.9v122.2H633.9c-26.9 0-48.7 21.9-48.7 48.9s21.8 48.9 48.7 48.9h121.8v122.2c0 27 21.9 48.9 48.8 48.9s48.8-21.9 48.8-48.9V852.9H975c26.9 0 48.8-21.9 48.8-48.9s-21.8-48.9-48.8-48.9zM505.9 881H147c-26.8 0-48.7-22-48.7-48.9V147.7c0-26.9 21.9-48.9 48.7-48.9h682.3c26.8 0 48.7 22 48.7 48.9v347.6c0 27.8 21.8 49.7 48.8 49.7 26.9 0 48.8-21.9 48.8-48.9V98.8C975.6 45 931.7 1 878.1 1H98.3C44.7 1 0.8 45 0.8 98.8V881c0 53.8 43.9 97.8 97.5 97.8h407.6c26.8-0.1 48.5-22 48.5-48.9s-21.7-48.8-48.5-48.9z m113.9-212.2h51.9v-52.1c0-53.1 31.8-98.7 77.3-119v-2.4l-56.9-172.5c-5.1-15.4-16.9-17.9-27.3-4.4L452.2 593.7 405.3 514c-8.3-14.1-24.3-16-35.9-4.3L165.7 715.8c-11.6 11.7-7.2 21.2 8.7 21.2h331.9c22-40.5 64.3-68.2 113.5-68.2z m-229-349.9c0-40.5-32.7-73.3-73.1-73.3-40.4 0-73.1 32.8-73.1 73.3s32.7 73.3 73.1 73.3c40.4 0 73.1-32.8 73.1-73.3z</Geometry>
<Geometry x:Key="Icon_Search">M1015.388871 978.950909 772.271385 735.835982c-2.463458-2.463458-5.140518-4.424248-7.822695-5.858068 69.355429-77.490213 111.547586-179.80175 111.547586-291.97991C875.996277 196.099457 679.900657 0 437.999552 0 196.101005 0 0.001548 196.099457 0.001548 437.998004s196.099457 437.998004 437.998004 437.998004c112.179439 0 214.489697-42.192157 291.97991-111.547586 1.43382 2.682176 3.39461 5.360516 5.858068 7.825253l243.114927 243.114927c8.394432 8.394432 19.274066 11.117538 24.303307 6.088297l18.220126-18.217567C1026.50513 998.224975 1023.779465 987.344062 1015.388871 978.950909zM437.999552 824.466756c-213.440872 0-386.468752-173.029158-386.468752-386.468752 0-213.440872 173.0266-386.468752 386.468752-386.468752s386.468752 173.0266 386.468752 386.468752C824.468304 651.436318 651.440424 824.466756 437.999552 824.466756zM437.999552 103.058504c-184.981919 0-334.9395 149.957581-334.9395 334.9395 0 14.229477 11.53451 25.763987 25.763987 25.763987 14.229477 0 25.763987-11.53451 25.763987-25.763987 0-156.521686 126.888561-283.410247 283.410247-283.410247 14.229477 0 25.763987-11.53451 25.763987-25.763987S452.229028 103.058504 437.999552 103.058504z</Geometry>
<Geometry x:Key="Icon_Refresh2">M1020.444444 460.8 834.844444 230.4c-19.2-25.6-57.6-25.6-76.8 0L572.444444 460.8c-12.8 19.2 0 44.8 19.2 44.8l70.4 0c0 134.4 0 307.2-243.2 448-6.4 6.4 0 12.8 6.4 12.8 454.4-70.4 492.8-377.6 492.8-460.8l76.8 0C1020.444444 505.6 1033.244444 480 1020.444444 460.8L1020.444444 460.8 1020.444444 460.8zM438.044444 518.4 361.244444 518.4c0-134.4 0-307.2 243.2-448 6.4-6.4 0-12.8-6.4-12.8C143.644444 128 105.244444 435.2 105.244444 518.4L28.444444 518.4C2.844444 518.4-9.955556 544 9.244444 563.2L194.844444 793.6c19.2 25.6 57.6 25.6 76.8 0l185.6-230.4C470.044444 544 457.244444 518.4 438.044444 518.4L438.044444 518.4 438.044444 518.4z</Geometry>
Expand Down
12 changes: 10 additions & 2 deletions src/AduSkin.Demo/Views/AduSkinAbout.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,16 @@
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#000" FontSize="12" Text="具体使用请参考 AduSkin.Demo" Margin="0"/>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#000" FontSize="12" Text="技术交流" Margin="10"/>
<StackPanel Orientation="Horizontal" Margin="10" HorizontalAlignment="Center">
<Metro:HCShield Subject="QQ群" Status="544471417" Color="#25B78A" Margin="10,0" Command="AduOpenLink:ControlCommands.OpenLink" CommandParameter="https://jq.qq.com/?_wv=1027&amp;k=57GYQeb"/>
<Metro:HCShield Subject="QQ" Status="1280429435" Color="#25B78A" Margin="10,0" Command="AduOpenLink:ControlCommands.OpenLink" CommandParameter="http://wpa.qq.com/msgrd?v=3&amp;uin=1280429435&amp;site=qq&amp;menu=yes"/>
<Metro:HCShield Subject="QQ群" Status="544471417" Color="#25B78A" Margin="10,0" Command="AduOpenLink:ControlCommands.OpenLink" CommandParameter="https://jq.qq.com/?_wv=1027&amp;k=57GYQeb">
<Metro:HCShield.ToolTip>
<Metro:AduToolTip Content="点击加入群聊" IsShowShadow="True" FontSize="12" Padding="10,6" PlacementEx="BottomCenter" />
</Metro:HCShield.ToolTip>
</Metro:HCShield>
<Metro:HCShield Subject="QQ" Status="1280429435" Color="#25B78A" Margin="10,0" Command="AduOpenLink:ControlCommands.OpenLink" CommandParameter="http://wpa.qq.com/msgrd?v=3&amp;uin=1280429435&amp;site=qq&amp;menu=yes">
<Metro:HCShield.ToolTip>
<Metro:AduToolTip Content="联系作者" IsShowShadow="True" FontSize="12" Padding="10,6" PlacementEx="BottomCenter" />
</Metro:HCShield.ToolTip>
</Metro:HCShield>
</StackPanel>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#000" FontSize="12" Text="感谢开源框架 " Margin="0,10" />
<StackPanel Orientation="Horizontal" Margin="10" HorizontalAlignment="Center">
Expand Down
16 changes: 12 additions & 4 deletions src/AduSkin.Demo/Views/PracticalCase.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,18 @@
<Metro:AduExpander >
<Metro:MetroTextBox InputHint="Demo SourceCode ..." Margin="0,10,0,0" Height="200"/>
</Metro:AduExpander>
<Metro:SegmentControl x:Name="CodeType" BorderBrush="{StaticResource DefaultBrush}" VerticalAlignment="Top" Foreground="{StaticResource DefaultBrush}" SelectedIndex="{Binding ShowCodeTypeIndex}" HorizontalAlignment="Left">
<Metro:SegmentItem Content="XAML"/>
<Metro:SegmentItem Content="Code"/>
</Metro:SegmentControl>
<StackPanel Orientation="Horizontal" VerticalAlignment="Top">
<Metro:SegmentControl x:Name="CodeType" BorderBrush="{StaticResource DefaultBrush}" Foreground="{StaticResource DefaultBrush}" SelectedIndex="{Binding ShowCodeTypeIndex}" HorizontalAlignment="Left">
<Metro:SegmentItem Content="XAML"/>
<Metro:SegmentItem Content="Code"/>
</Metro:SegmentControl>
<Metro:AduButtonSvg IconWidth="20" IconHeight="20" Icon="{StaticResource Icon_CopyCode}" Margin="20,0" Foreground="{StaticResource DefaultBrush}">
<Metro:AduButtonSvg.ToolTip>
<Metro:AduToolTip Content="复制代码" PlacementEx="TopCenter" Padding="10,6"/>
</Metro:AduButtonSvg.ToolTip>
</Metro:AduButtonSvg>
</StackPanel>

</Grid>
</Grid>
</Border>
Expand Down
14 changes: 6 additions & 8 deletions src/AduSkin/Controls/Metro/TransitioningContentControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,16 @@ public TransitioningContentControl()
}

public static readonly DependencyProperty TransitionModeProperty = DependencyProperty.Register(
"TransitionMode", typeof(TransitionMode), typeof(TransitioningContentControl), new PropertyMetadata(default(TransitionMode), OnTransitionModeChanged));

private static void OnTransitionModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctl = (TransitioningContentControl)d;
ctl.StartTransition();
}
"TransitionMode", typeof(TransitionMode), typeof(TransitioningContentControl));

public TransitionMode TransitionMode
{
get => (TransitionMode)GetValue(TransitionModeProperty);
set => SetValue(TransitionModeProperty, value);
set
{
StartTransition();
SetValue(TransitionModeProperty, value);
}
}

public static readonly DependencyProperty TransitionStoryboardProperty = DependencyProperty.Register(
Expand Down
12 changes: 6 additions & 6 deletions src/AduSkin/Themes/Metro/AduNotice/Notifiaction.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@
<EventTrigger RoutedEvent="Grid.Loaded" SourceName="NoticeGrid">
<BeginStoryboard x:Name="FadeInStoryBoard">
<Storyboard>
<DoubleAnimation Duration="0:0:0.2" From="0" Storyboard.TargetName="NoticeGrid"
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"
To="1" />

<DoubleAnimation Duration="0:0:0.2" From="0.01" Storyboard.TargetName="NoticeGrid"
Storyboard.TargetProperty="Opacity"
To="1" />
<DoubleAnimation From="50" To="0" Duration="0:0:0.4" Storyboard.TargetName="NoticeGrid" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
<DoubleAnimation.EasingFunction>
<CubicEase EasingMode="EaseOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>

<DoubleAnimation BeginTime="0:0:10" Duration="0:0:0.2" From="1" Storyboard.TargetName="NoticeGrid"
Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"
To="0" />

<DoubleAnimation BeginTime="0:0:10" Duration="0:0:0.2" From="1"
Storyboard.TargetName="NoticeGrid"
Expand Down

0 comments on commit 1af1d3b

Please sign in to comment.