World War I Windows 10 (42) and World War I 42
[Download source code]
Backwater world war I Windows 10 (42)-Controls (navigation class): Frame Animation
Author: webabcd
Introduction
Controls for Windows 10 (navigation class)
Example
Animation/NavigationTransitionInfo/Demo. xaml
<Page
x:Class="Windows10.Animation.NavigationTransitionInfo.Demo"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Windows10.Animation.NavigationTransitionInfo"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="Transparent">
<StackPanel Margin="10 0 10 10">
<!
Show me how to specify the navigationtransitioninfo animation effect when navigating through bool navigate (type sourcepagetype, object parameter, navigationtransitioninfo infooverride)
The same is true for specifying navigationtransitioninfo animation when navigating through goback (navigationtransitioninfoverride)
The navigation target page first specifies the navigationthemetransition transition effect for the page, and then sets the defaultnavigationtransitioninfo property of its navigationthemetransition according to the parameters of navigationtransitioninfo type during navigation
>
<StackPanel>
<Button Name="btnGotoSlideNavigationTransitionInfo" Margin="5" Content="goto SlideNavigationTransitionInfo" Click="btnGotoSlideNavigationTransitionInfo_Click" />
<Button Name="btnGotoSuppressNavigationTransitionInfo" Margin="5" Content="goto SuppressNavigationTransitionInfo" Click="btnGotoSuppressNavigationTransitionInfo_Click" />
<Button Name="btnGotoDrillInNavigationTransitionInfo" Margin="5" Content="goto DrillInNavigationTransitionInfo" Click="btnGotoDrillInNavigationTransitionInfo_Click" />
<Button Name="btnGotoContinuumNavigationTransitionInfo" Margin="5" Content="goto ContinuumNavigationTransitionInfo" Click="btnGotoContinuumNavigationTransitionInfo_Click" />
<Button Name="btnGotoEntranceNavigationTransitionInfo" Margin="5" Content="goto EntranceNavigationTransitionInfo" Click="btnGotoEntranceNavigationTransitionInfo_Click" />
<Button Name="btnGotoCommonNavigationTransitionInfo" Margin="5" Content="goto CommonNavigationTransitionInfo" Click="btnGotoCommonNavigationTransitionInfo_Click" />
</StackPanel>
<!
Show me how to animate navigationtransitioninfo on the navigation target page
>
<StackPanel Margin="0 30 0 0">
<Button Name="btnGotoSlideNavigationTransitionInfo2" Margin="5" Content="goto SlideNavigationTransitionInfo" Click="btnGotoSlideNavigationTransitionInfo_Click2" />
<Button Name="btnGotoSuppressNavigationTransitionInfo2" Margin="5" Content="goto SuppressNavigationTransitionInfo" Click="btnGotoSuppressNavigationTransitionInfo_Click2" />
<Button Name="btnGotoDrillInNavigationTransitionInfo2" Margin="5" Content="goto DrillInNavigationTransitionInfo" Click="btnGotoDrillInNavigationTransitionInfo_Click2" />
<Button Name="btnGotoContinuumNavigationTransitionInfo2" Margin="5" Content="goto ContinuumNavigationTransitionInfo" Click="btnGotoContinuumNavigationTransitionInfo_Click2" />
<Button Name="btnGotoEntranceNavigationTransitionInfo2" Margin="5" Content="goto EntranceNavigationTransitionInfo" Click="btnGotoEntranceNavigationTransitionInfo_Click2" />
<Button Name="btnGotoCommonNavigationTransitionInfo2" Margin="5" Content="goto CommonNavigationTransitionInfo" Click="btnGotoCommonNavigationTransitionInfo_Click2" />
</StackPanel>
</StackPanel>
</Grid>
</Page>
Animation/NavigationTransitionInfo/Demo. xaml. cs
/ *
*This example demonstrates how to use the navigationthemetransition transition transition effect
* /
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media.Animation;
namespace Windows10.Animation.NavigationTransitionInfo
{
public sealed partial class Demo : Page
{
public Demo()
{
this.InitializeComponent();
}
//The following shows how to specify the navigationtransitioninfo animation effect when navigating through bool navigate (type sourcepagetype, object parameter, navigationtransitioninfo infooverride)
//The same is true for specifying navigationtransitioninfo animation when navigating through goback (navigationtransitioninfoverride)
//The navigation target page first specifies the navigationthemetransition transition effect for the page, and then sets the defaultnavigationtransitioninfo property of its navigationthemetransition according to the parameters of navigationtransitioninfo type during navigation
private void btnGotoSlideNavigationTransitionInfo_Click(object sender, RoutedEventArgs e)
{
SlideNavigationTransitionInfo slideTransition = new SlideNavigationTransitionInfo();
this.Frame.Navigate(typeof(MyFrame), null, slideTransition);
}
private void btnGotoSuppressNavigationTransitionInfo_Click(object sender, RoutedEventArgs e)
{
SuppressNavigationTransitionInfo supressTransition = new SuppressNavigationTransitionInfo();
this.Frame.Navigate(typeof(MyFrame), null, supressTransition);
}
private void btnGotoDrillInNavigationTransitionInfo_Click(object sender, RoutedEventArgs e)
{
DrillInNavigationTransitionInfo drillInTransition = new DrillInNavigationTransitionInfo();
this.Frame.Navigate(typeof(MyFrame), null, drillInTransition);
}
private void btnGotoContinuumNavigationTransitionInfo_Click(object sender, RoutedEventArgs e)
{
ContinuumNavigationTransitionInfo continuumTransition = new ContinuumNavigationTransitionInfo();
this.Frame.Navigate(typeof(MyFrame), null, continuumTransition);
}
private void btnGotoEntranceNavigationTransitionInfo_Click(object sender, RoutedEventArgs e)
{
EntranceNavigationTransitionInfo entranceTransition = new EntranceNavigationTransitionInfo();
this.Frame.Navigate(typeof(MyFrame), null, entranceTransition);
}
private void btnGotoCommonNavigationTransitionInfo_Click(object sender, RoutedEventArgs e)
{
CommonNavigationTransitionInfo commonTransition = new CommonNavigationTransitionInfo();
this.Frame.Navigate(typeof(MyFrame), null, commonTransition);
}
//Here's how to animate navigationtransitioninfo on the navigation target page
private void btnGotoSlideNavigationTransitionInfo_Click2(object sender, RoutedEventArgs e)
{
SlideNavigationTransitionInfo slideTransition = new SlideNavigationTransitionInfo();
this.Frame.Navigate(typeof(MyFrame), slideTransition);
}
private void btnGotoSuppressNavigationTransitionInfo_Click2(object sender, RoutedEventArgs e)
{
SuppressNavigationTransitionInfo supressTransition = new SuppressNavigationTransitionInfo();
this.Frame.Navigate(typeof(MyFrame), supressTransition);
}
private void btnGotoDrillInNavigationTransitionInfo_Click2(object sender, RoutedEventArgs e)
{
DrillInNavigationTransitionInfo drillInTransition = new DrillInNavigationTransitionInfo();
this.Frame.Navigate(typeof(MyFrame), drillInTransition);
}
private void btnGotoContinuumNavigationTransitionInfo_Click2(object sender, RoutedEventArgs e)
{
ContinuumNavigationTransitionInfo continuumTransition = new ContinuumNavigationTransitionInfo();
this.Frame.Navigate(typeof(MyFrame), continuumTransition);
}
private void btnGotoEntranceNavigationTransitionInfo_Click2(object sender, RoutedEventArgs e)
{
EntranceNavigationTransitionInfo entranceTransition = new EntranceNavigationTransitionInfo();
this.Frame.Navigate(typeof(MyFrame), entranceTransition);
}
private void btnGotoCommonNavigationTransitionInfo_Click2(object sender, RoutedEventArgs e)
{
CommonNavigationTransitionInfo commonTransition = new CommonNavigationTransitionInfo();
this.Frame.Navigate(typeof(MyFrame), commonTransition);
}
}
}
Animation/NavigationTransitionInfo/MyFrame. xaml
<Page
x:Class="Windows10.Animation.NavigationTransitionInfo.MyFrame"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Windows10.Animation.NavigationTransitionInfo"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<!
Navigationthemetransition - transition effect when navigating between pages
Defaultnavigationtransitioninfo - specific transition effect ([contentproperty (name = "defaultnavigationtransitioninfo")])
An object of type navigationtransitioninfo needs to be set for defaultnavigationtransitioninfo
Inherited from navigationtransitioninfo are slidevigationtransitioninfo, suppressnavigationtransitioninfo, drillinnavigationtransitioninfo, continuumnaviationtransitioninfo, enterancenavigationtransitioninfo, commonnavigationtransitioninfo
>
<Page.Transitions>
<TransitionCollection>
<NavigationThemeTransition x:Name="navigationTransition">
<!
<SlideNavigationTransitionInfo />
<SuppressNavigationTransitionInfo />
<DrillInNavigationTransitionInfo />
<ContinuumNavigationTransitionInfo />
<EntranceNavigationTransitionInfo />
<CommonNavigationTransitionInfo />
Note:
1. The above navigation transition effects are inherited from navigationtransitioninfo. You can choose one of them when specifying the defaultnavigationtransitioninfo of navigationthemetransition
2. If navigationtransitioninfo is set here and navigationtransitioninfo is specified when navigating outside, the navigationtransitioninfo navigated outside shall prevail
3. If the specified navigationtransitioninfo takes effect when you need to navigate outside, you need to set the navigationthemetransition transition effect for page first
>
</NavigationThemeTransition>
</TransitionCollection>
</Page.Transitions>
<Grid Background="Transparent">
<StackPanel Margin="10 0 10 10">
<TextBlock Margin="5" TextWrapping="Wrap">
< run > Microsoft hololens holographic glasses were released by Microsoft at the same time with window10 on the morning of January 22, 2015 Beijing time. </Run>
<LineBreak />
< run > on June 15, 2015, Microsoft presented a more complete reality enhanced version of minecraft at a press conference before the E3 game show. Microsoft showed the holographic minecraft castle on the coffee table and bookshelf. A Microsoft employee wearing hololens operated in the game through gestures. In addition, Microsoft showed how two players interact in the same minecraft world, and how hololens users can complete control through voice commands. </Run>
<LineBreak />
Another key point of hololens is that Microsoft does not intend to present a completely different world for users, but to overlay some computer-generated effects on the real world. Users can still walk freely and talk to people at will without worrying about hitting the wall. </Run>
<LineBreak />
The < run > glasses will track your movement and vision, and then generate appropriate virtual objects, which are projected into your eyes through the light. Because the device knows where you are, you can interact with virtual 3D objects through gestures - currently only for raising and dropping your fingers in mid air. </Run>
<LineBreak />
< run > there are many hardware to help hololens achieve lifelike effects. Various sensors can track your movement in the room, and then create objects that can interact from different angles through stacked color lenses. Want to see the other side of a virtual motorcycle in the middle of the kitchen? No problem, just go to the corresponding side. </Run>
<LineBreak />
The < run > glasses observe indoor objects through the camera, so the device can know the orientation of tables, chairs and other objects, and then it can project 3D images on the surface or even inside of these objects. </Run>
</TextBlock>
</StackPanel>
</Grid>
</Page>
Animation/NavigationTransitionInfo/MyFrame. xaml. cs
/ *
*This example demonstrates how to use the navigationthemetransition transition transition effect
* /
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
namespace Windows10.Animation.NavigationTransitionInfo
{
public sealed partial class MyFrame : Page
{
public MyFrame()
{
this.InitializeComponent();
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
/ *
*According to the navigation parameters
* <Page.Transitions>
* <TransitionCollection>
* <NavigationThemeTransition x:Name="navigationTransition" />
* </TransitionCollection>
* </Page.Transitions>
*What navigationtransitioninfo to use (that is, how to set the defaultnavigationtransitioninfo property of navigationthemetransition)
* /
Windows.UI.Xaml.Media.Animation.NavigationTransitionInfo transition = e.Parameter as Windows.UI.Xaml.Media.Animation.NavigationTransitionInfo;
if (transition != null)
navigationTransition.DefaultNavigationTransitionInfo = transition;
}
}
}
OK
[Download source code]