Beispiel #1
0
 public override void LoadPlugins(Cirrious.CrossCore.Plugins.IMvxPluginManager pluginManager)
 {
     pluginManager.EnsurePluginLoaded<PluginLoader>();
     pluginManager.EnsurePluginLoaded<Cirrious.MvvmCross.Plugins.Visibility.PluginLoader>();
     pluginManager.EnsurePluginLoaded<Cirrious.MvvmCross.Plugins.File.PluginLoader> ();
     base.LoadPlugins(pluginManager);
 }
Beispiel #2
0
		protected override void FillValueConverters(Cirrious.MvvmCross.Binding.Interfaces.Binders.IMvxValueConverterRegistry registry)
        {
            base.FillValueConverters(registry);

            var filler = new MvxInstanceBasedValueConverterRegistryFiller(registry);
            filler.AddFieldConverters(typeof(Converters));
        }
 protected override void FillBindingNames(Cirrious.MvvmCross.Binding.BindingContext.IMvxBindingNameRegistry registry)
 {
     // use these to register default binding names
     //registry.AddOrOverwrite<NicerBinaryEdit>(be => be.MyCount);
     //registry.AddOrOverwrite(typeof(BinaryEdit),"N28Doofus");
     base.FillBindingNames(registry);
 }
 protected override void FillTargetFactories(Cirrious.MvvmCross.Binding.Bindings.Target.Construction.IMvxTargetBindingFactoryRegistry registry)
 {
     registry.RegisterCustomBindingFactory<BinaryEdit>(
                     "N28Doofus",
                     binary => new BinaryEditFooTargetBinding(binary));
     base.FillTargetFactories(registry);
 }
        public override void Show(Cirrious.MvvmCross.Touch.Views.IMvxTouchView view)
        {
            
            // When initializing views for the first time, we will setup 
            if (view is LoginViewController)
            {              
                _loginViewController = (LoginViewController) view;
                base.Show(view);             
            }
              
            else if (view is MainViewController)
            {                
                _mainViewController = (MainViewController) view;
                base.Show(view);
            }
            else
            {
                if (PresentView(view) == false)
                {
                    // No views can handle presenting this view...just push it on the navigation stack as last resort.
                    base.Show(view);
                }
            }
            _viewPresenters.Add(view);

            var viewPresenter = view as IViewPresenter;
            if (viewPresenter != null)
            {
                viewPresenter.ViewPresenterAdded();
            }
        }
Beispiel #6
0
 protected override void AddPluginsLoaders(Cirrious.MvvmCross.Platform.MvxLoaderPluginRegistry loaders)
 {
     loaders.AddConventionalPlugin<Cirrious.MvvmCross.Plugins.Location.WinRT.Plugin>();
     loaders.AddConventionalPlugin<Cirrious.MvvmCross.Plugins.ThreadUtils.WinRT.Plugin>();
     loaders.AddConventionalPlugin<Cirrious.MvvmCross.Plugins.Visibility.WinRT.Plugin>();
     base.AddPluginsLoaders(loaders);
 }
Beispiel #7
0
        protected override void AddPluginsLoaders(Cirrious.MvvmCross.Platform.MvxLoaderPluginRegistry loaders)
        {
            loaders.AddConventionalPlugin<Cirrious.MvvmCross.Plugins.ResourceLoader.WindowsPhone.Plugin>();
            loaders.AddConventionalPlugin<Cirrious.MvvmCross.Plugins.File.WindowsPhone.Plugin>();

            base.AddPluginsLoaders(loaders);
        }
