예제 #1
0
        static BindingBuilderConstants()
        {
            var type = typeof(BindingBuilderConstants);

            RawSources         = DataConstant.Create <IList <object> >(type, nameof(RawSources), true);
            Source             = DataConstant.Create <object>(type, nameof(Source), true);
            BuildDelegate      = DataConstant.Create <Func <IDataContext, IDataBinding> >(type, nameof(BuildDelegate), true);
            Target             = DataConstant.Create <object>(type, nameof(Target), true);
            TargetSource       = DataConstant.Create <ISourceValue>(type, nameof(TargetSource), true);
            TargetPath         = DataConstant.Create <IBindingPath>(type, nameof(TargetPath), true);
            Sources            = DataConstant.Create <IList <Func <IDataContext, IObserver> > >(type, nameof(Sources), true);
            MultiExpression    = DataConstant.Create <Func <IDataContext, IList <object>, object> >(type, nameof(MultiExpression), true);
            Behaviors          = DataConstant.Create <List <IBindingBehavior> >(type, nameof(Behaviors), true);
            Converter          = DataConstant.Create <Func <IDataContext, IBindingValueConverter> >(type, nameof(Converter), true);
            ConverterParameter = DataConstant.Create <Func <IDataContext, object> >(type, nameof(ConverterParameter), true);
            ConverterCulture   = DataConstant.Create <Func <IDataContext, CultureInfo> >(type, nameof(ConverterCulture), true);
            CommandParameter   = DataConstant.Create <Func <IDataContext, object> >(type, nameof(CommandParameter), true);
            ToggleEnabledState = DataConstant.Create <bool>(type, nameof(ToggleEnabledState));
            Fallback           = DataConstant.Create <Func <IDataContext, object> >(type, nameof(Fallback), true);
            TargetNullValue    = DataConstant.Create <object>(type, nameof(TargetNullValue), false);
            HasStablePath      = DataConstant.Create <bool>(type, nameof(HasStablePath));
            Observable         = DataConstant.Create <bool>(type, nameof(Observable));
            Optional           = DataConstant.Create <bool>(type, nameof(Optional));
            NoCache            = DataConstant.Create(type, nameof(NoCache));
            DebugTag           = DataConstant.Create <string>(type, nameof(DebugTag), true);
        }
 static NavigationProvider()
 {
     NavigationArgsConstant       = DataConstant.Create(() => NavigationArgsConstant, true);
     NavigatingCancelArgsConstant = DataConstant.Create(() => NavigatingCancelArgsConstant, true);
     ViewModelType  = DataConstant.Create(() => ViewModelType, true);
     VmTypeConstant = DataConstant.Create(() => VmTypeConstant, true);
 }
예제 #3
0
        static AndroidToolkitExtensions()
        {
            IsApiGreaterThan10          = Build.VERSION.SdkInt > BuildVersionCodes.GingerbreadMr1;
            IsApiLessThanOrEqualTo10    = !IsApiGreaterThan10;
            IsApiGreaterThanOrEqualTo14 = Build.VERSION.SdkInt >= BuildVersionCodes.IceCreamSandwich;
            IsApiGreaterThanOrEqualTo17 = Build.VERSION.SdkInt >= BuildVersionCodes.JellyBeanMr1;
            IsApiGreaterThanOrEqualTo19 = Build.VERSION.SdkInt >= BuildVersionCodes.Kitkat;
            IsApiGreaterThanOrEqualTo21 = Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop;
            FragmentConstant            = DataConstant.Create <object>(typeof(AndroidToolkitExtensions), nameof(FragmentConstant), false);
            ContentViewManagerField     = new ContentViewManager();

            _setContentViewDelegete           = ContentViewManagerField.SetContent;
            _isFragment                       = o => false;
            _isActionBar                      = _isFragment;
            _activityRef                      = Empty.WeakReference;
            ViewToContextConstructor          = new ConcurrentDictionary <Type, Func <object[], object> >();
            ViewToContextWithAttrsConstructor = new ConcurrentDictionary <Type, Func <object[], object> >();
            ObjectToDefaultJavaConstructor    = new ConcurrentDictionary <Type, bool>();
            ViewContextArgs                   = new[] { typeof(Context) };
            ViewContextWithAttrsArgs          = new[] { typeof(Context), typeof(IAttributeSet) };
            DefaultJavaConstructorArgs        = new[] { typeof(IntPtr), typeof(JniHandleOwnership) };
            WeakReferencesHolder              = new List <object>(1000);
            CurrentActivityLocker             = new object();
            EnableFastTextViewTextProperty    = true;
            BackgroundNotificationDelay       = 200;

            // ReSharper disable once ObjectCreationAsStatement
            new WeakReferenceCollector();
        }
        static NavigationProvider()
        {
            var type = typeof(NavigationProvider);

            ViewModelTypeConstant = DataConstant.Create <Type>(type, nameof(ViewModelTypeConstant), true);
            IsNavigatedConstant   = DataConstant.Create <object>(type, nameof(IsNavigatedConstant), false);
        }
