Пример #1
0
        //Переопределяем метод OnStartup
        protected override async void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            MainWindowViewModel      = new MainViewModel();
            Internet                 = new InternetConnection();
            IsHaveInternetConnection = Internet.CheckInternetConnection();

            if (!IsHaveInternetConnection)
            {
                MainWindowViewModel.StatusValue = "Check your internet connection";
            }

            await displayRootRegistry.ShowModalPresendation(MainWindowViewModel);
        }
Пример #2
0
 public MainWindow()
 {
     InitializeComponent();
     if (InternetConnection.CheckInternetConnection())
     {
         IsConnected             = true;
         LabelDirections.Content = "Choose your position";
     }
     else
     {
         IsConnected = false;
         TextBoxLocation.IsEnabled = false;
         ButtonClear.IsEnabled     = false;
         ButtonSearch.IsEnabled    = false;
         LabelDirections.Content   = "Check internet connection and restart app";
     }
 }