Beispiel #8
0
        protected override void AddPluginsLoaders(Cirrious.MvvmCross.Platform.MvxLoaderPluginRegistry loaders)
        {
            loaders.AddConventionalPlugin<Cirrious.MvvmCross.Plugins.DownloadCache.Touch.Plugin>();
            loaders.AddConventionalPlugin<Cirrious.MvvmCross.Plugins.File.Touch.Plugin>();
            loaders.AddConventionalPlugin<Cirrious.MvvmCross.Plugins.WebBrowser.Touch.Plugin>();

            base.AddPluginsLoaders (loaders);
        }
		public MvxBindableGridView (Context context, IAttributeSet attrs, Cirrious.MvvmCross.Binding.Android.Views.MvxBindableListAdapter adapter)
            : base(context, attrs)
		{
			var itemTemplateId = Cirrious.MvvmCross.Binding.Android.Views.MvxBindableListViewHelpers.ReadTemplatePath (context, attrs);
			adapter.ItemTemplateId = itemTemplateId;
			Adapter = adapter;
			SetupItemClickListener ();
		}
		public override void ChangePresentation (Cirrious.MvvmCross.ViewModels.MvxPresentationHint hint)
		{
			if (hint is MvxClosePresentationHint && 
                _window.RootViewController.ModalViewController is NewAppointmentView)
                this.CloseModalViewController();

			base.ChangePresentation (hint);
		}
Beispiel #11
0
        protected override void FillValueConverters(Cirrious.CrossCore.Converters.IMvxValueConverterRegistry registry)
        {
            base.FillValueConverters(registry);

            registry.AddOrOverwrite("SessionDetails", new SessionDetailsConverter());
            registry.AddOrOverwrite("MultiLine", new MultiLineTextValueConverter());
            registry.AddOrOverwrite("StringFormat", new StringFormatValueConverter());
            registry.AddOrOverwrite("Time", new TimeValueConverter());
        }
 protected override void FillTargetFactories(
     Cirrious.MvvmCross.Binding.Interfaces.Bindings.Target.Construction.IMvxTargetBindingFactoryRegistry registry)
 {
     registry.RegisterFactory(new MvxPropertyInfoTargetBindingFactory(typeof (ValueElement), "Value",
                                                                      (element, propertyInfo) =>
                                                                      new MvxElementValueTargetBinding(element,
                                                                                                       propertyInfo)));
     base.FillTargetFactories(registry);
 }
        public override void Show(Cirrious.MvvmCross.ViewModels.MvxViewModelRequest request)
        {
            var viewController = (UIViewController)Mvx.Resolve<IMvxTouchViewCreator>().CreateView(request);

            if (request.ViewModelType == typeof(FirstViewModel))
                _svc.SetLeft(viewController);
            else
                _svc.SetRight(viewController);
        }
Beispiel #14
0
        public override bool ShowView(Cirrious.MvvmCross.Touch.Interfaces.IMvxTouchView view)
        {
            if (view != TabBarPresenter)
            {
                if (TabBarPresenter.ShowView(view))
                    return true;
            }

            return base.ShowView(view);
        }
Beispiel #15
0
 public override void Show(Cirrious.MvvmCross.ViewModels.MvxViewModelRequest request)
 {
     if (_host != null)
     {
         var viewFinder = Mvx.Resolve<IMvxViewsContainer>();
         var viewType = viewFinder.GetViewType(request.ViewModelType);
         if (viewType == null) throw new MvxException("Could not find view type for " + request.ViewModelType);
         var view = Activator.CreateInstance(viewType);
         if (view == null) throw new MvxException("Could not load view for " + viewType);
         return;
     }
     base.Show(request);
 }
		public override void Show (Cirrious.MvvmCross.ViewModels.MvxViewModelRequest request)
		{
			if (request.ViewModelType == typeof(NewAppointmentViewModel))
            {
                var viewController = Mvx.Resolve<IMvxTouchViewCreator>()
                    .CreateView(request) as UIViewController;

                PresentModalViewController(viewController, true);

                return;
            }

			base.Show (request);
		}
