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 }
/// <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); }
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)); }
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(); } }
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); }
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; }
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); }
public NavigationImpl(Application owner) { _owner = owner; }
public override void OnCreate(Bundle content, int w, int h) { base.OnCreate(content, w, h); XApplication.ClearCurrent(); }
public DemoPresenter(Application app) : base(app) { }
public static bool IsOnLightTheme(this Xamarin.Forms.Application app) { return(!IsOnDarkTheme(app)); }
private void SetColorResource(xf.Application app) { var foreground = ActualTheme == ElementTheme.Dark ? xf.Color.White : xf.Color.Black; ((PaletteCollection)app.Resources["DataGridForegroundPalette"])[0] = foreground; }
public AndroidPersistService() { _application = Application.Current; }
public Bootstrapper(Application application) { _application = application; }
private void GroupChangedCallback(Application application) { SetGroup(_app.CurrentGroup); }
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); }
/// <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; }
internal static void ClearCurrent() { s_current = null; }
public AppSetup(Application application, ContainerBuilder cb) { _application = application; _cb = cb; FlowListView.Init(); }
internal void SendResume() { s_current = this; OnResume(); }
public MvxFormsTouchPagePresenter(UIWindow window, Application mvxFormsApp) : base(mvxFormsApp) { _window = window; }
public static bool IsOnDarkTheme(this Xamarin.Forms.Application app) { return(app.RequestedTheme == OSAppTheme.Dark); }