|
namespace MotionAdjusterApp
{
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media.Animation;
using Windows.UI.Xaml.Navigation;
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
{
/// <summary>
/// Member variable for moving container storyboard.
/// </summary>
private Storyboard moveContainerBorder = null;
/// <summary>
/// Member variable for moving container with adjuster storyboard.
/// </summary>
private Storyboard moveContainerBorderWithAdjuster = null;
public MainPage()
{
this.InitializeComponent();
}
/// <summary>
/// Occurs when MainPage loads.
/// </summary>
/// <param name="sender">
/// MainPage instance.
/// </param>
/// <param name="e">
/// Event argument.
/// </param>
private void samplePage_Loaded(object sender, RoutedEventArgs e)
{
this.moveContainerBorder = this.Resources["moveContainerBorder"] as Storyboard;
this.moveContainerBorderWithAdjuster = this.Resources["moveContainerBorderWithAdjuster"] as Storyboard;
}
/// <summary>
/// Invoked when this page is about to be displayed in a Frame.
/// </summary>
/// <param name="e">Event data that describes how this page was reached. The Parameter
/// property is typically used to configure the page.</param>
protected override void OnNavigatedTo(NavigationEventArgs e)
{
}
/// <summary>
/// Occurs when "Start Motion" button is clicked.
/// </summary>
/// <param name="sender">
/// startMotionButton instance.
/// </param>
/// <param name="e">
/// Event argument.
/// </param>
private void startMotionButton_Click(object sender, RoutedEventArgs e)
{
this.moveContainerBorder.Begin();
}
/// <summary>
/// Occurs when "Stop Motion" button is clicked.
/// </summary>
/// <param name="sender">
/// stopMotionButton instance.
/// </param>
/// <param name="e">
/// Event argument.
/// </param>
private void stopMotionButton_Click(object sender, RoutedEventArgs e)
{
this.moveContainerBorder.Stop();
this.moveContainerBorderWithAdjuster.Stop();
}
/// <summary>
/// Occurs when "Motion with Motion Adjuster" button is clicked.
/// </summary>
/// <param name="sender">
/// adjustMotionButton instance.
/// </param>
/// <param name="e">
/// Event argument.
/// </param>
private void motionAdjusterButton_Click(object sender, RoutedEventArgs e)
{
this.moveContainerBorderWithAdjuster.Begin();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.