Beispiel #17
0
        protected override void AddPluginsLoaders(Cirrious.MvvmCross.Platform.MvxLoaderPluginRegistry registry)
        {
            registry.AddConventionalPlugin<Cirrious.MvvmCross.Plugins.Accelerometer.WinRT.Plugin>();
            registry.AddConventionalPlugin<Cirrious.MvvmCross.Plugins.Color.WinRT.Plugin>();
            registry.AddConventionalPlugin<Cirrious.MvvmCross.Plugins.File.WinRT.Plugin>();
            registry.AddConventionalPlugin<Cirrious.MvvmCross.Plugins.ResourceLoader.WinRT.Plugin>();
            registry.AddConventionalPlugin<Cirrious.MvvmCross.Plugins.Settings.WinRT.Plugin>();
            registry.AddConventionalPlugin<Cirrious.MvvmCross.Plugins.Share.WinRT.Plugin>();
            registry.AddConventionalPlugin<Cirrious.MvvmCross.Plugins.Speech.WinRT.Plugin>();
            registry.AddConventionalPlugin<Cirrious.MvvmCross.Plugins.Sphero.WinRT.Plugin>();
            registry.AddConventionalPlugin<Cirrious.MvvmCross.Plugins.Visibility.WinRT.Plugin>();
            registry.AddConventionalPlugin<Cirrious.MvvmCross.Plugins.WebBrowser.WinRT.Plugin>();
            registry.AddConventionalPlugin<Cirrious.MvvmCross.Plugins.XamPhotos.WinRT.Plugin>();


            base.AddPluginsLoaders(registry);
        }
Beispiel #18
0
        public override void Show(Cirrious.MvvmCross.Touch.Views.IMvxTouchView view)
        {
            if (view is HomeView)
            {
                _homeView = view as HomeView;
            }

            //			if (view is GrandChildView)
            //			{
            //				if (_firstView != null)
            //				{
            //					_firstView.ShowGrandChild(view);
            //				}
            //				return;
            //			}

            base.Show(view);
        }
        public override void Show(Cirrious.MvvmCross.Touch.Views.IMvxTouchView view)
        {
            if (view is FirstView)
            {
                _firstView = view as FirstView;
            }

            if (view is GrandChildView)
            {
                if (_firstView != null)
                {
                    _firstView.ShowGrandChild(view);
                }
                return;
            }

            base.Show(view);
        }
        public override void Show(Cirrious.MvvmCross.Touch.Views.IMvxTouchView view)
        {
            if (MasterNavigationController == null)
            {
                base.Show(view);
                return;
            }

            if (MasterNavigationController.ViewControllers.Length <= 1)
            {
                base.Show(view);
                return;
            }

            MasterNavigationController.PopViewController(false);
            MasterNavigationController.PushViewController(
                view as UIViewController,
                true);
        }
        public override void Show(Cirrious.MvvmCross.ViewModels.MvxViewModelRequest request)
        {
            var activity = Activity;
            if (activity == null)
            {
                MvxTrace.Warning("Cannot Resolve current top activity");
                return;
            }
            var requestTranslator = Mvx.Resolve<IMvxAndroidViewModelRequestTranslator>();
            var intent = requestTranslator.GetIntentFor(request);

            // Android, Y U NO CLEAR STACK?
            if (request.PresentationValues != null &&
                request.PresentationValues.ContainsKey(PresentationBundleFlagKeys.ClearStack))
            {
                intent.AddFlags(ActivityFlags.ClearTop | ActivityFlags.NewTask);
            }

            activity.StartActivity(intent);
        }
		public void Include(Cirrious.CrossCore.IoC.MvxPropertyInjector injector)
		{
			injector = new Cirrious.CrossCore.IoC.MvxPropertyInjector ();
		} 
 protected override void FillBindingNames(Cirrious.MvvmCross.Binding.BindingContext.IMvxBindingNameRegistry obj)
 {
     //obj.AddOrOverwrite(typeof(FourthView.RegionManager), "Center");
     base.FillBindingNames(obj);
 }
