protected XamarinFormsBootstrapperBase(IPlatformService platformService, bool isDesignMode = false) : this(isDesignMode, platformService?.GetPlatformInfo()) { Should.NotBeNull(platformService, nameof(platformService)); _platformService = platformService; WrapToNavigationPage = true; }
protected XamarinFormsBootstrapperBase(IPlatformService platformService) { Should.NotBeNull(platformService, nameof(platformService)); _platformService = platformService; _platform = platformService.GetPlatformInfo(); BindingServiceProvider.ValueConverter = platformService.ValueConverter; }
private static PlatformInfo GetPlatformInfo() { Assembly assembly = TryLoadAssembly(BindingAssemblyName, null); if (assembly == null) { if (Device.OS == TargetPlatform.WinPhone) { assembly = TryLoadAssembly(WinRTAssemblyName, null); } if (assembly == null) { return(XamarinFormsExtensions.GetPlatformInfo()); } } TypeInfo serviceType = typeof(IPlatformService).GetTypeInfo(); serviceType = assembly.DefinedTypes.FirstOrDefault(serviceType.IsAssignableFrom); if (serviceType != null) { _platformService = (IPlatformService)Activator.CreateInstance(serviceType.AsType()); BindingServiceProvider.ValueConverter = _platformService.ValueConverter; } return(_platformService == null ? XamarinFormsExtensions.GetPlatformInfo() : _platformService.GetPlatformInfo()); }
/// <summary> /// Initializes a new instance of the <see cref="XamarinFormsBootstrapperBase" /> class. /// </summary> protected XamarinFormsBootstrapperBase() { var assembly = TryLoadAssembly(BindingAssemblyName, null); if (assembly != null) { var serviceType = typeof(IPlatformService).GetTypeInfo(); serviceType = assembly.DefinedTypes.FirstOrDefault(serviceType.IsAssignableFrom); if (serviceType != null) { _platformService = (IPlatformService)Activator.CreateInstance(serviceType.AsType()); } } _platform = _platformService == null ? XamarinFormsExtensions.GetPlatformInfo() : _platformService.GetPlatformInfo(); }
protected XamarinFormsBootstrapperBase(IPlatformService platformService, bool isDesignMode = false) : this(isDesignMode, platformService?.GetPlatformInfo()) { _platformService = platformService; WrapToNavigationPage = true; }