예제 #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
        }
예제 #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);
        }
예제 #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));
        }
예제 #10
0
파일: App.cs 프로젝트: rsaggio/app-crm
        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();
            }

        }
예제 #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);
        }
예제 #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);
        }
 protected DepthViewerViewPresenterBase(Application mvxFormsApp)
 {
     MvxFormsApp = mvxFormsApp;
 }
예제 #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);
        }
예제 #16
0
			public NavigationImpl(Application owner)
			{
				_owner = owner;
			}
예제 #17
0
 public override void OnCreate(Bundle content, int w, int h)
 {
     base.OnCreate(content, w, h);
     XApplication.ClearCurrent();
 }
예제 #18
0
 public DemoPresenter(Application app)
     : base(app)
 {
 }
예제 #19
0
 public static bool IsOnLightTheme(this Xamarin.Forms.Application app)
 {
     return(!IsOnDarkTheme(app));
 }
예제 #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;
        }
예제 #21
0
 public AndroidPersistService()
 {
     _application = Application.Current;
 }
예제 #22
0
 public Bootstrapper(Application application)
 {
     _application = application;           
 }
예제 #23
0
	    private void GroupChangedCallback(Application application)
	    {
	        SetGroup(_app.CurrentGroup);

	    }
예제 #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);
        }
예제 #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;
 }
예제 #32
0
		internal static void ClearCurrent()
		{
			s_current = null;
		}
예제 #33
0
 public AppSetup(Application application, ContainerBuilder cb)
 {
     _application = application;
     _cb = cb;
     FlowListView.Init();
 }
예제 #34
0
		internal void SendResume()
		{
			s_current = this;
			OnResume();
		}
 public MvxFormsTouchPagePresenter(UIWindow window, Application mvxFormsApp)
     : base(mvxFormsApp)
 {
     _window = window;
 }
예제 #36
0
 public static bool IsOnDarkTheme(this Xamarin.Forms.Application app)
 {
     return(app.RequestedTheme == OSAppTheme.Dark);
 }