예제 #5
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="BindingProvider" /> class.
 /// </summary>
 static BindingProvider()
 {
     CreateInvalidaDataBindingDelegate = CreateInvalidaDataBinding;
     FormatMembersExpressionDelegate   = FormatMembersExpression;
     ProviderConstant  = DataConstant.Create(() => ProviderConstant, true);
     ExceptionConstant = DataConstant.Create(() => ExceptionConstant, true);
     BehaviorComparer  = new DelegateComparer <IBindingBehavior>((behavior, bindingBehavior) => bindingBehavior.Priority.CompareTo(behavior.Priority));
 }
예제 #6
0
 static BindingConstants()
 {
     DoNothing        = DataConstant.Create(() => DoNothing);
     UnsetValue       = DataConstant.Create(() => UnsetValue);
     InvalidValue     = DataConstant.Create(() => InvalidValue);
     Binding          = DataConstant.Create(() => Binding, true);
     CurrentEventArgs = DataConstant.Create(() => CurrentEventArgs, false);
 }
예제 #7
0
        static DynamicViewModelWindowPresenter()
        {
            var type = typeof(DynamicViewModelWindowPresenter);

            WindowViewMediatorConstant = DataConstant.Create <IWindowViewMediator>(type, nameof(WindowViewMediatorConstant), true);
            RestoredViewConstant       = DataConstant.Create <object>(type, nameof(RestoredViewConstant), true);
            IsOpenViewConstant         = DataConstant.Create <bool>(type, nameof(IsOpenViewConstant));
        }
예제 #8
0
        static WindowPresenterConstants()
        {
            var type = typeof(WindowPresenterConstants);

            WindowViewMediator = DataConstant.Create <IWindowViewMediator>(type, nameof(WindowViewMediator), true);
            RestoredView       = DataConstant.Create <object>(type, nameof(RestoredView), true);
            IsViewOpened       = DataConstant.Create <bool>(type, nameof(IsViewOpened));
        }
 static NavigationProvider()
 {
     NavigationArgsConstant       = DataConstant.Create(() => NavigationArgsConstant, true);
     NavigatingCancelArgsConstant = DataConstant.Create(() => NavigatingCancelArgsConstant, true);
     ViewModelTypeConstant        = DataConstant.Create(() => ViewModelTypeConstant, true);
     ClearNavigationCache         = DataConstant.Create(() => ClearNavigationCache);
     OperationIdConstant          = DataConstant.Create(() => OperationIdConstant, false);
 }
예제 #10
0
 static ViewModelProvider()
 {
     RestoredViewModels            = new Dictionary <Guid, RestoredViewModel>();
     ViewModelTypeNameConstant     = DataConstant.Create(() => ViewModelTypeNameConstant, true);
     IdViewModelConstant           = DataConstant.Create(() => IdViewModelConstant);
     IdParentViewModelConstant     = DataConstant.Create(() => IdParentViewModelConstant);
     Tracer.TraceViewModelHandler += OnTraceViewModel;
 }
