Beispiel #1
0
        protected override void OnNavigatedTo(NavigationEventArgs args)
        {
            // Get the object passed as the second argument to Navigate
            PassData passData = args.Parameter as PassData;

            // Use that to initialize the RadioButton controls
            foreach (UIElement child in radioStack.Children)
            {
                if ((Color)(child as RadioButton).Tag == passData.InitializeColor)
                {
                    (child as RadioButton).IsChecked = true;
                }
            }

            base.OnNavigatedTo(args);
        }
        void OnGotoButtonClick(object sender, RoutedEventArgs args)
        {
            // Create PassData object
            PassData passData = new PassData();

            // Set the InitializeColor property from the RadioButton controls
            foreach (UIElement child in radioStack.Children)
            {
                if ((child as RadioButton).IsChecked.Value)
                {
                    passData.InitializeColor = (Color)(child as RadioButton).Tag;
                }
            }

            // Pass that object to Navigate
            this.Frame.Navigate(typeof(DialogPage), passData);
        }