Ejemplo n.º 1
0
        /// <summary>
        /// Event handler for window loading.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="routedEventArgs"></param>
        private async void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
        {
            if (PlatformInfo.CurrentPlatform == Platform.WindowsDesktop)
            {
                // When the app window moves to a different screen
                _coreTitleBar.LayoutMetricsChanged += OnTitleBarLayoutMetricsChanged;

                // When in full screen mode, the title bar is collapsed by default.
                _coreTitleBar.IsVisibleChanged += OnTitleBarIsVisibleChanged;

                // The SizeChanged event is raised when the view enters or exits full screen mode.
                Window.Current.SizeChanged += OnWindowSizeChanged;

                // Perform some XAML titlebar initialization.
                UpdateLayoutMetrics();
                UpdatePositionAndVisibility();
            }

            if (_currentFeedbackImagePath != null)
            {
                // Set image source.
                FeedbackImagePreview.Source = new BitmapImage(new Uri(_currentFeedbackImagePath));
            }

            // Validate internet connection
            await _viewModel.ValidateInternetConnectionAsync();
        }