private void ShowProgress(string text) { this.IsEnabled = false; if (progressIndicator == null) { progressIndicator = new ProgressIndicator(); SystemTray.SetProgressIndicator(this, progressIndicator); } progressIndicator.Text = text; progressIndicator.IsIndeterminate = true; progressIndicator.IsVisible = true; }
private async void LoginButtonClick(object sender, RoutedEventArgs e) { if (NetworkInterface.NetworkInterfaceType != NetworkInterfaceType.None) { if (UserNameTextBox.Text != "" && PasswordTextBox.Password != "") { ProgressIndicator progress = new ProgressIndicator { IsVisible = true, IsIndeterminate = true, Text = "登陆中..." }; SystemTray.SetProgressIndicator(this, progress); IEnumerable <User> list = await userTable.ReadAsync(); List <User> userList = list.ToList(); Boolean isMatch = false; foreach (User user in userList) { if (user.UserId.Equals(UserNameTextBox.Text)) { if (user.Password.Equals(PasswordTextBox.Password)) { phoneAppServeice.State["username"] = UserNameTextBox.Text; NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative)); isMatch = true; } } } if (!isMatch) { MessageBox.Show("用户名或者密码错误,请您检查后重新输入!"); } } else { MessageBox.Show("请完整输入用户名以及密码!"); } } else { Debug.WriteLine("[DEBUG]Network Interface Available Status:" + NetworkInterface.GetIsNetworkAvailable()); Debug.WriteLine("[DEBUG]Network Interface Type Status:" + NetworkInterface.NetworkInterfaceType); MessageBox.Show("登陆需要网络连接,请开启手机的移动网络。"); } }
private void CurrentViewModel_LongLoadingStartEvent(object sender, SimpleMvvmToolkit.NotificationEventArgs e) { systemTrayVisibleBck = SystemTray.IsVisible; SystemTray.Opacity = 0.3; SystemTray.BackgroundColor = Colors.Transparent; SystemTray.SetIsVisible(this, true); ProgressIndicator prog = new ProgressIndicator(); prog.IsVisible = true; prog.IsIndeterminate = true; prog.Text = AppResources.LoadingIndicator; SystemTray.SetProgressIndicator(this, prog); }
private void IndicateUpdateAvailable() { ProgressIndicator prog = new ProgressIndicator { Text = AppResources.MainTopOutOfDate, IsVisible = true }; SystemTray.SetProgressIndicator(this, prog); updateMenuIcon.IsEnabled = true; if (!ApplicationBar.Buttons.Contains(updateMenuIcon)) { ApplicationBar.Buttons.Add(updateMenuIcon); } }
private void GirisYap() { try { ProgressIndicator indicator = new ProgressIndicator(); indicator.IsIndeterminate = true; indicator.IsVisible = true; indicator.Text = "Bilgiler yükleniyor.."; SystemTray.SetProgressIndicator(this, indicator); switch (Data._Sirket.Adi) { case "Aras Kargo": Dispatcher.BeginInvoke(() => ArasKargo.TakipGetir(Dispatcher, TakipDetay, Data._TakipKodu)); break; case "DHL Kargo": Dispatcher.BeginInvoke(() => DHLKargo.TakipGetir(Dispatcher, TakipDetay, Data._TakipKodu)); break; case "MNG Kargo": Dispatcher.BeginInvoke(() => MNGKargo.TakipGetir(Dispatcher, TakipDetay, Data._TakipKodu)); break; case "PTT Kargo": Dispatcher.BeginInvoke(() => PTTKargo.TakipGetir(Dispatcher, TakipDetay, Data._TakipKodu)); break; case "Sürat Kargo": Dispatcher.BeginInvoke(() => SuratKargo.TakipGetir(Dispatcher, TakipDetay, Data._TakipKodu)); break; case "UPS Kargo": Dispatcher.BeginInvoke(() => UPSKargo.TakipGetir(Dispatcher, TakipDetay, Data._TakipKodu)); break; case "Yurtiçi Kargo": Dispatcher.BeginInvoke(() => YurticiKargo.TakipGetir(Dispatcher, TakipDetay, Data._TakipKodu)); break; default: break; } Sirketler.Visibility = Visibility.Collapsed; } catch (Exception) { MessageBox.Show("Bir sorun oluştu!\nTekrar deneyiniz.."); } }
public async Task Save() { if (SelectedIndex >= 0 && SelectedIndex < ImagePosts.Count) { bool cantSave = false; Models.API.APIPost.FileTypes fileType = (ImagePosts[SelectedIndex] as ImageViewerPostViewModel).FileType; if (fileType == Models.API.APIPost.FileTypes.webm || fileType == Models.API.APIPost.FileTypes.swf || fileType == Models.API.APIPost.FileTypes.gif) { cantSave = true; } ProgressIndicator progress = new ProgressIndicator { IsVisible = true, IsIndeterminate = true, Text = cantSave ? AppResources.ImageViewerPage_CantSave : AppResources.ImageViewerPage_SavingImage }; PhoneApplicationPage page = (App.Current.RootVisual as PhoneApplicationFrame).Content as PhoneApplicationPage; SystemTray.SetOpacity(page, 0.99); SystemTray.SetIsVisible(page, true); SystemTray.SetProgressIndicator(page, progress); if (cantSave) { await Task.Delay(1000); } else { bool result = await SaveInternal(ImagePosts[SelectedIndex] as ImageViewerPostViewModel); if (result) { progress.Text = AppResources.ImageViewerPage_ImageSaved; await Task.Delay(400); } else { progress.Text = AppResources.ImageViewerPage_ImageFailed; await Task.Delay(1000); } } SystemTray.SetProgressIndicator(page, null); SystemTray.SetIsVisible(page, false); } }
public void Attach() { if (DesignerProperties.IsInDesignTool) { return; } var page = this.GetVisualAncestors <PhoneApplicationPage>().First(); var progressIndicator = SystemTray.ProgressIndicator; if (progressIndicator != null) { return; } progressIndicator = new ProgressIndicator(); SystemTray.SetProgressIndicator(page, progressIndicator); Binding binding = new Binding("IsIndeterminate") { Source = this }; BindingOperations.SetBinding( progressIndicator, ProgressIndicator.IsIndeterminateProperty, binding); binding = new Binding("IsVisible") { Source = this }; BindingOperations.SetBinding( progressIndicator, ProgressIndicator.IsVisibleProperty, binding); binding = new Binding("Text") { Source = this }; BindingOperations.SetBinding( progressIndicator, ProgressIndicator.TextProperty, binding); binding = new Binding("Value") { Source = this }; BindingOperations.SetBinding( progressIndicator, ProgressIndicator.ValueProperty, binding); }
private void ToggleFavourite(object sender, EventArgs e) { Debug.Assert(set != null, "group != null"); SystemTray.SetProgressIndicator(this, new ProgressIndicator { IsIndeterminate = true, IsVisible = true, Text = set.Starred ? "Removing from favourites..." : "Adding to favourites..." }); set.SetStarred( !set.Starred, () => SystemTray.SetProgressIndicator(this, null), // The binding will update the UI. err => { }); }
private void StartPendingState(string status) { _isInPendingState = true; PendingOverlay.Visibility = Visibility.Visible; ((ApplicationBarIconButton)ApplicationBar.Buttons[0]).IsEnabled = false; ((ApplicationBarIconButton)ApplicationBar.Buttons[1]).IsEnabled = false; ((ApplicationBarIconButton)ApplicationBar.Buttons[2]).IsEnabled = false; ApplicationBar.IsMenuEnabled = false; SystemTray.SetProgressIndicator(this, new ProgressIndicator { IsVisible = true, IsIndeterminate = true, Text = status }); }
public backup() { InitializeComponent(); fioInstance = Filepicker_io.GetInstance(); heroku = new Heroku(); BackupWorker = new BackgroundWorker(); BackupWorker.DoWork += new DoWorkEventHandler(BackupWorker_DoWork); //BackupWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(BackupWorker_RunWorkerCompleted); DataLoader = new BackgroundWorker(); DataLoader.DoWork += new DoWorkEventHandler(DataLoader_DoWork); DataLoader.RunWorkerCompleted += new RunWorkerCompletedEventHandler(DataLoader_RunWorkerCompleted); pgIndicator = new ProgressIndicator(); SystemTray.SetProgressIndicator(this, pgIndicator); }
public MainPage() { InitializeComponent(); IsolatedStorageSettings.ApplicationSettings["session_data"] = 0L; IsolatedStorageSettings.ApplicationSettings.Save(); Loaded += new RoutedEventHandler(MainPage_Loaded); loginbtn = (ApplicationBarIconButton)ApplicationBar.Buttons[0]; progindicator = new ProgressIndicator(); SystemTray.SetProgressIndicator(this, progindicator); if (Network.IsConnected()) { auth = new Authentication(); auth.NewTokenReceived += new TokenReceivedEventHandler(auth_NewTokenReceived); } }
protected void ListaUsuarios(String id) { progress.IsVisible = true; progress.IsIndeterminate = true; progress.Text = "Atualizando Usuários..."; SystemTray.SetProgressIndicator(this, progress); string url = "http://srvwebservice.herokuapp.com/api/v1/usuarios_por_jogo/" + id; WebClient client = new WebClient(); client.OpenReadCompleted += Client_OpenReadCompleted; client.OpenReadAsync(new Uri(url, UriKind.Absolute)); }
public book_tickets() { InitializeComponent(); _progressIndicator = new ProgressIndicator(); _progressIndicator.IsIndeterminate = true; _progressIndicator.IsVisible = false; SystemTray.SetProgressIndicator(this, _progressIndicator); // Event handler for the hardware back key BackKeyPress += aptz_BackKeyPress; // Fast app resume events PhoneApplicationService.Current.Deactivated += Current_Deactivated; PhoneApplicationService.Current.Closing += Current_Closing; }
public ConfigPage() { InitializeComponent(); ProgressIndicator indicator = new ProgressIndicator() { IsVisible = false, IsIndeterminate = true, Text = "正在联系服务器" }; SystemTray.SetProgressIndicator(this, indicator); this.Loaded += ConfigPage_Loaded; }
public ImportTracks() { InitializeComponent(); _fileIO = new FileIO(); _serializer = new Serializer(); _miscFunctions = new MiscFunctions(); SystemTray.SetIsVisible(this, true); _prog = new ProgressIndicator(); SystemTray.SetProgressIndicator(this, _prog); Routes = new ObservableCollection <ExternalStorageFile>(); GetUserFolder(); DataContext = this; }
// Constructor public MainPage() { InitializeComponent(); Settings = IsolatedStorageSettings.ApplicationSettings; intro.checkconexion(); prog = new ProgressIndicator(); prog.IsIndeterminate = true; prog.IsVisible = false; SystemTray.SetProgressIndicator(this, prog); vm = new ViewModelPinchos(); vperfil = new ViewModelProfilePreferences(); _watcher.PositionChanged += Watcher_PositionChanged; iniciamapa(); peticionperfil(); }
private void SetLoadingEpisodeListVisibility(bool isVisible) { if (isVisible) { loadingLabel_List.Visibility = Visibility.Visible; loadingProgressBar_List.IsIndeterminate = true; } else { loadingLabel_List.Visibility = Visibility.Collapsed; loadingProgressBar_List.IsIndeterminate = false; SystemTray.SetProgressIndicator(this, null); } }
private void SubmitPassword(object sender, EventArgs e) { SystemTray.SetProgressIndicator(this, new ProgressIndicator { IsIndeterminate = true, IsVisible = true, }); set.SubmitPassword( password.Password, () => NavigationService.GoBack(), err => { SystemTray.SetProgressIndicator(this, null); MessageBox.Show(err.Message); }); }
public void hide(string options) { if (progressIndicator != null && page != null) { Deployment.Current.Dispatcher.BeginInvoke(() => { if (!sysTrayVisible) { SystemTray.IsVisible = false; } SystemTray.SetProgressIndicator(page, null); page.MouseLeftButtonUp -= ButtonEventHandler; }); } }
public LoginPage() { InitializeComponent(); TestUserBtn.Visibility = Visibility.Collapsed; #if DEBUG TestUserBtn.Visibility = Visibility.Visible; #endif App.FeedLastRefreshed = DateTime.MinValue; progress = new ProgressIndicator { IsVisible = false, IsIndeterminate = false, }; SystemTray.SetProgressIndicator(this, progress); }
private void GetMainPage() { ProgressIndicator pi = new ProgressIndicator(); pi.Text = "正在获取首页信息"; pi.IsIndeterminate = true; pi.IsVisible = true; SystemTray.SetProgressIndicator(this, pi); string url = "http://zh.moegirl.org/Mainpage"; Debug.WriteLine(url); HttpWebRequest hwr = (HttpWebRequest)WebRequest.Create(new Uri(url)); hwr.BeginGetResponse(GetMainPageCallback, hwr); }
// Constructor public MainPage() { InitializeComponent(); SystemTray.SetProgressIndicator(this, progressIndicator); // Set the data context of the listbox control to the sample data FavoriteItems = new ObservableCollection <BikeStopViewModel>(); FavoriteListView.ItemsSource = FavoriteItems; NearItems = new ObservableCollection <BikeStopViewModel>(); NearList.ItemsSource = NearItems; BuildLocalizedApplicationBar(0); }
public static ProgressIndicator ShowLoading(PhoneApplicationPage page) { var indicator = new ProgressIndicator { IsVisible = true, IsIndeterminate = true, Text = "Loading..." }; if (page != null) { SystemTray.SetProgressIndicator(page, indicator); } return(indicator); }
void bitmapImage_DownloadProgress(object sender, System.Windows.Media.Imaging.DownloadProgressEventArgs e) { try { SystemTray.IsVisible = true; SystemTray.SetProgressIndicator(imageViewer, new ProgressIndicator() { IsIndeterminate = true, Text = "Loading the Picture", Value = e.Progress }); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
protected ProgressIndicator AddIndicator() { if (_indicator == null) { _indicator = new ProgressIndicator { IsVisible = false, IsIndeterminate = true, Text = Strings.Loading, }; SystemTray.SetProgressIndicator(this, _indicator); } return(_indicator); }
public BooksPage() { InitializeComponent(); Application.Current.Host.Settings.EnableFrameRateCounter = false; // Init progress indicator ProgressIndicator progressIndicator = new ProgressIndicator(); progressIndicator.IsVisible = false; progressIndicator.IsIndeterminate = true; progressIndicator.Text = "..."; SystemTray.SetProgressIndicator(this, progressIndicator); this.buildFileList(); }
public void MainPage_Loaded(object sender, RoutedEventArgs e) { var progressIndicator = SystemTray.ProgressIndicator; if (progressIndicator != null) { return; } progressIndicatorRef = new ProgressIndicator(); SystemTray.SetProgressIndicator(this, progressIndicatorRef); progressIndicatorRef.Text = "Carregando..."; updatePanoramaPage(0); }
/// <summary> /// Clicking on the save button saves the photo in MainPage.ImageStream /// to media library camera roll. Once image has been saved, the /// application will navigate back to the main page. /// </summary> private async void SaveButton_Click(object sender, EventArgs e) { _progressIndicator.Text = AppResources.SavingText; _progressIndicator.IsVisible = true; SystemTray.SetProgressIndicator(this, _progressIndicator); int selectedIndex = FilterPreviewPivot.SelectedIndex; DataContext dataContext = FilterEffects.DataContext.Instance; GC.Collect(); try { if (selectedIndex == 0) { using (MediaLibrary library = new MediaLibrary()) { dataContext.FullResolutionStream.Position = 0; library.SavePictureToCameraRoll(FileNamePrefix + DateTime.Now.ToString() + ".jpg", dataContext.FullResolutionStream); } } else { AbstractFilter filter = _filters[selectedIndex]; IBuffer buffer = await filter.RenderJpegAsync( dataContext.FullResolutionStream.GetWindowsRuntimeBuffer()); using (MediaLibrary library = new MediaLibrary()) { library.SavePictureToCameraRoll(FileNamePrefix + DateTime.Now.ToString() + ".jpg", buffer.AsStream()); } } } catch (Exception ex) { MessageBox.Show("Failed to save the image: " + ex.ToString()); } _progressIndicator.IsVisible = false; SystemTray.SetProgressIndicator(this, _progressIndicator); NavigationService.GoBack(); }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); if (Data.Connection == null) { MessageBox.Show("Giriş yapmanız gerekiyor!"); NavigationService.Navigate(new Uri("/LoginPage.xaml", UriKind.Relative)); } else { if (NavigationContext.QueryString.ContainsKey("YearCode") && NavigationContext.QueryString.ContainsKey("No")) { YearCode = Convert.ToInt32(NavigationContext.QueryString["YearCode"]); No = Convert.ToInt32(NavigationContext.QueryString["No"]); Donem period = Data.Connection.Ogrenci.Donemler.SingleOrDefault(x => x.No == No && x.OgretimYiliKodu == YearCode); Title.Text = period.OgretimYili + " " + period.Adi; LessonList.ItemsSource = period.Dersler; } else { Donem period = Data.Connection.Ogrenci.Donemler.First(); YearCode = period.OgretimYiliKodu; No = period.No; LessonList.ItemsSource = period.Dersler; if (NetworkInterface.GetIsNetworkAvailable()) { ProgressIndicator indicator = new ProgressIndicator(); indicator.IsIndeterminate = true; indicator.IsVisible = true; try { indicator.Text = "Dersler güncelleniyor.."; Service1Client client = new Service1Client(); client.CurrentPeriodAsync(Data.Connection.OgrenciNo, Data.Connection.Sifre, "WP8"); client.CurrentPeriodCompleted += new EventHandler <CurrentPeriodCompletedEventArgs>(Completed); } catch (Exception) { indicator.Text = "Dersler yüklenemedi!"; } SystemTray.SetProgressIndicator(this, indicator); } } } }
public MainPage() { InitializeComponent(); // Repository für Laden/Sync erzeugen repository = new NewsRepository(); // ProgressIndicator erzeugen und anzeigen indicator = new ProgressIndicator(); indicator.Text = "Lade lokale Daten..."; indicator.IsIndeterminate = true; indicator.IsVisible = true; SystemTray.SetProgressIndicator(this, indicator); // Asynchrone Laden der lokalen Daten starten loadDataTask = repository.LoadLocalDataAsync(); }