Пример #1
0
        private async void Button_ClickAsync(object sender, RoutedEventArgs e)
        {
            try
            {
                double   width, height, woodLength, glassArea;
                int      quantity;
                Color    ColorSelection;
                DateTime CurrentDate;

                width          = double.Parse(WidthInput.Text);
                height         = double.Parse(HeightInput.Text);
                woodLength     = 2 * (width + height) * 3.25;
                glassArea      = 2 * (width * height);
                quantity       = Convert.ToInt32(QuantityInput.Value);
                ColorSelection = (Color)this.ColorInput.SelectedItem;
                CurrentDate    = DateTime.Now.Date;

                CustWindow CustWindow = new CustWindow(width, height, woodLength, glassArea, quantity, ColorSelection, CurrentDate);

                this.Frame.Navigate(typeof(UserResults), CustWindow);
            }
            catch (Exception)
            {
                ContentDialog InputError = new ContentDialog()
                {
                    Title           = "Input Error",
                    Content         = "One of your inputs is incorrect. Please try again.",
                    CloseButtonText = "Ok"
                };
                await InputError.ShowAsync();
            }
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            CustWindow CustWindow1 = (CustWindow)e.Parameter;

            theirDate.Text       = Convert.ToString(CustWindow1.CurrentDate);
            theirWidth.Text      = Convert.ToString(CustWindow1.width);
            theirHeight.Text     = Convert.ToString(CustWindow1.height);
            theirColor.Text      = Convert.ToString(CustWindow1.ColorSelection);
            their_Quantity.Text  = Convert.ToString(CustWindow1.quantity);
            theirWoodLength.Text = Convert.ToString(CustWindow1.woodLength);
            theirGlassArea.Text  = Convert.ToString(CustWindow1.glassArea);
        }