Esempio n. 1
0
        public bool Load(IModuleContext context)
        {
            if (context.PlatformInfo.Platform == PlatformType.WinForms)
            {
                BindingServiceProvider.Initialize(errorProvider: new WinFormsBindingErrorProvider(), converter: BindingConverterExtensions.Convert);
            }

            context.TryRegisterDataTemplateSelectorsAndValueConverters(null);
            MugenMvvmToolkit.Binding.AttachedMembersRegistration.RegisterDefaultMembers();

            AttachedMembersRegistration.RegisterObjectMembers();
            AttachedMembersRegistration.RegisterButtonMembers();
            AttachedMembersRegistration.RegisterTextBoxMembers();
            AttachedMembersRegistration.RegisterLabelMembers();
            AttachedMembersRegistration.RegisterCheckBoxMembers();
            AttachedMembersRegistration.RegisterProgressBarMembers();
            AttachedMembersRegistration.RegisterFormMembers();
            AttachedMembersRegistration.RegisterControlMembers();
            AttachedMembersRegistration.RegisterDateTimePickerMembers();
            AttachedMembersRegistration.RegisterToolStripItemMembers();
            AttachedMembersRegistration.RegisterTabControlMembers();
            AttachedMembersRegistration.RegisterComboBoxMembers();
            AttachedMembersRegistration.RegisterDataGridViewMembers();
            return(true);
        }
        private void ActivityViewOnDestroyed(Activity sender)
        {
            ((IActivityView)sender).Mediator.Destroyed -= _listener.Handle;
            SetItemsSource(null, false);
            var adapterView = _container as AdapterView;

            if (adapterView.IsAlive() && ReferenceEquals(AttachedMembersRegistration.GetAdapter(adapterView), this))
            {
                AttachedMembersRegistration.SetAdapter(adapterView, null);
            }
        }
Esempio n. 3
0
        public bool Load(IModuleContext context)
        {
            if (context.PlatformInfo.Platform == PlatformType.Android)
            {
                BindingServiceProvider.Initialize(errorProvider: new AndroidBindingErrorProvider(), converter: BindingConverterExtensions.Convert);
                BindingServiceProvider.BindingProvider.DefaultBehaviors.Add(DisableEqualityCheckingBehavior.TargetTrueNotTwoWay);
                BindingResourceExtensions.Initialize();
            }

            AndroidToolkitExtensions.ItemsSourceAdapterFactory = (o, ctx, arg3) => new ItemsSourceAdapter(o, ctx, !ReferenceEquals(ViewGroupItemsSourceGenerator.Context, arg3));
            context.TryRegisterDataTemplateSelectorsAndValueConverters(null);
            MugenMvvmToolkit.Binding.AttachedMembersRegistration.RegisterDefaultMembers();

            if (AndroidToolkitExtensions.IsApiGreaterThanOrEqualTo14)
            {
                var isActionBar = AndroidToolkitExtensions.IsActionBar;
                var isFragment  = AndroidToolkitExtensions.IsFragment;
                AndroidToolkitExtensions.IsActionBar = o => isActionBar(o) || o is ActionBar;
                AndroidToolkitExtensions.IsFragment  = o => isFragment(o) || o is Fragment;

                AttachedMembersRegistration.RegisterActionBarBaseMembers();
                AttachedMembersRegistration.RegisterActionBarMembers();
                AttachedMembersRegistration.RegisterActionBarTabMembers();
            }

            AttachedMembersRegistration.RegisterObjectMembers();
            AttachedMembersRegistration.RegisterViewBaseMembers();
            AttachedMembersRegistration.RegisterViewMembers();
            AttachedMembersRegistration.RegisterDialogMembers();
            AttachedMembersRegistration.RegisterActivityMembers();
            AttachedMembersRegistration.RegisterRatingBarMembers();
            AttachedMembersRegistration.RegisterAdapterViewBaseMembers();
            AttachedMembersRegistration.RegisterAdapterViewMembers();
            AttachedMembersRegistration.RegisterViewGroupMembers();
            AttachedMembersRegistration.RegisterTabHostMembers();
            AttachedMembersRegistration.RegisterTextViewMembers();
            AttachedMembersRegistration.RegisterAutoCompleteTextViewMembers();
            AttachedMembersRegistration.RegisterDatePickerMembers();
            AttachedMembersRegistration.RegisterTimePickerMembers();
            AttachedMembersRegistration.RegisterImageViewMembers();
            AttachedMembersRegistration.RegisterToolbarMembers();
            AttachedMembersRegistration.RegisterButtonMembers();
            AttachedMembersRegistration.RegisterCompoundButtonMembers();
            AttachedMembersRegistration.RegisterSeekBarMembers();
            AttachedMembersRegistration.RegisterMenuMembers();
            AttachedMembersRegistration.RegisterMenuItemBaseMembers();
            AttachedMembersRegistration.RegisterMenuItemMembers();
            AttachedMembersRegistration.RegisterPopupMenuMembers();
            AttachedMembersRegistration.RegisterMenuItemActionViewMembers();
            AttachedMembersRegistration.RegisterMenuItemActionProviderMembers();
            AttachedMembersRegistration.RegisterSearchViewMembers();
            return(true);
        }
