前面一直在玩耍ListBox(最愛),大周末的就適合在家吹著風扇擼著代碼;今天來分享一個很簡單實用的登錄,來看看最終實現的效果:
1、關于軟件啟動后焦點實現:
<Style TargetType="Border"><Style.Triggers><DataTrigger Binding="{Binding IsEmptyAccount,Mode=TwoWay}" Value="true"><Setter Property="FocusManager.FocusedElement" Value="{Binding ElementName=UserNameTxb}"/></DataTrigger></Style.Triggers>
</Style>
2、關于啟動窗口動畫:
<Storyboard x:Key="LoadStoryboard"><DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LoginWindow"><EasingDoubleKeyFrame KeyTime="0" Value="0"/><EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="1"/></DoubleAnimationUsingKeyFrames><DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LoginWindow"Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"><SplineDoubleKeyFrame KeyTime="00:00:0" Value="0"/><SplineDoubleKeyFrame KeyTime="00:00:0.6" Value="1"/></DoubleAnimationUsingKeyFrames><DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LoginWindow"Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"><SplineDoubleKeyFrame KeyTime="00:00:0" Value="0"/><SplineDoubleKeyFrame KeyTime="00:00:0.6" Value="1"/></DoubleAnimationUsingKeyFrames>
</Storyboard>
3、關于窗口抖動動畫:
<Storyboard x:Key="ShakeStoryboard" Completed="ShakeStoryboard_Completed"><DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LayoutRoot"Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"><SplineDoubleKeyFrame KeyTime="00:00:0" Value="1"/><SplineDoubleKeyFrame KeyTime="00:00:0.2" Value="0.7"/><SplineDoubleKeyFrame KeyTime="00:00:0.4" Value="0.8"/><SplineDoubleKeyFrame KeyTime="00:00:0.5" Value="0.9"/><SplineDoubleKeyFrame KeyTime="00:00:0.6" Value="1"/></DoubleAnimationUsingKeyFrames><DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LayoutRoot"Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"><SplineDoubleKeyFrame KeyTime="00:00:0" Value="1"/><SplineDoubleKeyFrame KeyTime="00:00:0.2" Value="0.7"/><SplineDoubleKeyFrame KeyTime="00:00:0.4" Value="0.8"/><SplineDoubleKeyFrame KeyTime="00:00:0.5" Value="0.9"/><SplineDoubleKeyFrame KeyTime="00:00:0.6" Value="1"/></DoubleAnimationUsingKeyFrames><DoubleAnimationUsingKeyFrames BeginTime="00:00:00.6" Storyboard.TargetName="LayoutRoot"Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"><SplineDoubleKeyFrame KeyTime="00:00:0.2" Value="10"/><SplineDoubleKeyFrame KeyTime="00:00:0.3" Value="-20"/><SplineDoubleKeyFrame KeyTime="00:00:0.4" Value="10"/><SplineDoubleKeyFrame KeyTime="00:00:0.5" Value="-16"/><SplineDoubleKeyFrame KeyTime="00:00:0.6" Value="10"/><SplineDoubleKeyFrame KeyTime="00:00:0.7" Value="0"/></DoubleAnimationUsingKeyFrames>
</Storyboard>
最終簡單的效果先這樣吧;以后有時間的話,可以再去摸索一下更復雜的效果
;編程不息、Bug不止、無Bug、無生活
;改bug的冷靜、編碼的激情、完成后的喜悅、挖坑的激動 、填坑的興奮;這也許就是屌絲程序員的樂趣吧;今天就到這里吧;希望自己有動力一步一步堅持下去;生命不息,代碼不止;大家抽空可以看看今天分享的效果,有好的意見和想法,可以在留言板隨意留言;我看到后會第一時間回復大家,多謝大家的一直默默的關注和支持!如果覺得不錯,那就伸出您的小手點個贊并關注一下!