Exemplo n.º 1
0
        public App()
        {
            InitializeComponent();

            app = this;
            _AuthenticationService = DependencyService.Get<IAuthenticationService>();

            /* if we were targeting Windows Phone, we'd want to include the next line. */
            // if (Device.OS != TargetPlatform.WinPhone) 
            TextResources.Culture = DependencyService.Get<ILocalize>().GetCurrentCultureInfo();

#if TRY_APP_SERVICE
            // Don't show splash screen for Try App Service version of client
            _AuthenticationService.BypassAuthentication();
            GoToRoot();
#else
            // If the App.IsAuthenticated property is false, modally present the SplashPage.
            if (!_AuthenticationService.IsAuthenticated)
            {
                MainPage = new SplashPage();
            }
            else
            {
                GoToRoot();
            }
#endif
        }
Exemplo n.º 2
0
 /// <summary>
 /// Overrides this method if want to handle behavior when the application is launched.
 /// If base.OnCreated() is not called, the event 'Created' will not be emitted.
 /// </summary>
 protected override void OnCreate()
 {
     base.OnCreate();
     Xamarin.Forms.Application xamarinApp = new Xamarin.Forms.Application();
     TSystem.Display.StateChanged += Display_StateChanged;
     xamarinApp.MainPage           = new WeatherWatchPage();
     _viewModel = (WeatherWatchPageModel)xamarinApp.MainPage.BindingContext;
     LoadWatchface(xamarinApp);
 }
        public UIGameComponent(Application application)
            : base(Forms.Game)
        {
            if (application == null)
                throw new ArgumentNullException("application");

            Application = application;
            SetPage(Application.MainPage);
        }
Exemplo n.º 4
0
        private void SetColorResource(xf.Application app)
        {
            ((TsinghuaNet.XF.App)app).UpdateResources(GetOtherResources());

            var mergedDictionaries = app.Resources.MergedDictionaries;

            mergedDictionaries.Clear();
            mergedDictionaries.Add(GetColorTheme());
        }
        public void SetUseBottomTabs()
        {
            Xamarin.Forms.Mocks.MockForms.Init(Device.Android);
            var _ = new Xamarin.Forms.Application();
            IPageBehaviorFactory factory = new ExtendedPageBehaviorFactory(new DefaultPageBehaviorFactoryOptions());

            var page = new TabbedPage();

            ConfigurePage(page);
            factory.ApplyPageBehaviors(page);

            Assert.Equal(ToolbarPlacement.Bottom, AndroidTabbedPage.GetToolbarPlacement(page));
        }
        public void AddsChildTitleBehavior()
        {
            Xamarin.Forms.Mocks.MockForms.Init();
            var _ = new Xamarin.Forms.Application();
            IPageBehaviorFactory factory = new ExtendedPageBehaviorFactory(new DefaultPageBehaviorFactoryOptions());

            var page = new TabbedPage();

            ConfigurePage(page);
            factory.ApplyPageBehaviors(page);

            Assert.Contains(page.Behaviors, b => b.GetType() == typeof(TabbedPageChildTitleBehavior));
        }
        public void SetsUseSafeArea()
        {
            Xamarin.Forms.Mocks.MockForms.Init(Device.iOS);
            var _ = new Xamarin.Forms.Application();
            IPageBehaviorFactory factory = new ExtendedPageBehaviorFactory(new DefaultPageBehaviorFactoryOptions());

            var page = new ContentPage();

            ConfigurePage(page);
            factory.ApplyPageBehaviors(page);

            Assert.True(page.On <iOS>().UsingSafeArea());
        }
        public void SetsPreferLargeTitles()
        {
            Xamarin.Forms.Mocks.MockForms.Init(Device.iOS);
            var _ = new Xamarin.Forms.Application();
            IPageBehaviorFactory factory = new ExtendedPageBehaviorFactory(new DefaultPageBehaviorFactoryOptions());

            var page = new NavigationPage();

            ConfigurePage(page);
            factory.ApplyPageBehaviors(page);

            Assert.True(page.On <iOS>().PrefersLargeTitles());
        }
        public void SetsTitleBinding()
        {
            Xamarin.Forms.Mocks.MockForms.Init();
            var _ = new Xamarin.Forms.Application();
            IPageBehaviorFactory factory = new ExtendedPageBehaviorFactory(new DefaultPageBehaviorFactoryOptions());

            var page = new TabbedPage
            {
                BindingContext = new DefaultViewModel()
            };

            ConfigurePage(page);
            factory.ApplyPageBehaviors(page);

            Assert.True(page.IsSet(Xamarin.Forms.Page.TitleProperty));
        }
Exemplo n.º 10
0
        public App()
        {
            app = this;
            _AuthenticationService = DependencyService.Get<IAuthenticationService>();

            /* if we were targeting Windows Phone, we'd want to include the next line. */
            // if (Device.OS != TargetPlatform.WinPhone) 
            TextResources.Culture = DependencyService.Get<ILocalize>().GetCurrentCultureInfo();


            // If the App.IsAuthenticated property is false, modally present the SplashPage.
            if (!_AuthenticationService.IsAuthenticated)
            {
                MainPage = new SplashPage();
            }
            else
            {
                GoToRoot();
            }

        }