예제 #11
0
 static BindingBuilderExtensions()
 {
     if (ServiceProvider.IsDesignMode)
     {
         BindingServiceProvider.InitializeFromDesignContext();
     }
     SyntaxBuilderConstant          = DataConstant.Create <object>(typeof(BindingBuilderExtensions), nameof(SyntaxBuilderConstant), true);
     DefaultBindingMemberDescriptor = new BindingMemberDescriptor <object, string>("DefaultBindingMember");
 }
예제 #12
0
 static NavigationConstants()
 {
     SuppressPageNavigation   = DataConstant.Create(() => SuppressPageNavigation);
     SuppressWindowNavigation = DataConstant.Create(() => SuppressWindowNavigation);
     SuppressTabNavigation    = DataConstant.Create(() => SuppressTabNavigation);
     ViewModel  = DataConstant.Create(() => ViewModel, true);
     ViewName   = DataConstant.Create(() => ViewName, false);
     Parameters = DataConstant.Create(() => Parameters, true);
     IsDialog   = DataConstant.Create(() => IsDialog);
 }
예제 #13
0
        static BindingProvider()
        {
            CreateInvalidaDataBindingDelegate = CreateInvalidaDataBinding;
            FormatMembersExpressionDelegate   = FormatMembersExpression;
            var type = typeof(BindingProvider);

            ProviderConstant  = DataConstant.Create <BindingProvider>(type, nameof(ProviderConstant), true);
            ExceptionConstant = DataConstant.Create <Exception>(type, nameof(ExceptionConstant), true);
            BehaviorComparer  = new DelegateComparer <IBindingBehavior>((behavior, bindingBehavior) => bindingBehavior.Priority.CompareTo(behavior.Priority));
        }
 /// <summary>
 ///     Initializes a new instance of the <see cref="XamarinFormsBootstrapperBase" /> class.
 /// </summary>
 static XamarinFormsBootstrapperBase()
 {
     WrapToNavigationPageConstant = DataConstant.Create(() => WrapToNavigationPageConstant);
     if (Device.OS != TargetPlatform.WinPhone)
     {
         LinkerInclude.Initialize();
     }
     DynamicMultiViewModelPresenter.CanShowViewModelDefault      = CanShowViewModelTabPresenter;
     DynamicViewModelNavigationPresenter.CanShowViewModelDefault = CanShowViewModelNavigationPresenter;
 }
예제 #15
0
 static ViewModelConstants()
 {
     View = DataConstant.Create(() => View, true);
     ViewModelTypeName = DataConstant.Create(() => ViewModelTypeName, true);
     ViewModelState    = DataConstant.Create(() => ViewModelState, true);
     StateManager      = DataConstant.Create(() => StateManager, true);
     ViewModel         = DataConstant.Create(() => ViewModel, true);
     ParentViewModel   = DataConstant.Create(() => ParentViewModel, true);
     StateNotNeeded    = DataConstant.Create(() => StateNotNeeded);
     StateRestored     = DataConstant.Create(() => StateRestored);
 }
        static NavigationProvider()
        {
            var type = typeof(NavigationProvider);

            ViewModelTypeConstant    = DataConstant.Create <Type>(type, nameof(ViewModelTypeConstant), true);
            IsNavigatedConstant      = DataConstant.Create <object>(type, nameof(IsNavigatedConstant), false);
            IgnoreNavigatingConstant = DataConstant.Create <object>(type, nameof(IgnoreNavigatingConstant), false);
            NavigatedTaskConstant    = DataConstant.Create <TaskCompletionSource <bool> >(type, nameof(NavigatedTaskConstant), false);
            CloseContextConstant     = DataConstant.Create <IDataContext>(type, nameof(CloseContextConstant), true);
            BringToFront             = DataConstant.Create <bool>(type, nameof(BringToFront));
        }
 static ViewFactoryConstants()
 {
     Bindings               = DataConstant.Create(() => Bindings, false);
     ItemTemplateId         = DataConstant.Create(() => ItemTemplateId);
     DropDownItemTemplateId = DataConstant.Create(() => DropDownItemTemplateId);
     ContentTemplateId      = DataConstant.Create(() => ContentTemplateId);
     MenuTemplateId         = DataConstant.Create(() => MenuTemplateId);
     PopupMenuTemplateId    = DataConstant.Create(() => PopupMenuTemplateId);
     PopupMenuEvent         = DataConstant.Create(() => PopupMenuEvent, true);
     PlacementTargetPath    = DataConstant.Create(() => PlacementTargetPath, true);
 }