Beispiel #24
0
		public override void LoadPlugins (Cirrious.CrossCore.Plugins.IMvxPluginManager pluginManager)
		{
			pluginManager.EnsurePluginLoaded<Cirrious.MvvmCross.Plugins.Messenger.PluginLoader>();
			base.LoadPlugins (pluginManager);
		}
 public override void Show(Cirrious.MvvmCross.ViewModels.MvxViewModelRequest request)
 {
     FragmentHostHelper.Show (request, this);
 }
Beispiel #26
0
        protected override async void NewIntent(Cirrious.CrossCore.Core.MvxValueEventArgs<Intent> e)
        {
            WriteResult writeResult = new WriteResult();
            writeResult.ReasonForFailure = FailureReasons.Unkown;


            var id = GetIdFromTag(e.Value);
            var intent = e.Value;
            Tag tag = (Tag) intent.GetParcelableExtra(NfcAdapter.ExtraTag);

            Ndef ndef = Ndef.Get(tag);
            if (ndef != null)
            {
                ndef.Connect();
                if (!ndef.IsWritable)
                {
                    writeResult.ReasonForFailure = FailureReasons.TagReadOnly;
                    _taskCompletionSource.TrySetResult(writeResult);
                    return;
                }
                byte[] message = _messageToWrite.ToByteArray();
                if (ndef.MaxSize < message.Length)
                {
                    writeResult.ReasonForFailure = FailureReasons.TagTooSmall;
                    _taskCompletionSource.TrySetResult(writeResult);
                    return;
                }

                try
                {
                    await ndef.WriteNdefMessageAsync(new Android.Nfc.NdefMessage(message));
                    writeResult.ReasonForFailure = FailureReasons.DidNotFail;
                    writeResult.NFCTag = new NFCTag()
                    {
                        Id = id
                    };
                    _taskCompletionSource.TrySetResult(writeResult);
                    return;
                }
                catch (TagLostException tagLost)
                {
                    writeResult.ReasonForFailure = FailureReasons.TagLostDuringWrite;
                    _taskCompletionSource.TrySetResult(writeResult);
                    return;
                }
                catch (Exception err)
                {
                    Mvx.Error("Error writing Tag: " + err.ToString());
                    writeResult.ReasonForFailure = FailureReasons.ErrorDuringWrite;
                    _taskCompletionSource.TrySetResult(writeResult);
                    return;
                }
            }
            else
            {
                writeResult.ReasonForFailure = FailureReasons.UnableToFormatTag;
                _taskCompletionSource.TrySetResult(writeResult);
                return;
            }


        }
Beispiel #27
0
        protected override void FillValueConverters(Cirrious.MvvmCross.Binding.Interfaces.Binders.IMvxValueConverterRegistry registry)
        {
            base.FillValueConverters (registry);

            registry.AddOrOverwrite("CollectionEmptyConverter", new CollectionEmptyConverter());
        }
Beispiel #28
0
        protected override void FillTargetFactories(Cirrious.MvvmCross.Binding.Interfaces.Bindings.Target.Construction.IMvxTargetBindingFactoryRegistry registry)
        {
            base.FillTargetFactories(registry);

            registry.RegisterFactory(new MvxCustomBindingFactory<UIButton>("IsFavorite", button => new FavoriteButtonBinding(button)));
        }
 protected override void AddPluginsLoaders(Cirrious.CrossCore.Plugins.MvxLoaderPluginRegistry loaders)
 {
     loaders.AddConventionalPlugin<Plugins.UserInteraction.Touch.Plugin>();
     base.AddPluginsLoaders(loaders);
 }
Beispiel #30
0
		protected override void FillTargetFactories(Cirrious.MvvmCross.Binding.Bindings.Target.Construction.IMvxTargetBindingFactoryRegistry registry)
		{
			base.FillTargetFactories(registry);
			registry.RegisterFactory(new Cirrious.MvvmCross.Binding.Bindings.Target.Construction.MvxCustomBindingFactory<UISegmentedControl>("ValueChanged", x => new UISegmentControlBinding(x)));
		}