Exemplo n.º 11
0
        public void LoadApplication(XApplication application)
        {
            if (Window == null)
            {
                throw new NullReferenceException("MainWindow is not prepared, This method should be called in OnCreated().");
            }

            if (application == null)
            {
                throw new ArgumentException("application cannot be null.");
            }
            _application         = application;
            XApplication.Current = application;
            application.SendStart();

            var rootView = application.MainPage.CreateEvasObject(Window);

            OnRootViewUpdated(rootView);

            application.PropertyChanging += new XPropertyChangingEventHandler(AppOnPropertyChanging);
            application.PropertyChanged  += new PropertyChangedEventHandler(AppOnPropertyChanged);
        }
Exemplo n.º 12
0
        public static Form ShowXamarinControl(this ContentPage ctl, int Width, int Height)
        {
            var f = new Xamarin.Forms.Platform.WinForms.PlatformRenderer();

            Xamarin.Forms.Platform.WinForms.Forms.Init(f);

            f.Width  = Width;
            f.Height = Height;
            var app = new Xamarin.Forms.Application()
            {
                MainPage = ctl
            };

            f.LoadApplication(app);
            ThemeManager.ApplyThemeTo(f);
            if (ctl is IClose)
            {
                ((IClose)ctl).CloseAction = () => f.Close();
            }

            f.ShowDialog();

            return(f);
        }
Exemplo n.º 13
0
 protected DepthViewerViewPresenterBase(Application mvxFormsApp)
 {
     MvxFormsApp = mvxFormsApp;
 }
Exemplo n.º 14
0
 public IosCustomPresenter(IUIApplicationDelegate applicationDelegate, UIWindow window, Xamarin.Forms.Application formsApplication) : base(applicationDelegate, window, formsApplication)
 {
 }
        public NavigationService(Application application)
        {
            this.application = application;

            this.navigation = new Lazy<INavigation>(this.GetNavigation, LazyThreadSafetyMode.ExecutionAndPublication);
        }
Exemplo n.º 16
0
			public NavigationImpl(Application owner)
			{
				_owner = owner;
			}
Exemplo n.º 17
0
 public override void OnCreate(Bundle content, int w, int h)
 {
     base.OnCreate(content, w, h);
     XApplication.ClearCurrent();
 }
Exemplo n.º 18
0
 public DemoPresenter(Application app)
     : base(app)
 {
 }
Exemplo n.º 19
0
 public static bool IsOnLightTheme(this Xamarin.Forms.Application app)
 {
     return(!IsOnDarkTheme(app));
 }
Exemplo n.º 20
0
        private void SetColorResource(xf.Application app)
        {
            var foreground = ActualTheme == ElementTheme.Dark ? xf.Color.White : xf.Color.Black;

            ((PaletteCollection)app.Resources["DataGridForegroundPalette"])[0] = foreground;
        }
Exemplo n.º 21
0
 public AndroidPersistService()
 {
     _application = Application.Current;
 }
Exemplo n.º 22
0
 public Bootstrapper(Application application)
 {
     _application = application;           
 }
Exemplo n.º 23
0
	    private void GroupChangedCallback(Application application)
	    {
	        SetGroup(_app.CurrentGroup);

	    }
Exemplo n.º 24
0
 public BootStrap(Application app)
 {
     _application = app;
 }
 public MvxFormsWindows81PagePresenter(IMvxWindowsFrame rootFrame, Application mvxFormsApp)
     : base(mvxFormsApp)
 {
     _rootFrame = rootFrame;
 }
        public MessageBoxService(Application application)
        {
            this.application = application;

            this.mainPage = new Lazy<Page>(this.GetDisplayAllert, LazyThreadSafetyMode.ExecutionAndPublication);
        }
Exemplo n.º 27
0
 /// <summary>
 /// Runs the bootstrapper process.
 /// </summary>
 public void Run(Application app)
 {
     App = app;
     ConfigureViewModelLocator();
     Run();
 }
 public MvxFormsIosShellPagePresenter(UIWindow window, Xamarin.Forms.Application mvxFormsApp)
     : base(mvxFormsApp)
 {
     _window = window;
 }
 public MvxFormsPagePresenter(Application mvxFormsApp)
 {
     _mvxFormsApp = mvxFormsApp;
 }
 protected MvxFormsPagePresenter(Application mvxFormsApp)
 {
     MvxFormsApp = mvxFormsApp;
 }
 public MvxFormsWindowsPhonePagePresenter(PhoneApplicationFrame rootFrame, Application mvxFormsApp)
     : base(mvxFormsApp)
 {
     _rootFrame = rootFrame;
 }
Exemplo n.º 32
0
		internal static void ClearCurrent()
		{
			s_current = null;
		}
Exemplo n.º 33
0
 public AppSetup(Application application, ContainerBuilder cb)
 {
     _application = application;
     _cb = cb;
     FlowListView.Init();
 }
Exemplo n.º 34
0
		internal void SendResume()
		{
			s_current = this;
			OnResume();
		}
 public MvxFormsTouchPagePresenter(UIWindow window, Application mvxFormsApp)
     : base(mvxFormsApp)
 {
     _window = window;
 }
Exemplo n.º 36
0
 public static bool IsOnDarkTheme(this Xamarin.Forms.Application app)
 {
     return(app.RequestedTheme == OSAppTheme.Dark);
 }