日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ChildWindow在Open时旋转出现

發布時間:2024/7/19 编程问答 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ChildWindow在Open时旋转出现 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

在App.xaml中:

<VisualState x:Name="Open">   <Storyboard>     <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="ContentRoot">       <EasingDoubleKeyFrame KeyTime="0" Value="90"/>       <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>     </DoubleAnimationUsingKeyFrames>   </Storyboard> </VisualState>

其次,在<Grid x:Name="ContentRoot"...> 中加入:

<Grid.Projection><PlaneProjection/> </Grid.Projection>

?下面是兩個窗口翻轉出現的例子:A窗口在前為調用窗口,B窗口在后為被調用窗口。

A窗口在app.xaml中的樣式:

<VisualStateGroup x:Name="AnimationStates"><VisualState x:Name="WindowShow"><Storyboard><DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="ContentRoot"><EasingDoubleKeyFrame KeyTime="0" Value="-90"/><EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="-90"/><EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/></DoubleAnimationUsingKeyFrames></Storyboard></VisualState><VisualState x:Name="WindowHide"><Storyboard><DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="ContentRoot"><EasingDoubleKeyFrame KeyTime="0" Value="0"/><EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="90"/></DoubleAnimationUsingKeyFrames></Storyboard></VisualState></VisualStateGroup>

B窗口在app.xaml中的樣式:

<VisualStateGroup x:Name="WindowStates"><VisualState x:Name="Open"><Storyboard><DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="ContentRoot"><EasingDoubleKeyFrame KeyTime="0:0:0" Value="-90"/><EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="-90"/><EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/></DoubleAnimationUsingKeyFrames></Storyboard></VisualState><VisualState x:Name="Closed"><Storyboard><DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="ContentRoot"><EasingDoubleKeyFrame KeyTime="0:0:0" Value="0"/><EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="90"/></DoubleAnimationUsingKeyFrames></Storyboard></VisualState></VisualStateGroup>

A窗口中某一個按鈕的代碼:

private void button1_Click(object sender, RoutedEventArgs e){VisualStateManager.GoToState(this, "WindowHide", true);WinB w = new WinB();w.Show();w.Closed += new EventHandler(w_Closed);}void w_Closed(object sender, EventArgs e){VisualStateManager.GoToState(this, "WindowShow", true);}

?另外,RotationY的值為:

0:向前;

180:向后;

90:向左;

-90:向右。

?

?

轉載于:https://www.cnblogs.com/ajeeky/archive/2013/02/17/2915033.html

總結

以上是生活随笔為你收集整理的ChildWindow在Open时旋转出现的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。