Esempio n. 4
0
        public bool Load(IModuleContext context)
        {
            TouchToolkitExtensions.TableViewSourceFactory      = (o, ctx) => new ItemsSourceTableViewSource(o);
            TouchToolkitExtensions.CollectionViewSourceFactory = (o, ctx) => new ItemsSourceCollectionViewSource(o);

            if (context.PlatformInfo.Platform == PlatformType.iOS)
            {
                BindingServiceProvider.Initialize(errorProvider: new TouchBindingErrorProvider(), converter: BindingConverterExtensions.Convert);
            }

            context.TryRegisterDataTemplateSelectorsAndValueConverters(null);
            MugenMvvmToolkit.Binding.AttachedMembersRegistration.RegisterDefaultMembers();

            var converter = new BooleanToCheckmarkAccessoryConverter();

            BindingServiceProvider.ResourceResolver.AddConverter("BooleanToCheckmark", converter);
            BindingServiceProvider.ResourceResolver.AddConverter("BoolToCheckmark", converter);
            BindingServiceProvider.BindingProvider.DefaultBehaviors.Add(DisableEqualityCheckingBehavior.TargetTrueNotTwoWay);

            AttachedMembersRegistration.RegisterObjectMembers();
            AttachedMembersRegistration.RegisterViewMembers();
            AttachedMembersRegistration.RegisterSegmentedControlMembers();
            AttachedMembersRegistration.RegisterButtonMembers();
            AttachedMembersRegistration.RegisterDatePickerMembers();
            AttachedMembersRegistration.RegisterSwitchMembers();
            AttachedMembersRegistration.RegisterControlMembers();
            AttachedMembersRegistration.RegisterTextFieldMembers();
            AttachedMembersRegistration.RegisterTextViewMembers();
            AttachedMembersRegistration.RegisterLabelMembers();
            AttachedMembersRegistration.RegisterBaseViewControllerMembers();
            AttachedMembersRegistration.RegisterViewControllerMembers();
            AttachedMembersRegistration.RegisterTabBarControllerMembers();
            AttachedMembersRegistration.RegisterSplitViewControllerMembers();
            AttachedMembersRegistration.RegisterToolbarMembers();
            AttachedMembersRegistration.RegisterPickerViewMembers();
            AttachedMembersRegistration.RegisterBarButtonItemMembers();
            AttachedMembersRegistration.RegisterSearchBarMembers();
            AttachedMembersRegistration.RegisterSliderMembers();
            AttachedMembersRegistration.RegisterProgressViewMembers();
            AttachedMembersRegistration.RegisterCollectionViewMembers();
            AttachedMembersRegistration.RegisterCollectionViewCellMembers();
            AttachedMembersRegistration.RegisterDialogElementMembers();
            AttachedMembersRegistration.RegisterDialogEntryElementMembers();
            AttachedMembersRegistration.RegisterStringElementMembers();
            AttachedMembersRegistration.RegisterTableViewMembers();
            AttachedMembersRegistration.RegisterTableViewCellMembers();

            return(true);
        }
