public MvxBindingViewControllerAdapter(IMvxEventSourceViewController eventSource)
            : base(eventSource)
        {
            if (!(eventSource is IMvxMacView))
                throw new ArgumentException("eventSource", "eventSource should be a IMvxMacView");

            this.MacView.BindingContext = new MvxBindingContext();
        }
Exemplo n.º 2
0
 public MvxViewControllerAdapter(IMvxEventSourceViewController eventSource)
     : base(eventSource)
 {
     if (!(eventSource is IMvxMacView))
     {
         throw new ArgumentException("eventSource", "eventSource should be a IMvxMacView");
     }
 }
        public MvxBindingViewControllerAdapter(IMvxEventSourceViewController eventSource)
            : base(eventSource)
        {
            if (!(eventSource is IMvxTvosView))
                throw new ArgumentException("eventSource", "eventSource should be a IMvxTvosView");

            this.TvosView.BindingContext = Mvx.Resolve<IMvxBindingContext>();
        }
        public MvxBindingViewControllerAdapter(IMvxEventSourceViewController eventSource)
            : base(eventSource)
        {
            if (!(eventSource is IMvxTouchView))
            {
                throw new ArgumentException("eventSource", "eventSource should be a IMvxTouchView");
            }

            TouchView.BindingContext = new MvxBindingContext();
        }
Exemplo n.º 5
0
        public MvxBindingViewControllerAdapter(IMvxEventSourceViewController eventSource)
            : base(eventSource)
        {
            if (!(eventSource is IMvxMacView))
            {
                throw new ArgumentException(nameof(eventSource), $"{nameof(eventSource)} should be a {nameof(IMvxMacView)}");
            }

            MacView.BindingContext = new MvxBindingContext();
        }
        public MvxBindingViewControllerAdapter(IMvxEventSourceViewController eventSource)
            : base(eventSource)
        {
            if (!(eventSource is IMvxTvosView))
            {
                throw new ArgumentException(nameof(eventSource), $"{nameof(eventSource)} should be a {nameof(IMvxTvosView)}");
            }

            TvosView.BindingContext = Mvx.Resolve <IMvxBindingContext>();
        }
        public MvxBindingViewControllerAdapter(IMvxEventSourceViewController eventSource)
            : base(eventSource)
        {
            if (!(eventSource is IMvxTvosView))
            {
                throw new ArgumentException("eventSource", "eventSource should be a IMvxTvosView");
            }

            this.TvosView.BindingContext = Mvx.Resolve <IMvxBindingContext>();
        }
Exemplo n.º 8
0
 private static void ViewModelRequestForSegueImpl(this IMvxEventSourceViewController _, UIStoryboardSegue segue, IMvxBundle?parameterBundle = null)
 {
     if (segue.DestinationViewController is IMvxIosView view && view.Request == null)
     {
         var type = view.GetViewModelType();
         if (type != null)
         {
             view.Request = new MvxViewModelRequest(type, parameterBundle, null);
         }
     }
 }
        public MvxBaseViewControllerAdapter(IMvxEventSourceViewController eventSource)
        {
            if (eventSource == null)
                throw new ArgumentException("eventSource - eventSource should not be null");

            if (!(eventSource is NSViewController))
                throw new ArgumentException("eventSource - eventSource should be a NSViewController");

            _eventSource = eventSource;
            _eventSource.DisposeCalled += HandleDisposeCalled;
            _eventSource.ViewDidLoadCalled += HandleViewDidLoadCalled;
        }
