private void GetProgressBarControl(string pb_name) { if (this.pb_Top == null) { this.pb_Top = this.GetTemplateChild(pb_name) as ProgressBar; } }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///Tweet.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (Mu_genotype1.Common.LayoutAwarePage)this.FindName("pageRoot"); primaryColumn = (Windows.UI.Xaml.Controls.ColumnDefinition)this.FindName("primaryColumn"); progbar = (Windows.UI.Xaml.Controls.ProgressBar)this.FindName("progbar"); titlePanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("titlePanel"); itemListScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemListScrollViewer"); itemListScrollViewer2 = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemListScrollViewer2"); PeerTweets = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("PeerTweets"); itemListView2 = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView2"); mediaPlayer = (Windows.UI.Xaml.Controls.MediaElement)this.FindName("mediaPlayer"); TweetBox = (Windows.UI.Xaml.Controls.TextBox)this.FindName("TweetBox"); TweetIt = (Windows.UI.Xaml.Controls.Button)this.FindName("TweetIt"); PinPanel = (Windows.UI.Xaml.Controls.StackPanel)this.FindName("PinPanel"); itemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView"); PinTb = (Windows.UI.Xaml.Controls.TextBox)this.FindName("PinTb"); VerifyPinButton = (Windows.UI.Xaml.Controls.Button)this.FindName("VerifyPinButton"); backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle"); pageSubtitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageSubtitle"); FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait"); FullScreenPortrait_Detail = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait_Detail"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); Snapped_Detail = (Windows.UI.Xaml.VisualState)this.FindName("Snapped_Detail"); TwitterConnectBtn = (Windows.UI.Xaml.Controls.Button)this.FindName("TwitterConnectBtn"); RefreshButton = (Windows.UI.Xaml.Controls.Button)this.FindName("RefreshButton"); }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///ArtistDetails.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (Mu_genotype1.Common.LayoutAwarePage)this.FindName("pageRoot"); primaryColumn = (Windows.UI.Xaml.Controls.ColumnDefinition)this.FindName("primaryColumn"); progbar = (Windows.UI.Xaml.Controls.ProgressBar)this.FindName("progbar"); titlePanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("titlePanel"); itemListScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemListScrollViewer"); itemDetail = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemDetail"); itemDetailGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("itemDetailGrid"); itemDetailTitlePanel = (Windows.UI.Xaml.Controls.StackPanel)this.FindName("itemDetailTitlePanel"); ArtistContentTb = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("ArtistContentTb"); itemTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("itemTitle"); itemSubtitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("itemSubtitle"); itemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView"); backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle"); FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait"); FullScreenPortrait_Detail = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait_Detail"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); Snapped_Detail = (Windows.UI.Xaml.VisualState)this.FindName("Snapped_Detail"); }
public LoadingPage() { this.Loaded += (sender, e) => { //ProgressBar progress = new ProgressBar(); progress.VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Top; progress.HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Center; progress.IsIndeterminate = true; progress.Visibility = Windows.UI.Xaml.Visibility.Collapsed; progress.Width = 400; ((Grid)this.Content).Children.Add(progress); //Error error = new Error(); error.VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Top; error.HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Right; error.Visibility = Windows.UI.Xaml.Visibility.Collapsed; error.Margin = new Thickness(0, 0, 30, 0); ((Grid)this.Content).Children.Add(error); //OfflineError offlineError = new OfflineError(); offlineError.VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Top; offlineError.HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Right; offlineError.Visibility = Windows.UI.Xaml.Visibility.Collapsed; offlineError.Margin = new Thickness(0, 0, 130, 0); ((Grid)this.Content).Children.Add(offlineError); }; }
internal Platform(Windows.UI.Xaml.Controls.Page page) { if (page == null) { throw new ArgumentNullException(nameof(page)); } _page = page; _container = new Canvas { Style = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["RootContainerStyle"] }; _page.Content = _container; _container.SizeChanged += OnRendererSizeChanged; MessagingCenter.Subscribe(this, Page.BusySetSignalName, (Page sender, bool enabled) => { Windows.UI.Xaml.Controls.ProgressBar indicator = GetBusyIndicator(); indicator.Visibility = enabled ? Visibility.Visible : Visibility.Collapsed; }); _toolbarTracker.CollectionChanged += OnToolbarItemsChanged; UpdateBounds(); InitializeStatusBar(); SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested; }
void init() { Background = new SolidColorBrush(ColorHelper.FromArgb(70, 0, 0, 0)); progressbar = new ProgressBar() { IsIndeterminate =true }; Children.Add(progressbar); }
internal Platform(Windows.UI.Xaml.Controls.Page page) { if (page == null) { throw new ArgumentNullException(nameof(page)); } _page = page; _container = new Canvas { Style = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["RootContainerStyle"] }; _page.Content = _container; _container.SizeChanged += OnRendererSizeChanged; MessagingCenter.Subscribe(this, Page.BusySetSignalName, (Page sender, bool enabled) => { Windows.UI.Xaml.Controls.ProgressBar indicator = GetBusyIndicator(); indicator.Visibility = enabled ? Visibility.Visible : Visibility.Collapsed; }); _toolbarTracker.CollectionChanged += OnToolbarItemsChanged; #if !WINDOWS_UWP // UWP gets subscribed in Forms.Init SubscribeAlertsAndActionSheets(); #endif UpdateBounds(); #if WINDOWS_UWP InitializeStatusBar(); #endif }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///CommentPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (TheBellyofAuthority.Common.LayoutAwarePage)this.FindName("pageRoot"); commentBar = (Windows.UI.Xaml.Controls.AppBar)this.FindName("commentBar"); DeleteButton = (Windows.UI.Xaml.Controls.Button)this.FindName("DeleteButton"); EditButton = (Windows.UI.Xaml.Controls.Button)this.FindName("EditButton"); commentThread = (Windows.UI.Xaml.Controls.ListView)this.FindName("commentThread"); commentLabel = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("commentLabel"); commentBox = (Windows.UI.Xaml.Controls.TextBox)this.FindName("commentBox"); postButton = (Windows.UI.Xaml.Controls.Button)this.FindName("postButton"); backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle"); UserPanel = (Windows.UI.Xaml.Controls.StackPanel)this.FindName("UserPanel"); progBar = (Windows.UI.Xaml.Controls.ProgressBar)this.FindName("progBar"); LabelBox = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("LabelBox"); UserBox = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("UserBox"); ApplicationViewStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("ApplicationViewStates"); FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); }
public async Task<String> signup(String username, String email, String password, ComboBox gender, DatePicker birthdate, ProgressBar progressBar) { HttpResponseMessage response = null; String responseString = null; _progressBar = progressBar; try { String formatted_gender = ""; if (gender.SelectedIndex != -1) { formatted_gender = ((ComboBoxItem)gender.SelectedItem).Content.ToString(); } if (password != "") { password = h.sha512(password); } String year = birthdate.Date.Year.ToString(); String month = birthdate.Date.Month.ToString().PadLeft(2, '0'); String day = birthdate.Date.Day.ToString().PadLeft(2, '0'); String formatted_birthdate = year + "-" + month + "-" + day; var values = new Dictionary<string, string> { { "username", username }, { "email", email }, { "password", password }, { "gender", formatted_gender }, { "birthdate", formatted_birthdate } }; HttpFormUrlEncodedContent formContent = new HttpFormUrlEncodedContent(values); IProgress<HttpProgress> progress = new Progress<HttpProgress>(ProgressHandler); _progressBar.Visibility = Windows.UI.Xaml.Visibility.Visible; response = await httpClient.PostAsync(new Uri(settings.API + "/register/"), formContent).AsTask(cts.Token, progress); responseString = await response.Content.ReadAsStringAsync(); Debug.WriteLine("register | responseString: " + responseString); } catch (TaskCanceledException) { Debug.WriteLine("register | Canceled"); } catch (Exception ex) { Debug.WriteLine("register | Error: " + ex.StackTrace); } finally { Debug.WriteLine("register | Completed"); resetProgressBar(); } return responseString; }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///MainPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); progressBar = (Windows.UI.Xaml.Controls.ProgressBar)this.FindName("progressBar"); }
public static TextBlock staticGettingAllStationsReports; // more kludge public BasicPageChecklist() { this.InitializeComponent(); staticProgressBarChangedEvent = progressBarChangedEvent; staticGettingAllStationsReports = gettingAllStationsReports; //crash: EventComboBox.DataContext = App.CurrentDisasterListForCombo; // NO LONGER SEPARATE LIST NEEDED ONCE BUG FIXED: EventListView.ItemsSource = App.CurrentDisasterListForCombo; EventListView.ItemsSource = App.CurrentDisasterList; //EventComboBox.DataContext = App.CurrentDisasterListForCombo; }
public static void RefreshUIOnDataLoaded(ProgressBar pb, CommandBar cb) { if (cb != null) { cb.Visibility = Windows.UI.Xaml.Visibility.Visible; } if (pb != null) { pb.IsIndeterminate = false; pb.Visibility = Windows.UI.Xaml.Visibility.Collapsed; } }
internal Platform(Windows.UI.Xaml.Controls.Page page) { if (page == null) { throw new ArgumentNullException("page"); } _page = page; _container = new Canvas { Style = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["RootContainerStyle"] }; _page.Content = _container; _container.SizeChanged += OnRendererSizeChanged; MessagingCenter.Subscribe(this, Page.BusySetSignalName, (Page sender, bool enabled) => { Windows.UI.Xaml.Controls.ProgressBar indicator = GetBusyIndicator(); indicator.Visibility = enabled ? Visibility.Visible : Visibility.Collapsed; }); _toolbarTracker.CollectionChanged += OnToolbarItemsChanged; MessagingCenter.Subscribe <Page, AlertArguments>(this, Page.AlertSignalName, OnPageAlert); MessagingCenter.Subscribe <Page, ActionSheetArguments>(this, Page.ActionSheetSignalName, OnPageActionSheet); UpdateBounds(); #if WINDOWS_UWP StatusBar statusBar = MobileStatusBar; if (statusBar != null) { statusBar.Showing += (sender, args) => UpdateBounds(); statusBar.Hiding += (sender, args) => UpdateBounds(); // UWP 14393 Bug: If RequestedTheme is Light (which it is by default), then the // status bar uses White Foreground with White Background. // UWP 10586 Bug: If RequestedTheme is Light (which it is by default), then the // status bar uses Black Foreground with Black Background. // Since the Light theme should have a Black on White status bar, we will set it explicitly. // This can be overriden by setting the status bar colors in App.xaml.cs OnLaunched. if (statusBar.BackgroundColor == null && statusBar.ForegroundColor == null && Windows.UI.Xaml.Application.Current.RequestedTheme == ApplicationTheme.Light) { statusBar.BackgroundColor = Colors.White; statusBar.ForegroundColor = Colors.Black; statusBar.BackgroundOpacity = 1; } } #endif }
public static void showProgressIndicator(String text) { // AccountFunctions.logMsg("progress:" + SystemTray.ProgressIndicator); ProgressBar pb = new ProgressBar(); pb.IsIndeterminate = true; pb.Visibility = Visibility.Visible; //StatusBar.ProgressIndicator = new ProgressIndicator();// has to be updated as per UWA //SystemTray.ProgressIndicator.IsIndeterminate = true; //SystemTray.ProgressIndicator.IsVisible = true; //SystemTray.ProgressIndicator.Text = text; }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///BlankPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); map = (Bing.Maps.Map)this.FindName("map"); progressBar = (Windows.UI.Xaml.Controls.ProgressBar)this.FindName("progressBar"); listViewVenues = (Windows.UI.Xaml.Controls.ListView)this.FindName("listViewVenues"); }
protected override void OnApplyTemplate() { base.OnApplyTemplate(); _playButton = GetTemplateChild(PlayButtonName) as ToggleButton; _stopButton = GetTemplateChild(StopButtonName) as Button; _fullButton = GetTemplateChild(FullButtonName) as ToggleButton; _muteButton = GetTemplateChild(MuteButtonName) as ToggleButton; _volumeBar = GetTemplateChild(VolumeBarName) as ProgressBar; _scheduleBar = GetTemplateChild(ScheduleBarName) as ProgressBar; _loaded = true; SetStates(); }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///MainPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); progressBar = (Windows.UI.Xaml.Controls.ProgressBar)this.FindName("progressBar"); DesktopArrows = (Windows.UI.Xaml.Controls.ToggleSwitch)this.FindName("DesktopArrows"); MetroStart = (Windows.UI.Xaml.Controls.ToggleSwitch)this.FindName("MetroStart"); AutoLogin = (Windows.UI.Xaml.Controls.ToggleSwitch)this.FindName("AutoLogin"); SmartScreen = (Windows.UI.Xaml.Controls.ToggleSwitch)this.FindName("SmartScreen"); }
Windows.UI.Xaml.Controls.ProgressBar GetBusyIndicator() { if (_busyIndicator == null) { _busyIndicator = new Windows.UI.Xaml.Controls.ProgressBar { IsIndeterminate = true, Visibility = Visibility.Collapsed, VerticalAlignment = VerticalAlignment.Top }; Canvas.SetZIndex(_busyIndicator, 1); _container.Children.Add(_busyIndicator); } return(_busyIndicator); }
internal Platform(Windows.UI.Xaml.Controls.Page page) { if (page == null) { throw new ArgumentNullException(nameof(page)); } _page = page; var current = Windows.UI.Xaml.Application.Current; if (!current.Resources.ContainsKey("RootContainerStyle")) { Windows.UI.Xaml.Application.Current.Resources.MergedDictionaries.Add(Forms.GetTabletResources()); } #if UWP_16299 if (!current.Resources.ContainsKey(ShellRenderer.ShellStyle)) { var myResourceDictionary = new Windows.UI.Xaml.ResourceDictionary(); myResourceDictionary.Source = new Uri("ms-appx:///Xamarin.Forms.Platform.UAP/Shell/ShellStyles.xbf"); Windows.UI.Xaml.Application.Current.Resources.MergedDictionaries.Add(myResourceDictionary); } #endif _container = new Canvas { Style = (Windows.UI.Xaml.Style)current.Resources["RootContainerStyle"] }; _page.Content = _container; _container.SizeChanged += OnRendererSizeChanged; MessagingCenter.Subscribe(this, Page.BusySetSignalName, (Page sender, bool enabled) => { Windows.UI.Xaml.Controls.ProgressBar indicator = GetBusyIndicator(); indicator.Visibility = enabled ? Visibility.Visible : Visibility.Collapsed; }); _toolbarTracker.CollectionChanged += OnToolbarItemsChanged; UpdateBounds(); InitializeStatusBar(); SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested; Windows.UI.Xaml.Application.Current.Resuming += OnResumingAsync; }
private async void OnClick2(object sender, RoutedEventArgs e) { Button btn = sender as Button; btn.IsEnabled = false; ProgressBar progBar2 = new ProgressBar(); progBar2.IsIndeterminate = true; prog.Children.Add(progBar2); await Task.Delay(20000); prog.Children.Remove(progBar2); btn.IsEnabled = true; }
public async Task<String> login(String username, String password, ProgressBar progressBar, Boolean useToken = false) { HttpResponseMessage response = null; String responseString = null; _progressBar = progressBar; _progressBar.Visibility = Windows.UI.Xaml.Visibility.Visible; if (!useToken) { password = h.sha512(password); } try { String device_id = h.getDeviceID(); var values = new Dictionary<string, string> { { "username", username }, { "password", password }, { "device_id", device_id } }; HttpFormUrlEncodedContent formContent = new HttpFormUrlEncodedContent(values); IProgress<HttpProgress> progress = new Progress<HttpProgress>(ProgressHandler); response = await httpClient.PostAsync(new Uri(settings.API + "/login/"), formContent).AsTask(cts.Token, progress); responseString = await response.Content.ReadAsStringAsync(); Debug.WriteLine("login | responseString: " + responseString); } catch (TaskCanceledException) { Debug.WriteLine("login | Canceled"); } catch (Exception ex) { Debug.WriteLine("login | Error: " + ex.StackTrace); } finally { Debug.WriteLine("login | Completed"); resetProgressBar(); } return responseString; }
/// <summary>${controls_MapProgressBar_method_onApplyTemplate_D}</summary> protected override void OnApplyTemplate() { base.OnApplyTemplate(); this.text = base.GetTemplateChild("ValueText") as TextBlock; this.bar = base.GetTemplateChild("Progress") as ProgressBar; if (DesignMode.DesignModeEnabled) { this.isVisible = true; if (this.bar != null) { this.bar.Value = 50.0; } if (this.text != null) { this.text.Text = string.Format("{0}%", 50); } } this.ChangeVisualState(false); }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///MapMusic.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (Mu_genotype1.Common.LayoutAwarePage)this.FindName("pageRoot"); progbar = (Windows.UI.Xaml.Controls.ProgressBar)this.FindName("progbar"); test = (Windows.UI.Xaml.Controls.Grid)this.FindName("test"); myMap = (Bing.Maps.Map)this.FindName("myMap"); SubHeaderTb = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("SubHeaderTb"); itemsGridView = (Windows.UI.Xaml.Controls.GridView)this.FindName("itemsGridView"); backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle"); FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///RecoTracks.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); pageRoot = (Mu_genotype1.Common.LayoutAwarePage)this.FindName("pageRoot"); progbar = (Windows.UI.Xaml.Controls.ProgressBar)this.FindName("progbar"); itemGridScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemGridScrollViewer"); itemListScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemListScrollViewer"); itemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView"); itemGridView = (Windows.UI.Xaml.Controls.GridView)this.FindName("itemGridView"); backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton"); pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle"); FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape"); Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled"); FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait"); Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped"); }
internal Platform(Windows.UI.Xaml.Controls.Page page) { if (page == null) { throw new ArgumentNullException("page"); } _page = page; _container = new Canvas { Style = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["RootContainerStyle"] }; _page.Content = _container; _container.SizeChanged += OnRendererSizeChanged; MessagingCenter.Subscribe(this, Page.BusySetSignalName, (Page sender, bool enabled) => { Windows.UI.Xaml.Controls.ProgressBar indicator = GetBusyIndicator(); indicator.Visibility = enabled ? Visibility.Visible : Visibility.Collapsed; }); _toolbarTracker.CollectionChanged += OnToolbarItemsChanged; MessagingCenter.Subscribe <Page, AlertArguments>(this, Page.AlertSignalName, OnPageAlert); MessagingCenter.Subscribe <Page, ActionSheetArguments>(this, Page.ActionSheetSignalName, OnPageActionSheet); UpdateBounds(); #if WINDOWS_UWP if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar")) { StatusBar statusBar = StatusBar.GetForCurrentView(); statusBar.Showing += (sender, args) => UpdateBounds(); statusBar.Hiding += (sender, args) => UpdateBounds(); } #endif }
public void InitializeComponent() { if (_contentLoaded) return; _contentLoaded = true; Application.LoadComponent(this, new System.Uri("ms-appx:///BlankPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application); LoginGridAppear = (Windows.UI.Xaml.Media.Animation.Storyboard)this.FindName("LoginGridAppear"); LoginGridDisappear = (Windows.UI.Xaml.Media.Animation.Storyboard)this.FindName("LoginGridDisappear"); InfoAppear = (Windows.UI.Xaml.Media.Animation.Storyboard)this.FindName("InfoAppear"); InfoDisappear = (Windows.UI.Xaml.Media.Animation.Storyboard)this.FindName("InfoDisappear"); MainPanel = (Windows.UI.Xaml.Controls.StackPanel)this.FindName("MainPanel"); LoginGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("LoginGrid"); InfoGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("InfoGrid"); TitleInfoTbx = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("TitleInfoTbx"); SubtitleInfoTbx = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("SubtitleInfoTbx"); SummaryInfoTbx = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("SummaryInfoTbx"); LoginProgbar = (Windows.UI.Xaml.Controls.ProgressBar)this.FindName("LoginProgbar"); UsernameTBx = (Windows.UI.Xaml.Controls.TextBox)this.FindName("UsernameTBx"); PwBx = (Windows.UI.Xaml.Controls.PasswordBox)this.FindName("PwBx"); LoginBtn = (Windows.UI.Xaml.Controls.Button)this.FindName("LoginBtn"); SignUpBtn = (Windows.UI.Xaml.Controls.Button)this.FindName("SignUpBtn"); AlbumArtHolder = (Windows.UI.Xaml.Controls.Image)this.FindName("AlbumArtHolder"); SongTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("SongTitle"); Artist = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("Artist"); LoveBtn = (Windows.UI.Xaml.Controls.Button)this.FindName("LoveBtn"); BanBtn = (Windows.UI.Xaml.Controls.Button)this.FindName("BanBtn"); Collection = (Windows.UI.Xaml.Controls.Button)this.FindName("Collection"); RecoArtistsButton = (Windows.UI.Xaml.Controls.Button)this.FindName("RecoArtistsButton"); RecoTracksButton = (Windows.UI.Xaml.Controls.Button)this.FindName("RecoTracksButton"); TrendsButton = (Windows.UI.Xaml.Controls.Button)this.FindName("TrendsButton"); TweetButton = (Windows.UI.Xaml.Controls.Button)this.FindName("TweetButton"); MapButton = (Windows.UI.Xaml.Controls.Button)this.FindName("MapButton"); MuConnectButton = (Windows.UI.Xaml.Controls.Button)this.FindName("MuConnectButton"); InfoBtn = (Windows.UI.Xaml.Controls.Button)this.FindName("InfoBtn"); }
/// <summary> /// Invoked whenever application code or internal processes (such as a rebuilding layout pass) call ApplyTemplate. In simplest terms, this means the method is called just before a UI element displays in your app. Override this method to influence the default post-template logic of a class. /// </summary> protected override void OnApplyTemplate() { base.OnApplyTemplate(); _layoutRoot = GetTemplateChild(LayoutRootPanelName) as Panel; _webView = (WebView)GetTemplateChild(WebViewName); _webViewBrush = GetTemplateChild(WebViewBrushName) as WebViewBrush; _addressBar = GetTemplateChild(AddressBarName) as TextBox; _titleBar = GetTemplateChild(TitleTextBlockName) as TextBlock; _favIconImage = GetTemplateChild(FavIconImageName) as Image; _progressIndicator = GetTemplateChild(ProgressIndicatorName) as ProgressBar; _backButton = GetTemplateChild(BackButtonName) as Button; _forwardButton = GetTemplateChild(ForwardButtonName) as Button; _goButton = GetTemplateChild(GoButtonName) as Button; _stopButton = GetTemplateChild(StopButtonName) as Button; _refreshButton = GetTemplateChild(RefreshButtonName) as Button; _addressAppBar = GetTemplateChild(AddressAppBarName) as CustomAppBar; _titleAppBar = GetTemplateChild(TitleAppBarName) as CustomAppBar; VisualStateManager.GoToState(this, AddressBarUnfocusedStateName, true); if (_addressBar != null) { _addressBar.KeyDown += OnAddressBarKeyDown; _addressBar.KeyUp += OnAddressBarKeyUp; _addressBar.GotFocus += OnAddressBarGotFocus; _addressBar.LostFocus += OnAddressBarLostFocus; _addressBar.TextChanged += OnAddressBarTextChanged; } if (_backButton != null) { _backButton.IsEnabled = false; _backButton.Click += OnBackButtonClick; } if (_forwardButton != null) { _forwardButton.IsEnabled = false; _forwardButton.Click += OnForwardButtonClick; } if (_goButton != null) { //_goButton.IsEnabled = false; _goButton.Click += OnGoButtonClick; } if (_stopButton != null) { _stopButton.IsEnabled = false; _stopButton.Click += OnStopButtonClick; } if (_refreshButton != null) { _refreshButton.IsEnabled = false; _refreshButton.Click += OnRefreshButtonClick; } if (_addressAppBar != null) { _addressAppBar.Opened += OnAppBarOpenedOrClosed; _addressAppBar.Closed += OnAppBarOpenedOrClosed; } if (_titleAppBar != null) { _titleAppBar.Opened += OnAppBarOpenedOrClosed; _titleAppBar.Closed += OnAppBarOpenedOrClosed; } _webView.NavigationCompleted += OnNavigationCompleted; if (this.Source != null) { _webView.Source = this.Source; } else { this.Source = _webView.Source; } if (_pendingNavigation) { Navigate(this.Source); } }
public ProgressBarHelper(ProgressBar progressIndicator, Action callback) { m_nTaskInProcess = 0; m_progressBar = progressIndicator; m_delAllTaskCompleCallback = callback; }
private async void DownloadFirmware_Click(object sender, RoutedEventArgs e) { //const string InstallUrl = "http://pebblebits.com/firmware/2.0.1-ev2_4-battery-sym+en.pbz"; const string InstallUrl = "https://pebblefw.s3.amazonaws.com/pebble/ev2_4/release/pbz/normal_ev2_4_v1.14.1_release-v1.x-34.pbz"; this._currentProgressBar = this.InstallFirmwareProgress; await InstallBundle(InstallUrl); // Reset the connection this.NotConnected(); }
public async Task<String> device_id(ProgressBar progressBar) { HttpResponseMessage response = null; String responseString = null; _progressBar = progressBar; try { String device_id = h.getDeviceID(); var values = new Dictionary<string, string> { { "device", "PicLoc UWP/" + settings.APP_version } }; HttpFormUrlEncodedContent formContent = new HttpFormUrlEncodedContent(values); IProgress<HttpProgress> progress = new Progress<HttpProgress>(ProgressHandler); _progressBar.Visibility = Windows.UI.Xaml.Visibility.Visible; response = await httpClient.PostAsync(new Uri(settings.API + "/device_id/"), formContent).AsTask(cts.Token, progress); responseString = await response.Content.ReadAsStringAsync(); Debug.WriteLine("device_id | responseString: " + responseString); } catch (TaskCanceledException) { Debug.WriteLine("device_id | Canceled"); } catch (Exception ex) { Debug.WriteLine("device_id | Error: " + ex.StackTrace); } finally { Debug.WriteLine("device_id | Completed"); } return responseString; }
/// <summary> /// Invoked whenever application code or internal processes (such as a rebuilding layout pass) call ApplyTemplate. In simplest terms, this means the method is called just before a UI element displays in your app. Override this method to influence the default post-template logic of a class. /// </summary> /// <exception cref="System.InvalidOperationException"> /// PART_ProgressIndicator is missing from the template. /// or /// PART_Text is missing from the template. /// or /// PART_Time is missing from the template. /// </exception> protected override void OnApplyTemplate() { base.OnApplyTemplate(); this.progressIndicator = base.GetTemplateChild(PART_ProgressIndicator) as ProgressBar; if(this.progressIndicator == null) { throw new InvalidOperationException("PART_ProgressIndicator is missing from the template."); } this.text = base.GetTemplateChild(PART_Text) as TextBlock; if (this.text == null) { throw new InvalidOperationException("PART_Text is missing from the template."); } this.text.Text = this.Text ?? string.Empty; this.time = base.GetTemplateChild(PART_Time) as TextBlock; if (this.time == null) { throw new InvalidOperationException("PART_Time is missing from the template."); } this.time.Text = DateTime.Now.ToString("H:mm"); if (!this.timer.IsEnabled) { this.timer.Start(); } }
public async Task<String> sendSnap(String username, String password, ProgressBar progressBar, String userTo, StorageFile file, int time) { HttpResponseMessage response = null; String responseString = null; _progressBar = progressBar; _progressBar.Visibility = Windows.UI.Xaml.Visibility.Visible; try { IInputStream inputStream = await file.OpenAsync(FileAccessMode.Read); String device_id = h.getDeviceID(); HttpMultipartFormDataContent multipartContent = new HttpMultipartFormDataContent(); Debug.WriteLine("sendSnap | File name: " + file.Name); multipartContent.Add( new HttpStreamContent(inputStream), "snap", file.Name); multipartContent.Add(new HttpStringContent(username), "username"); multipartContent.Add(new HttpStringContent(password), "password"); multipartContent.Add(new HttpStringContent(h.getDeviceID()), "device_id"); multipartContent.Add(new HttpStringContent(userTo), "send_snap_to"); multipartContent.Add(new HttpStringContent(time.ToString()), "send_snap_time"); IProgress<HttpProgress> progress = new Progress<HttpProgress>(ProgressHandler); response = await httpClient.PostAsync(new Uri(settings.API + "/send_snap/"), multipartContent).AsTask(cts.Token, progress); responseString = await response.Content.ReadAsStringAsync(); Debug.WriteLine("sendSnap | responseString: " + responseString); } catch (TaskCanceledException) { Debug.WriteLine("sendSnap | Canceled"); } catch (Exception ex) { Debug.WriteLine("sendSnap | Error: " + ex.StackTrace); } finally { Debug.WriteLine("sendSnap | Completed"); resetProgressBar(); } return responseString; }
public async Task<Boolean> getSnap(String username, String password, int snapID, ProgressBar progressBar) { HttpResponseMessage response = null; String responseString = null; _progressBar = progressBar; _progressBar.Visibility = Windows.UI.Xaml.Visibility.Visible; try { String device_id = h.getDeviceID(); var values = new Dictionary<string, string> { { "username", username }, { "password", password }, { "device_id", device_id }, { "snap_id", snapID.ToString() } }; Debug.WriteLine("getSnap | user: "******"getSnap | pass: "******"getSnap | did: " + device_id); Debug.WriteLine("getSnap | snap: " + snapID.ToString()); HttpFormUrlEncodedContent formContent = new HttpFormUrlEncodedContent(values); IProgress<HttpProgress> progress = new Progress<HttpProgress>(ProgressHandler); response = await httpClient.PostAsync(new Uri(settings.API + "/get_snap/"), formContent).AsTask(cts.Token, progress); responseString = await response.Content.ReadAsStringAsync(); } catch (TaskCanceledException) { Debug.WriteLine("getSnap | Canceled"); } catch (Exception ex) { Debug.WriteLine("getSnap | Error: " + ex.StackTrace); } finally { Debug.WriteLine("getSnaps | Completed"); resetProgressBar(); } JObject jo = null; if (response.Content.Headers.ContentType.ToString() == "image/png") { Debug.WriteLine("Snap is good"); try { StorageFolder image = await h.getImageFolder(); StorageFile file = await image.CreateFileAsync(snapID + ".jpg", CreationCollisionOption.ReplaceExisting); await FileIO.WriteBufferAsync(file, await response.Content.ReadAsBufferAsync()); return true; } catch (System.Exception ex) { h.showSingleButtonDialog("Snap download error", "There was an error savind the snap: " + ex.Message, "Close"); return false; } } else { jo = JObject.Parse(responseString); h.showSingleButtonDialog("Server error [" + jo["code"] + "]", ((jo["message"] != null) ? jo["message"].ToString() : "No server message was provided"), "Dismiss"); return false; } }
public void UpdateControls(ProgressBar levelBar, TextBlock levelText, TextBlock expText) { float experienceTowardsNextLevel = (float)ExperienceTable[Level]; float possessedExp = (float)Experience; float percentage = possessedExp / experienceTowardsNextLevel; levelBar.Maximum = 100.0f; levelBar.Minimum = 0.0f; levelBar.Value = percentage * 100.0f; string finalLevelText = "Level: " + Level.ToString(); string finalExpText = "( " + possessedExp.ToString() + " / " + experienceTowardsNextLevel.ToString() + " )"; levelText.Text = finalLevelText; expText.Text = finalExpText; }
private async void DownloadApp_Click(object sender, RoutedEventArgs e) { //const string InstallUrl = "http://pebble-static.s3.amazonaws.com/watchfaces/apps/simplicity.pbw"; const string InstallUrl = "http://u.jdiez.me/pixel.pbw"; this._currentProgressBar = this.InstallAppProgress; await InstallBundle(InstallUrl); }
protected override void OnApplyTemplate() { base.OnApplyTemplate(); _layoutRoot = GetTemplateChild(LayoutRootPanelName) as Panel; _webView = GetTemplateChild(WebViewName) as WebView; _addressBar = GetTemplateChild(AddressBarName) as TextBox; _titleBar = GetTemplateChild(TitleTextBlockName) as TextBlock; _favIconImage = GetTemplateChild(FavIconImageName) as Image; _progressIndicator = GetTemplateChild(ProgressIndicatorName) as ProgressBar; _backButton = GetTemplateChild(BackButtonName) as Button; _forwardButton = GetTemplateChild(ForwardButtonName) as Button; _goButton = GetTemplateChild(GoButtonName) as Button; _stopButton = GetTemplateChild(StopButtonName) as Button; _refreshButton = GetTemplateChild(RefreshButtonName) as Button; VisualStateManager.GoToState(this, AddressBarUnfocusedStateName, true); _addressBar.KeyDown += OnAddressBarKeyDown; _addressBar.KeyUp += OnAddressBarKeyUp; _addressBar.GotFocus += OnAddressBarGotFocus; _addressBar.LostFocus += OnAddressBarLostFocus; _addressBar.TextChanged += OnAddressBarTextChanged; // TODO: Handle undefined template parts _backButton.IsEnabled = false; _forwardButton.IsEnabled = false; _goButton.IsEnabled = false; _stopButton.IsEnabled = false; _refreshButton.IsEnabled = false; _backButton.Click += OnBackButtonClick; _forwardButton.Click += OnForwardButtonClick; _goButton.Click += OnGoButtonClick; _stopButton.Click += OnStopButtonClick; _refreshButton.Click += OnRefreshButtonClick; if (this.Source != null) { _webView.Source = this.Source; } else { this.Source = _webView.Source; } _webView.LoadCompleted += OnLoadCompleted; _webView.NavigationFailed += OnNavigationFailed; }