Esempio n. 5
0
        public bool Load(IModuleContext context)
        {
            AttachedMembersRegistration.RegisterNavigationViewMembers();
            AttachedMembersRegistration.RegisterTabLayoutMembers();
            AttachedMembersRegistration.RegisterTabLayoutTabMembers();
            AttachedMembersRegistration.RegisterTextInputLayoutMembers();
            AttachedMembersRegistration.RegisterSnakbarMembers();
            AttachedMembersRegistration.RegisterBottomNavigationViewMembers();

            IToastPresenter toastPresenter;

            context.IocContainer.TryGet(out toastPresenter);
            context.IocContainer.Unbind <IToastPresenter>();
            context.IocContainer.BindToConstant <IToastPresenter>(new SnackbarToastPresenter(context.IocContainer.Get <IThreadManager>(), toastPresenter));

            return(true);
        }
Esempio n. 6
0
        public bool Load(IModuleContext context)
        {
            BindingServiceProvider.Initialize(contextManager: new XamarinFormsBindingContextManager(), resourceResolver: new XamarinFormsBindingResourceResolver(),
                                              errorProvider: new XamarinFormsBindingErrorProvider(), converter: XamarinFormsDataBindingExtensions.Convert);
            context.TryRegisterDataTemplateSelectorsAndValueConverters(RegisterType);
            MugenMvvmToolkit.Binding.AttachedMembersRegistration.RegisterDefaultMembers();

            AttachedMembersRegistration.RegisterElementMembers();
            AttachedMembersRegistration.RegisterVisualElementMembers();
            AttachedMembersRegistration.RegisterToolbarItemMembers();
            AttachedMembersRegistration.RegisterEntryMembers();
            AttachedMembersRegistration.RegisterLabelMembers();
            AttachedMembersRegistration.RegisterButtonMembers();
            AttachedMembersRegistration.RegisterListViewMembers();
            AttachedMembersRegistration.RegisterProgressBarMembers();

            ServiceProvider.Initialized += OnAppInitialized;
            return(true);
        }
Esempio n. 7
0
        public bool Load(IModuleContext context)
        {
            BindingResourceExtensions.ColorHandler    = ContextCompat.GetColor;
            BindingResourceExtensions.DrawableHandler = ContextCompat.GetDrawable;
            var isActionBar = AndroidToolkitExtensions.IsActionBar;
            var isFragment  = AndroidToolkitExtensions.IsFragment;

            AndroidToolkitExtensions.IsActionBar = o => isActionBar(o) || o is ActionBar;
            AndroidToolkitExtensions.IsFragment  = o => isFragment(o) || o is Fragment;

            AttachedMembersRegistration.RegisterToolbarMembers();
            AttachedMembersRegistration.RegisterDrawerLayoutMembers();
            AttachedMembersRegistration.RegisterViewPagerMembers();
            AttachedMembersRegistration.RegisterPopupMenuMembers();
            AttachedMembersRegistration.RegisterMenuItemMembers();
            AttachedMembersRegistration.RegisterMenuItemActionViewMembers();
            AttachedMembersRegistration.RegisterMenuItemActionProviderMembers();
            AttachedMembersRegistration.RegisterSearchViewMembers();
            AttachedMembersRegistration.RegisterActionBarBaseMembers();
            AttachedMembersRegistration.RegisterActionBarMembers();
            AttachedMembersRegistration.RegisterActionBarTabMembers();

            return(true);
        }
Esempio n. 8
0
 public bool Load(IModuleContext context)
 {
     AttachedMembersRegistration.RegisterRecyclerViewMembers();
     return true;
 }