Exemplo n.º 10
0
        public MvxBindingViewControllerAdapter(IMvxEventSourceViewController eventSource)
            : base(eventSource)
        {
            if (!(eventSource is IMvxIosView))
            {
                throw new ArgumentException($"{nameof(eventSource)} should be a {nameof(IMvxIosView)}", nameof(eventSource));
            }

            if (Mvx.IoCProvider.TryResolve <IMvxBindingContext>(out var bindingContext))
            {
                IosView.BindingContext = bindingContext;
            }
        }
        private static void ViewModelRequestForSegueImpl(this IMvxEventSourceViewController _, NSStoryboardSegue segue, IMvxBundle parameterBundle = null)
        {
            var view = segue.DestinationController as IMvxMacView;

            if (view != null && view.Request == null)
            {
                var type = view.GetViewModelType();
                if (type != null)
                {
                    view.Request = new MvxViewModelRequest(type, parameterBundle, null);
                }
            }
        }
        private static void ViewModelRequestForSegueImpl(this IMvxEventSourceViewController _, UIStoryboardSegue segue, IMvxBundle parameterBundle = null)
        {
            var view = segue.DestinationViewController as IMvxIosView;

            if (view != null && view.Request == null)
            {
                var type = view.GetViewModelType();
                if (type != null)
                {
                    var by = new MvxRequestedBy(MvxRequestedByType.Other, $"Segue: {segue.Identifier}");
                    view.Request = new MvxViewModelRequest(type, parameterBundle, null, by);
                }
            }
        }
        public MvxBaseViewControllerAdapter(IMvxEventSourceViewController eventSource)
        {
            if (eventSource == null)
            {
                throw new ArgumentException("eventSource - eventSource should not be null");
            }

            if (!(eventSource is NSViewController))
            {
                throw new ArgumentException("eventSource - eventSource should be a NSViewController");
            }

            _eventSource = eventSource;
            _eventSource.DisposeCalled     += HandleDisposeCalled;
            _eventSource.ViewDidLoadCalled += HandleViewDidLoadCalled;
        }
        public MvxBaseViewControllerAdapter(IMvxEventSourceViewController eventSource)
        {
            if (eventSource == null)
                throw new ArgumentException("eventSource - eventSource should not be null");

            if (!(eventSource is UIViewController))
                throw new ArgumentException("eventSource - eventSource should be a MonoBehaviour");

            _eventSource = eventSource;
            _eventSource.ViewDidAppearCalled += HandleViewDidAppearCalled;
            _eventSource.ViewDidDisappearCalled += HandleViewDidDisappearCalled;
            _eventSource.ViewWillAppearCalled += HandleViewWillAppearCalled;
            _eventSource.ViewWillDisappearCalled += HandleViewWillDisappearCalled;
            _eventSource.DisposeCalled += HandleDisposeCalled;
            _eventSource.ViewDidLoadCalled += HandleViewDidLoadCalled;
        }
        public MvxBaseViewControllerAdapter(IMvxEventSourceViewController eventSource)
        {
            if (eventSource == null)
                throw new ArgumentException("eventSource - eventSource should not be null");

            if (!(eventSource is UIViewController))
                throw new ArgumentException("eventSource - eventSource should be a UIViewController");

            this._eventSource = eventSource;
            this._eventSource.ViewDidAppearCalled += this.HandleViewDidAppearCalled;
            this._eventSource.ViewDidDisappearCalled += this.HandleViewDidDisappearCalled;
            this._eventSource.ViewWillAppearCalled += this.HandleViewWillAppearCalled;
            this._eventSource.ViewWillDisappearCalled += this.HandleViewWillDisappearCalled;
            this._eventSource.DisposeCalled += this.HandleDisposeCalled;
            this._eventSource.ViewDidLoadCalled += this.HandleViewDidLoadCalled;
            this._eventSource.ViewDidLayoutSubviewsCalled += this.HandleViewDidLayoutSubviewsCalled;
        }