예제 #18
0
 static NavigationConstants()
 {
     SuppressPageNavigation   = DataConstant.Create(() => SuppressPageNavigation);
     SuppressWindowNavigation = DataConstant.Create(() => SuppressWindowNavigation);
     SuppressTabNavigation    = DataConstant.Create(() => SuppressTabNavigation);
     ViewModel      = DataConstant.Create(() => ViewModel, true);
     ViewName       = DataConstant.Create(() => ViewName, false);
     IsDialog       = DataConstant.Create(() => IsDialog);
     ClearBackStack = DataConstant.Create(() => ClearBackStack);
     UseAnimations  = DataConstant.Create(() => UseAnimations);
 }
예제 #19
0
        static NavigationProviderConstants()
        {
            var type = typeof(NavigationProviderConstants);

            NavigationArgs       = DataConstant.Create <NavigationEventArgsBase>(type, nameof(NavigationArgs), true);
            NavigatingCancelArgs = DataConstant.Create <NavigatingCancelEventArgsBase>(type, nameof(NavigatingCancelArgs), true);
            OperationId          = DataConstant.Create <string>(type, nameof(OperationId), false);
            BringToFront         = DataConstant.Create <bool>(type, nameof(BringToFront));
            InvalidateCache      = DataConstant.Create <bool>(type, nameof(InvalidateCache));
            InvalidateAllCache   = DataConstant.Create <bool>(type, nameof(InvalidateAllCache));
        }
예제 #20
0
        static BindingConstants()
        {
            var type = typeof(BindingConstants);

            Source           = DataConstant.Create <WeakReference>(type, nameof(Source), true);
            DoNothing        = DataConstant.Create(type, nameof(DoNothing));
            UnsetValue       = DataConstant.Create(type, nameof(UnsetValue));
            InvalidValue     = DataConstant.Create(type, nameof(InvalidValue));
            Binding          = DataConstant.Create <IDataBinding>(type, nameof(Binding), true);
            CurrentEventArgs = DataConstant.Create <object>(type, nameof(CurrentEventArgs), false);
            ClearErrors      = DataConstant.Create <bool>(type, nameof(ClearErrors));
        }
예제 #21
0
 static InitializationConstants()
 {
     IocContainer         = DataConstant.Create(() => IocContainer, true);
     ParentViewModel      = DataConstant.Create(() => ParentViewModel, true);
     ObservationMode      = DataConstant.Create(() => ObservationMode);
     ViewModelBindingName = DataConstant.Create(() => ViewModelBindingName, false);
     IocParameters        = DataConstant.Create(() => IocParameters, true);
     IsRestored           = DataConstant.Create(() => IsRestored);
     ViewName             = NavigationConstants.ViewName;
     ViewModelType        = DataConstant.Create(() => ViewModelType, true);
     IgnoreViewModelCache = DataConstant.Create(() => IgnoreViewModelCache);
 }
예제 #22
0
        static NavigationConstants()
        {
            var type = typeof(NavigationConstants);

            SuppressPageNavigation   = DataConstant.Create <bool>(type, nameof(SuppressPageNavigation));
            SuppressWindowNavigation = DataConstant.Create <bool>(type, nameof(SuppressWindowNavigation));
            SuppressTabNavigation    = DataConstant.Create <bool>(type, nameof(SuppressTabNavigation));
            ViewModel      = DataConstant.Create <IViewModel>(type, nameof(ViewModel), true);
            ViewName       = DataConstant.Create <string>(type, nameof(ViewName), false);
            IsDialog       = DataConstant.Create <bool>(type, nameof(IsDialog));
            ClearBackStack = DataConstant.Create <bool>(type, nameof(ClearBackStack));
            UseAnimations  = DataConstant.Create <bool>(type, nameof(UseAnimations));
        }
