Exemplo 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);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
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);
        }