Exemplo n.º 16
0
        internal static void ViewModelRequestForSegue(this IMvxEventSourceViewController self, UIStoryboardSegue segue, NSObject sender)
        {
            var view            = self as IMvxIosViewSegue;
            var parameterValues = view == null ? null : view.PrepareViewModelParametersForSegue(segue, sender);

            if (parameterValues is IMvxBundle)
            {
                self.ViewModelRequestForSegueImpl(segue, (IMvxBundle)parameterValues);
            }
            else if (parameterValues is IDictionary <string, string> )
            {
                self.ViewModelRequestForSegueImpl(segue, (IDictionary <string, string>)parameterValues);
            }
            else
            {
                self.ViewModelRequestForSegueImpl(segue, parameterValues);
            }
        }
        public MvxBaseViewControllerAdapter(IMvxEventSourceViewController eventSource)
        {
            if (eventSource == null)
            {
                throw new ArgumentException("eventSource - eventSource should not be null");
            }

            if (!(eventSource is UIViewController))
            {
                throw new ArgumentException("eventSource - eventSource should be a MonoBehaviour");
            }

            _eventSource = eventSource;
            _eventSource.ViewDidAppearCalled     += HandleViewDidAppearCalled;
            _eventSource.ViewDidDisappearCalled  += HandleViewDidDisappearCalled;
            _eventSource.ViewWillAppearCalled    += HandleViewWillAppearCalled;
            _eventSource.ViewWillDisappearCalled += HandleViewWillDisappearCalled;
            _eventSource.DisposeCalled           += HandleDisposeCalled;
            _eventSource.ViewDidLoadCalled       += HandleViewDidLoadCalled;
        }
        public MvxBaseViewControllerAdapter(IMvxEventSourceViewController eventSource)
        {
            if (eventSource == null)
            {
                throw new ArgumentException("eventSource - eventSource should not be null");
            }

            if (!(eventSource is NSViewController))
            {
                throw new ArgumentException("eventSource - eventSource should be a NSViewController");
            }

            this._eventSource = eventSource;
            this._eventSource.DisposeCalled        += this.HandleDisposeCalled;
            this._eventSource.ViewDidLoadCalled    += this.HandleViewDidLoadCalled;
            this._eventSource.ViewDidLayoutCalled  += this.HandleViewDidLayoutCalled;
            this._eventSource.ViewWillAppearCalled += this.HandleViewWillAppearCalled;
            this._eventSource.ViewWillAppearCalled += this.HandleViewDidAppearCalled;
            this._eventSource.ViewWillAppearCalled += this.HandleViewWillDisappearCalled;
            this._eventSource.ViewWillAppearCalled += this.HandleViewDidDisappearCalled;
        }
Exemplo n.º 19
0
        internal static void ViewModelRequestForSegue(this IMvxEventSourceViewController self, UIStoryboardSegue segue, NSObject sender)
        {
            object?parameterValues = null;

            if (self is IMvxIosViewSegue segueView)
            {
                parameterValues = segueView.PrepareViewModelParametersForSegue(segue, sender);
            }

            if (parameterValues is IMvxBundle bundleValues)
            {
                self.ViewModelRequestForSegueImpl(segue, bundleValues);
            }
            else if (parameterValues is IDictionary <string, string> dictValues)
            {
                self.ViewModelRequestForSegueImpl(segue, dictValues);
            }
            else
            {
                self.ViewModelRequestForSegueImpl(segue, parameterValues);
            }
        }
 public MvxViewControllerAdapter(IMvxEventSourceViewController eventSource)
     : base(eventSource)
 {
     if (!(eventSource is IMvxUnityView))
         throw new ArgumentException("eventSource", "eventSource should be a IMvxUnityView");
 }
Exemplo n.º 21
0
 public LoggingViewControllerAdapter(IMvxEventSourceViewController viewController)
     : base(viewController)
 {
 }
Exemplo n.º 22
0
 private static void ViewModelRequestForSegueImpl(this IMvxEventSourceViewController self, UIStoryboardSegue segue, IDictionary <string, string> parameterValues)
 {
     self.ViewModelRequestForSegueImpl(segue, new MvxBundle(parameterValues));
 }
Exemplo n.º 23
0
 private static void ViewModelRequestForSegueImpl(this IMvxEventSourceViewController self, UIStoryboardSegue segue, object parameterValuesObject)
 {
     self.ViewModelRequestForSegueImpl(segue, parameterValuesObject.ToSimplePropertyDictionary());
 }
Exemplo n.º 24
0
 public static void AdaptForBinding(this IMvxEventSourceViewController view)
 {
     new MvxViewControllerAdapter(view);
     new MvxBindingViewControllerAdapter(view);
 }
Exemplo n.º 25
0
 public LoggingViewControllerAdapter(IMvxEventSourceViewController viewController)
     : base(viewController)
 {
 }