added samples
[windows-sources.git] / sdk / samples / WPFSamples / AdaptiveTopologySample / csharp / callingpage.xaml.cs
blob7bbcd14bec2e6f782147caa0888609d85f214c04
1 namespace AdaptiveTopologySample
3 using System;
4 using System.Windows;
5 using System.Windows.Controls;
6 using System.Windows.Navigation;
8 public partial class CallingPage : Page
10 public CallingPage()
12 InitializeComponent();
15 void startWizardHyperlink_Click(object sender, RoutedEventArgs e)
17 // Launch the Wizard
18 WizardNavigationHub WizardNavigationHub = new WizardNavigationHub();
19 WizardNavigationHub.Return += new ReturnEventHandler<WizardContext>(navigationHub_Return);
20 this.NavigationService.Navigate(WizardNavigationHub);
23 /// <summary>
24 /// Determine how the Wizard completed and, if accepted, process the collected Wizard state
25 /// </summary>
26 public void navigationHub_Return(object sender, ReturnEventArgs<WizardContext> e)
28 // Get Wizard state
29 WizardContext WizardContext = e.Result;
31 this.WizardResultsTextBlock.Visibility = Visibility.Visible;
33 // How did the Wizard end?
34 this.WizardResultsTextBlock.Text = WizardContext.Result.ToString();
36 // If the Wizard completed by being accepted, display Wizard data
37 if (WizardContext.Result == WizardResult.Finished)
39 this.WizardResultsTextBlock.Text += "\nData Item 1: " + ((WizardData)WizardContext.Data).DataItem1;
40 this.WizardResultsTextBlock.Text += "\nData Item 2: " + ((WizardData)WizardContext.Data).DataItem2;
41 this.WizardResultsTextBlock.Text += "\nData Item 3: " + ((WizardData)WizardContext.Data).DataItem3;