protected override void OnCreate(Bundle savedInstanceState) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(savedInstanceState); string base64Question = null; if (Intent.Extras != null) { string questionKey = "question"; if (Intent.Extras.ContainsKey(questionKey)) { base64Question = Intent.Extras.GetString(questionKey); } } Xamarin.Essentials.Platform.Init(this, savedInstanceState); Forms.Init(this, savedInstanceState); var app = new Core.App(base64Question); RegisterNativeServices(); LoadApplication(app); }
protected override async void OnCreate(Bundle bundle) { base.OnCreate(bundle); Forms.Init(this, bundle); App.ScreenWidth = (int)Resources.DisplayMetrics.WidthPixels; App.ScreenHeight = (int)Resources.DisplayMetrics.HeightPixels; //FormsMaps.Init(this, bundle); Xamarin.FormsGoogleMaps.Init(this, bundle); await CrossMedia.Current.Initialize(); //Remove the icon in the navigation bar // ActionBar.SetIcon(Android.Resource.Color.Transparent); //ActionBar.SetBackgroundDrawable(new ColorDrawable(Xamarin.Forms.Color.FromHex("#aa80ff").ToAndroid())); var mvxFormsApp = new Core.App(); LoadApplication(mvxFormsApp); var presenter = Mvx.Resolve <IMvxViewPresenter>() as MvxFormsDroidPagePresenter; presenter.MvxFormsApp = mvxFormsApp; UserDialogs.Init(this); Mvx.Resolve <IMvxAppStart>().Start(); }
protected override IMvxApplication CreateApp() { var appSettings = Mvx.Resolve <IAppSettings>(); var app = new Core.App(appSettings); return(app); }
public override void DidFinishLaunching(NSNotification notification) { Forms.Init(); var app = new Core.App(); LoadApplication(app); base.DidFinishLaunching(notification); }
public static void Main() { SplashScreen splashScreen = new SplashScreen("intro.png"); splashScreen.Show(true); Core.App app = new Core.App(); app.InitializeComponent(); app.Run(); }
public MainPage() { this.InitializeComponent(); Core.App coreApp = new Core.App(); RegisterPlatformServices(); LoadApplication(coreApp); }
protected override IMvxIosViewPresenter CreatePresenter() { Forms.Init(); //Xamarin.FormsMaps.Init(); Xamarin.FormsGoogleMaps.Init(MapsApiKey); var xamarinFormsApp = new Core.App(); var presenter = new MvxFormsIosPagePresenter(Window, xamarinFormsApp); return(presenter); }
private async void OnRemoveApp(Core.App app) { if (_pebble.IsAlive == false) { return; } await _pebble.RemoveAppAsync(app); await LoadAppsAsync(); }
public static void Main(string[] args) { Gtk.Application.Init(); Forms.Init(); var app = new Core.App(new ImageFileSelector()); var window = new FormsWindow(); window.LoadApplication(app); window.Show(); Gtk.Application.Run(); }
/// <summary> /// Shows toast message with given text /// </summary> /// <param name="app">app object; unused</param> /// <param name="message">toast message</param> private void ShowToast(Core.App app, string message) { ToastNotifier toastNotifier = ToastNotificationManager.CreateToastNotifier(); Windows.Data.Xml.Dom.XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText02); Windows.Data.Xml.Dom.XmlNodeList toastNodeList = toastXml.GetElementsByTagName("text"); toastNodeList.Item(0).AppendChild(toastXml.CreateTextNode(Constants.AppTitle)); toastNodeList.Item(1).AppendChild(toastXml.CreateTextNode(message)); var toast = new ToastNotification(toastXml); toast.ExpirationTime = DateTime.Now.AddSeconds(4); toastNotifier.Show(toast); }
static void Main(string[] args) { var app = new Core.App(); string command = null; Console.Write("anonet: "); while ((command = Console.ReadLine()) != "quit") { app.Execute(command); Console.Write("anonet: "); } app.Dispose(); }
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); global::Xamarin.Forms.Forms.Init(this, bundle); Plugin.CurrentActivity.CrossCurrentActivity.Current.Init(this, bundle); var cv = typeof(Xamarin.Forms.CarouselView); var assembly = Assembly.Load(cv.FullName); // https://blog.xamarin.com/flip-through-items-with-xamarin-forms-carouselview/ app = new Core.App(new AndroidInitializer()); LoadApplication(app); }
public MainPage() { this.InitializeComponent(); if (App.Current.Resources.TryGetValue("launchedQuestion", out object launchedQuestion)) { // if it exists, clear it after reading it App.Current.Resources.Remove("launchedQuestion"); } var app = new Core.App((string)launchedQuestion); RegisterNativeServices(); LoadApplication(app); }
protected override void OnCreate(Bundle savedInstanceState) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(savedInstanceState); global::Xamarin.Forms.Forms.Init(this, savedInstanceState); _app = new Core.App(); LoadApplication(_app); // The following does not seems to be intercepting exceptions // TODO: investigate this AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException; AndroidEnvironment.UnhandledExceptionRaiser += AndroidEnvironment_UnhandledExceptionRaiser; }
/// <summary> /// Clears cache of the web view control /// </summary> /// <param name="app">app object; unused</param> private void ClearCache(Core.App app) { if (this.Control == null) { return; } try { this.Control.ClearHistory(); this.Control.ClearFormData(); this.Control.ClearCache(true); } catch (Exception) { // ignore exception when clearing cache } }
public void DoDesignSetup() { if (_app == null) { MvxSimpleIoCContainer.Initialize(); Mvx.RegisterSingleton <INotificationService>( new NotificationServiceDesign()); Mvx.RegisterSingleton <IMvxMessenger>( new MvxMessengerHub()); Locator = new ViewModelLocator(); _app = new Core.App(Locator); _app.Initialize(); var stateService = new StateService(); Mvx.RegisterSingleton <IStateService>(stateService); stateService.Restore(); } }
/// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used such as when the application is launched to open a specific file. /// </summary> /// <param name="e">Details about the launch request and process.</param> protected override void OnLaunched(LaunchActivatedEventArgs e) { var rootFrame = Window.Current.Content as Frame; var app = new Core.App(); // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (rootFrame == null) { // Create a Frame to act as the navigation context and navigate to the first page rootFrame = new Frame(); rootFrame.NavigationFailed += OnNavigationFailed; if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { //TODO: Load state from previously suspended application } // Place the frame in the current Window Window.Current.Content = rootFrame; } if (e.PrelaunchActivated == false) { if (rootFrame.Content == null) { // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter rootFrame.Navigate(typeof(MainPage), e.Arguments); } // Ensure the current window is active Window.Current.Activate(); } }
protected override MvxApplication CreateApp() { var app = new Core.App(); return(app); }
/// <summary> /// Shows toast message with given text /// </summary> /// <param name="app">sender app object</param> /// <param name="message">toast message</param> private void ShowToast(Core.App app, string message) { Core.App.RunOnUiThread( () => Toast.MakeText(this, message, ToastLength.Long).Show()); }
/// <summary> /// Shows toast message with given text /// </summary> /// <param name="app">app object; unused</param> /// <param name="message">toast message</param> private void ShowToast(Core.App app, string message) { Toast.MakeText(this, message, ToastLength.Short).Show(); }
protected override MvxApplication CreateApp() { var app = new Core.App(); return app; }
public static void Main() { Core.App app = new Core.App(); app.InitializeComponent(); app.Run(); }