예제 #23
0
        static ViewModelConstants()
        {
            var type = typeof(ViewModelConstants);

            Id                = DataConstant.Create <Guid>(type, nameof(Id));
            IdParent          = DataConstant.Create <Guid>(type, nameof(IdParent));
            View              = DataConstant.Create <object>(type, nameof(View), true);
            ViewModelTypeName = DataConstant.Create <string>(type, nameof(ViewModelTypeName), true);
            ViewModelState    = DataConstant.Create <IDataContext>(type, nameof(ViewModelState), true);
            ViewModel         = DataConstant.Create <IViewModel>(type, nameof(ViewModel), true);
            ParentViewModel   = DataConstant.Create <WeakReference>(type, nameof(ParentViewModel), true);
            StateNotNeeded    = DataConstant.Create <bool>(type, nameof(StateNotNeeded));
            StateRestored     = DataConstant.Create <bool>(type, nameof(StateRestored));
        }
예제 #24
0
        static InitializationConstants()
        {
            var type = typeof(InitializationConstants);

            IocContainer         = DataConstant.Create <IIocContainer>(type, nameof(IocContainer), true);
            ParentViewModel      = DataConstant.Create <IViewModel>(type, nameof(ParentViewModel), true);
            ObservationMode      = DataConstant.Create <ObservationMode>(type, nameof(ObservationMode));
            ViewModelBindingName = DataConstant.Create <string>(type, nameof(ViewModelBindingName), false);
            IocParameters        = DataConstant.Create <IIocParameter[]>(type, nameof(IocParameters), true);
            IsRestored           = DataConstant.Create <bool>(type, nameof(IsRestored));
            ViewName             = NavigationConstants.ViewName;
            ViewModelType        = DataConstant.Create <Type>(type, nameof(ViewModelType), true);
            IgnoreViewModelCache = DataConstant.Create <bool>(type, nameof(IgnoreViewModelCache));
        }
 static BindingBuilderConstants()
 {
     RawSources         = DataConstant.Create(() => RawSources, true);
     BuildDelegate      = DataConstant.Create(() => BuildDelegate, true);
     Target             = DataConstant.Create(() => Target, true);
     TargetPath         = DataConstant.Create(() => TargetPath, true);
     Sources            = DataConstant.Create(() => Sources, true);
     MultiExpression    = DataConstant.Create(() => MultiExpression, true);
     Behaviors          = DataConstant.Create(() => Behaviors, true);
     Converter          = DataConstant.Create(() => Converter, true);
     ConverterParameter = DataConstant.Create(() => ConverterParameter, true);
     ConverterCulture   = DataConstant.Create(() => ConverterCulture, true);
     CommandParameter   = DataConstant.Create(() => CommandParameter, true);
     ToggleEnabledState = DataConstant.Create(() => ToggleEnabledState);
     Fallback           = DataConstant.Create(() => Fallback, true);
     TargetNullValue    = DataConstant.Create(() => TargetNullValue, false);
 }
예제 #26
0
        static ViewModelConstants()
        {
            var type = typeof(ViewModelConstants);

            Id                         = DataConstant.Create <Guid>(type, nameof(Id));
            IdParent                   = DataConstant.Create <Guid>(type, nameof(IdParent));
            View                       = DataConstant.Create <object>(type, nameof(View), true);
            ViewModelTypeName          = DataConstant.Create <string>(type, nameof(ViewModelTypeName), true);
            ViewModelState             = DataConstant.Create <IDataContext>(type, nameof(ViewModelState), true);
            ParentViewModel            = DataConstant.Create <WeakReference>(type, nameof(ParentViewModel), true);
            WrapperViewModel           = DataConstant.Create <IViewModel>(type, nameof(WrapperViewModel), true);
            StateNotNeeded             = DataConstant.Create <bool>(type, nameof(StateNotNeeded));
            ClosingEvent               = DataConstant.Create <EventHandler <IViewModel, ViewModelClosingEventArgs> >(type, nameof(ClosingEvent), false);
            ClosedEvent                = DataConstant.Create <EventHandler <IViewModel, ViewModelClosedEventArgs> >(type, nameof(ClosedEvent), false);
            CanCloseHandler            = DataConstant.Create <Func <IViewModel, object, bool> >(type, nameof(CanCloseHandler), false);
            CloseHandler               = DataConstant.Create <Func <INavigationDispatcher, IViewModel, IDataContext, Task <bool> > >(type, nameof(CloseHandler), true);
            CurrentNavigationOperation = DataConstant.Create <IAsyncOperation>(type, nameof(CurrentNavigationOperation), true);
        }
