private void init(AppInfo appInfo, HMS.Auth.IHttpClient hmsClient) { spglb.setPlatform(appInfo.platform.ToString()); MainPage = new NavigationPage(new pageStart(false, hmsClient)); ((NavigationPage)MainPage).Popped += (object sender, NavigationEventArgs e) => { if (e.Page is pageSetup) { // allow save() ((pageSetup)e.Page).willClose(); } else { ((pageBase)(e.Page)).cancelRunningTask(); } // update the status bar ((pageBase)((NavigationPage)MainPage).CurrentPage).setServerUser(); ((pageBase)((NavigationPage)MainPage).CurrentPage).setPlatform(appInfo.platform.ToString()); // ((pageBase)e.Page).setServerUser(); }; ((NavigationPage)MainPage).Pushed += (object sender, NavigationEventArgs e) => { pageBase.NameWidth = (int)Application.Current.MainPage.Width / 3; // ((pageBase)e.Page).setServerUser(); }; }
public pageStart(Boolean withListView, HMS.Auth.IHttpClient hmsClient) : base(withListView) { init(withListView, hmsClient); this.hide_running(); }
public void init(HMS.Auth.AppPlatform platform, HMS.Auth.IHttpClient hmsClient) { this.platform = platform; this.hmsClient = hmsClient; lbl = new Label { HorizontalTextAlignment = TextAlignment.Center, Text = "Welcome to Xamarin Forms!" }; // The root page of your application var content = new ContentPage { Title = "App1", Content = new StackLayout { VerticalOptions = LayoutOptions.Center, Children = { lbl } } }; MainPage = new NavigationPage(content); update(); }
public App(HMS.Auth.AppPlatform platform, HMS.Auth.IHttpClient hmsClient) { init(platform, hmsClient); }
/// <summary> /// initialize the app for the given platform <para/> /// hmsClient may replace the System.Net.HTTPClient. This is needed for UWP and POST requests.<para/> /// </summary> /// <param name="appInfo"></param> /// <param name="hmsClient"></param> public App(AppInfo appInfo, HMS.Auth.IHttpClient hmsClient) { init(appInfo, hmsClient); }
private void init(Boolean withListView, HMS.Auth.IHttpClient hmsClient) { // store the hmsClient HMS.Auth.haHttpClient.hmsClient = hmsClient; // this is a test for a modal dialog Button btnDebug = this.createButton("Debug"); btnDebug.Clicked += async(sender, e) => { pageConfirm pc = new pageConfirm(false, "This is just a test for a modal dialog.", true); await Navigation.PushAsync(pc); await pc.PageClosedTask; // Wait here until the confirmPage is dismissed var ret = pc.Return; }; Button btnBrowse = this.createButton("Browse"); btnBrowse.Clicked += async(sender, e) => { await Navigation.PushAsync(new pageBrowse(true)); }; Button btnSetup = this.createButton("Setup"); btnSetup.Clicked += async(sender, e) => { await Navigation.PushAsync(new pageSetup(false)); }; // create the left pane containig the buttons StackLayout btnLayout = new StackLayout() { HorizontalOptions = LayoutOptions.Center, Orientation = StackOrientation.Vertical }; btnLayout.Children.Add(btnDebug); btnLayout.Children.Add(btnBrowse); btnLayout.Children.Add(btnSetup); Label labelInfo = new Label(); labelInfo.Text = "For more information about HMS see:"; btnLayout.Children.Add(labelInfo); Label labelUri = new Label(); labelUri.Text = "http://www.hypermediasystems.de/"; var tapGestureRecognizer = new TapGestureRecognizer(); tapGestureRecognizer.Tapped += (s, e) => { Device.OpenUri(new Uri(((Label)s).Text)); }; labelUri.GestureRecognizers.Add(tapGestureRecognizer); btnLayout.Children.Add(labelUri); base.contentStack.Children.Add(btnLayout); // Put the StackLayout in a ScrollView. Content = base.mainStack; this.setServerUser(); this.hide_running(); }