Esempio n. 1
0
 public async void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     // Save Setting when navigating from page
     try
     {
         await settingService.UpdateSettingAsync(SettingMap.MapSettingViewModelToSetting(settingViewModel));
     }
     catch (Exception ex)
     {
         ModernDialog.ShowMessage(ex.Message, "Hiba mentés közben", MessageBoxButton.OK);
         e.Cancel = true;
     }
 }
Esempio n. 2
0
        public async void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            try
            {
                if (String.IsNullOrEmpty(textBoxUserName.Text) || String.IsNullOrWhiteSpace(textBoxUserName.Text))
                {
                    textBoxUserName.Text      = "-";
                    settingViewModel.UserName = "******";
                }

                await settingService.UpdateSettingAsync(SettingMap.MapSettingViewModelToSetting(settingViewModel));
            }
            catch (Exception ex)
            {
                ModernDialog.ShowMessage(ex.Message, "Hiba mentés közben", MessageBoxButton.OK);
                e.Cancel = true;
            }
        }
Esempio n. 3
0
 public async void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     try
     {
         if (!String.IsNullOrEmpty(textBoxServerIP.Text) && textBoxServerIP.Text.Contains("192.168.1.") && !String.IsNullOrEmpty(textBoxPort.Text) && Convert.ToInt32(textBoxPort.Text) > 1000 && Convert.ToInt32(textBoxPort.Text) < 10000 && !String.IsNullOrEmpty(textBoxMoviesPath.Text))
         {
             await settingService.UpdateSettingAsync(SettingMap.MapSettingViewModelToSetting(settingViewModel));
         }
         else
         {
             ModernDialog.ShowMessage("Javítsd a kötelező mezőket", "Hiba mentés közben", MessageBoxButton.OK);
             e.Cancel = true;
         }
     }
     catch (Exception ex)
     {
         ModernDialog.ShowMessage(ex.Message, "Hiba mentés közben", MessageBoxButton.OK);
         e.Cancel = true;
     }
 }