예제 #27
0
        static PlatformExtensions()
        {
            IsApiGreaterThan10          = Build.VERSION.SdkInt > BuildVersionCodes.GingerbreadMr1;
            IsApiLessThanOrEqualTo10    = !IsApiGreaterThan10;
            IsApiGreaterThanOrEqualTo14 = Build.VERSION.SdkInt >= BuildVersionCodes.IceCreamSandwich;
            IsApiGreaterThanOrEqualTo17 = Build.VERSION.SdkInt >= BuildVersionCodes.JellyBeanMr1;
            IsApiGreaterThanOrEqualTo19 = Build.VERSION.SdkInt >= BuildVersionCodes.Kitkat;
            IsApiGreaterThanOrEqualTo21 = Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop;
            FragmentConstant            = DataConstant.Create <object>(typeof(PlatformExtensions), nameof(FragmentConstant), false);
            _menuInflaterFactory        = (context, dataContext) => new BindableMenuInflater(context);
            _layoutInflaterFactory      = (context, dataContext, factory, inflater) =>
            {
                if (inflater == null)
                {
                    Tracer.Error("The bindable inflater cannot be created without the original inflater");
                    return(null);
                }
                LayoutInflaterFactoryWrapper.SetFactory(inflater, factory);
                return(inflater);
            };
            ContentViewManagerField = new ContentViewManager();
            ContentViewManagerField.Add(new ViewContentViewManager());
            _mvvmActivityMediatorFactory = MvvmActivityMediatorFactoryMethod;
            _getContentViewDelegete      = GetContentViewInternal;
            _setContentViewDelegete      = ContentViewManagerField.SetContent;
            _isFragment                       = o => false;
            _isActionBar                      = _isFragment;
            _activityRef                      = Empty.WeakReference;
            ViewToContextConstructor          = new ConcurrentDictionary <Type, Func <object[], object> >();
            ViewToContextWithAttrsConstructor = new ConcurrentDictionary <Type, Func <object[], object> >();
            ObjectToDefaultJavaConstructor    = new ConcurrentDictionary <Type, bool>();
            ViewContextArgs                   = new[] { typeof(Context) };
            ViewContextWithAttrsArgs          = new[] { typeof(Context), typeof(IAttributeSet) };
            DefaultJavaConstructorArgs        = new[] { typeof(IntPtr), typeof(JniHandleOwnership) };
            WeakReferencesHolder              = new List <object>(1000);
            CurrentActivityLocker             = new object();
            _mvvmFragmentMediatorFactory      = MvvmFragmentMediatorFactoryMethod;
            EnableFastTextViewTextProperty    = true;

            // ReSharper disable once ObjectCreationAsStatement
            new WeakReferenceCollector();
        }
예제 #28
0
        static NavigationConstants()
        {
            var type = typeof(NavigationConstants);

            SuppressPageNavigation   = DataConstant.Create <bool>(type, nameof(SuppressPageNavigation));
            SuppressWindowNavigation = DataConstant.Create <bool>(type, nameof(SuppressWindowNavigation));
            SuppressTabNavigation    = DataConstant.Create <bool>(type, nameof(SuppressTabNavigation));
            ViewModel      = DataConstant.Create <IViewModel>(type, nameof(ViewModel), true);
            ViewName       = DataConstant.Create <string>(type, nameof(ViewName), false);
            IsDialog       = DataConstant.Create <bool>(type, nameof(IsDialog));
            ClearBackStack = DataConstant.Create <bool>(type, nameof(ClearBackStack));
            UseAnimations  = DataConstant.Create <bool>(type, nameof(UseAnimations));
            CloseParameter = DataConstant.Create <object>(type, nameof(CloseParameter), false);
            ImmediateClose = DataConstant.Create <bool>(type, nameof(ImmediateClose));
            SuppressNavigationCallbackOnClose = DataConstant.Create <bool>(type, nameof(SuppressNavigationCallbackOnClose));
            NavigationCompletedTask           = DataConstant.Create <Task <bool> >(type, nameof(NavigationCompletedTask), true);
            NavigationParameter     = DataConstant.Create <object>(type, nameof(NavigationParameter), true);
            IsFirstNavigation       = DataConstant.Create <object>(type, nameof(IsFirstNavigation), false);
            DoNotTrackViewModelFrom = DataConstant.Create <bool>(type, nameof(DoNotTrackViewModelFrom));
            DoNotTrackViewModelTo   = DataConstant.Create <bool>(type, nameof(DoNotTrackViewModelTo));
        }
 static PlatformExtensions()
 {
     IsApiGreaterThan10          = Build.VERSION.SdkInt > BuildVersionCodes.GingerbreadMr1;
     IsApiLessThanOrEqualTo10    = !IsApiGreaterThan10;
     IsApiGreaterThanOrEqualTo21 = Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop;
     IsApiGreaterThanOrEqualTo14 = Build.VERSION.SdkInt >= BuildVersionCodes.IceCreamSandwich;
     IsApiGreaterThanOrEqualTo17 = Build.VERSION.SdkInt >= BuildVersionCodes.JellyBeanMr1;
     FragmentConstant            = DataConstant.Create(() => FragmentConstant, false);
     _menuInflaterFactory        = (context, dataContext) => new BindableMenuInflater(context);
     _layoutInflaterFactory      = (context, dataContext, factory, inflater) =>
     {
         if (factory == null && !ServiceProvider.TryGet(out factory))
         {
             factory = new ViewFactory();
         }
         if (inflater == null)
         {
             return(new BindableLayoutInflater(factory, context));
         }
         return(new BindableLayoutInflater(factory, inflater, context));
     };
     ContentViewManagerField = new ContentViewManager();
     ContentViewManagerField.Add(new ViewContentViewManager());
     _mvvmActivityMediatorFactory = MvvmActivityMediatorFactoryMethod;
     _getContentViewDelegete      = GetContentViewInternal;
     _setContentViewDelegete      = ContentViewManagerField.SetContent;
     _isFragment                       = o => false;
     _isActionBar                      = _isFragment;
     _activityRef                      = Empty.WeakReference;
     WeakReferences                    = new ConcurrentDictionary <int, WeakReference>(2, Empty.Array <KeyValuePair <int, WeakReference> >(), EqualityComparer <int> .Default);
     ViewToContextConstructor          = new ConcurrentDictionary <Type, Func <object[], object> >();
     ViewToContextWithAttrsConstructor = new ConcurrentDictionary <Type, Func <object[], object> >();
     ViewContextArgs                   = new[] { typeof(Context) };
     ViewContextWithAttrsArgs          = new[] { typeof(Context), typeof(IAttributeSet) };
     CurrentActivityLocker             = new object();
     _mvvmFragmentMediatorFactory      = MvvmFragmentMediatorFactoryMethod;
     // ReSharper disable once ObjectCreationAsStatement
     new WeakReferenceCollector();
 }
예제 #30
0
 static DynamicViewModelWindowPresenter()
 {
     WindowViewMediatorConstant = DataConstant.Create(() => WindowViewMediatorConstant, true);
     RestoredViewConstant       = DataConstant.Create(() => RestoredViewConstant, true);
     IsOpenViewConstant         = DataConstant.Create(() => IsOpenViewConstant);
 }