Пример #1
0
 internal WindowViewMediator([NotNull] NavigationWindow window, [NotNull] IViewModel viewModel, [NotNull] IThreadManager threadManager,
                             [NotNull] IViewManager viewManager, [NotNull] IWrapperManager wrapperManager, [NotNull] IOperationCallbackManager callbackManager)
     : base(viewModel, threadManager, viewManager, wrapperManager, callbackManager)
 {
     Should.NotBeNull(window, "window");
     _window = window;
 }
        protected override WindowViewMediatorBase <IWindowView> Create(IViewModel viewModel, IThreadManager threadManager, IViewManager viewManager,
                                                                       IWrapperManager wrapperManager, IOperationCallbackManager callbackManager, INavigationDispatcher navigationDispatcher)
        {
            var mediator = new WindowViewMediator(threadManager, viewManager, wrapperManager, navigationDispatcher, new EventAggregator());

            mediator.Initialize(viewModel, null);
            return(mediator);
        }
Пример #3
0
 public ViewManager([NotNull] IThreadManager threadManager,
     [NotNull] IViewMappingProvider viewMappingProvider, [NotNull] IWrapperManager wrapperManager)
 {
     Should.NotBeNull(threadManager, "threadManager");
     Should.NotBeNull(viewMappingProvider, "viewMappingProvider");
     Should.NotBeNull(viewMappingProvider, "wrapperManager");
     _threadManager = threadManager;
     _viewMappingProvider = viewMappingProvider;
     _wrapperManager = wrapperManager;
 }
Пример #4
0
 public ViewManager([NotNull] IThreadManager threadManager,
                    [NotNull] IViewMappingProvider viewMappingProvider, [NotNull] IWrapperManager wrapperManager)
 {
     Should.NotBeNull(threadManager, nameof(threadManager));
     Should.NotBeNull(viewMappingProvider, nameof(viewMappingProvider));
     Should.NotBeNull(viewMappingProvider, nameof(wrapperManager));
     _threadManager       = threadManager;
     _viewMappingProvider = viewMappingProvider;
     _wrapperManager      = wrapperManager;
 }
Пример #5
0
 public DynamicViewModelWindowPresenter([NotNull] IViewMappingProvider viewMappingProvider, [NotNull] IOperationCallbackManager callbackManager, [NotNull] IWrapperManager wrapperManager)
 {
     Should.NotBeNull(viewMappingProvider, nameof(viewMappingProvider));
     Should.NotBeNull(callbackManager, nameof(callbackManager));
     Should.NotBeNull(wrapperManager, nameof(wrapperManager));
     _viewMappingProvider   = viewMappingProvider;
     _callbackManager       = callbackManager;
     _wrapperManager        = wrapperManager;
     _mediatorRegistrations = new List <Func <IViewModel, Type, IDataContext, IWindowViewMediator> >();
 }
Пример #6
0
 public DynamicViewModelWindowPresenter([NotNull] IViewMappingProvider viewMappingProvider, [NotNull] IOperationCallbackManager callbackManager, [NotNull] IWrapperManager wrapperManager)
 {
     Should.NotBeNull(viewMappingProvider, nameof(viewMappingProvider));
     Should.NotBeNull(callbackManager, nameof(callbackManager));
     Should.NotBeNull(wrapperManager, nameof(wrapperManager));
     _viewMappingProvider = viewMappingProvider;
     _callbackManager = callbackManager;
     _wrapperManager = wrapperManager;
     _mediatorRegistrations = new OrderedListInternal<MediatorRegistration>();
 }
 public ModalViewMediator([NotNull] IViewModel viewModel, [NotNull] IThreadManager threadManager,
                          [NotNull] IViewManager viewManager, [NotNull] IWrapperManager wrapperManager, [NotNull] IOperationCallbackManager operationCallbackManager)
     : base(viewModel, threadManager, viewManager, wrapperManager, operationCallbackManager)
 {
     _backButtonHandler = ReflectionExtensions
                          .CreateWeakDelegate <ModalViewMediator, CancelEventArgs, EventHandler <Page, CancelEventArgs> >(this,
                                                                                                                          (service, o, arg3) => service.OnBackButtonPressed((Page)o, arg3),
                                                                                                                          (o, handler) => XamarinFormsExtensions.BackButtonPressed -= handler, handler => handler.Handle);
     UseAnimations = true;
 }
Пример #8
0
 public ModalViewMediator([NotNull] IThreadManager threadManager,
                          [NotNull] IViewManager viewManager, [NotNull] IWrapperManager wrapperManager, [NotNull] IViewMappingProvider viewMappingProvider,
                          [NotNull] IViewModelProvider viewModelProvider, [NotNull] INavigationDispatcher navigationDispatcher, [NotNull] IEventAggregator eventAggregator)
     : base(threadManager, viewManager, wrapperManager, navigationDispatcher, eventAggregator)
 {
     Should.NotBeNull(viewMappingProvider, nameof(viewMappingProvider));
     Should.NotBeNull(viewModelProvider, nameof(viewModelProvider));
     _viewMappingProvider = viewMappingProvider;
     _viewModelProvider   = viewModelProvider;
     UseAnimations        = true;
 }
 public ModalViewMediator([NotNull] IViewModel viewModel, [NotNull] IThreadManager threadManager,
                          [NotNull] IViewManager viewManager, [NotNull] IWrapperManager wrapperManager, [NotNull] IOperationCallbackManager operationCallbackManager,
                          [NotNull] IViewMappingProvider viewMappingProvider,
                          [NotNull] IViewModelProvider viewModelProvider)
     : base(viewModel, threadManager, viewManager, wrapperManager, operationCallbackManager)
 {
     Should.NotBeNull(viewMappingProvider, "viewMappingProvider");
     Should.NotBeNull(viewModelProvider, "viewModelProvider");
     _viewMappingProvider = viewMappingProvider;
     _viewModelProvider   = viewModelProvider;
     UseAnimations        = true;
 }
 protected WindowViewMediatorBase([NotNull] IThreadManager threadManager, [NotNull] IViewManager viewManager, [NotNull] IWrapperManager wrapperManager, [NotNull] INavigationDispatcher navigationDispatcher,
                                  [NotNull] IEventAggregator eventAggregator)
 {
     Should.NotBeNull(threadManager, nameof(threadManager));
     Should.NotBeNull(viewManager, nameof(viewManager));
     Should.NotBeNull(wrapperManager, nameof(wrapperManager));
     Should.NotBeNull(navigationDispatcher, nameof(navigationDispatcher));
     Should.NotBeNull(eventAggregator, nameof(eventAggregator));
     _threadManager        = threadManager;
     _viewManager          = viewManager;
     _wrapperManager       = wrapperManager;
     _navigationDispatcher = navigationDispatcher;
     _eventAggregator      = eventAggregator;
     _eventAggregator.Subscribe(this);
 }
Пример #11
0
 public DynamicViewModelWindowPresenter([NotNull] IViewMappingProvider viewMappingProvider,
                                        [NotNull] IViewManager viewManager,
                                        [NotNull] IWrapperManager wrapperManager, [NotNull] IThreadManager threadManager,
                                        [NotNull] IOperationCallbackManager callbackManager)
 {
     Should.NotBeNull(viewMappingProvider, "viewMappingProvider");
     Should.NotBeNull(viewManager, "viewManager");
     Should.NotBeNull(wrapperManager, "wrapperManager");
     Should.NotBeNull(threadManager, "threadManager");
     Should.NotBeNull(callbackManager, "callbackManager");
     _viewMappingProvider = viewMappingProvider;
     _viewManager         = viewManager;
     _wrapperManager      = wrapperManager;
     _threadManager       = threadManager;
     _callbackManager     = callbackManager;
 }
Пример #12
0
        protected WindowViewMediatorBase([NotNull] IViewModel viewModel,
                                         [NotNull] IThreadManager threadManager, [NotNull] IViewManager viewManager,
                                         [NotNull] IWrapperManager wrapperManager,
                                         [NotNull] IOperationCallbackManager operationCallbackManager)
        {
            Should.NotBeNull(viewModel, nameof(viewModel));
            Should.NotBeNull(threadManager, nameof(threadManager));
            Should.NotBeNull(viewManager, nameof(viewManager));
            Should.NotBeNull(wrapperManager, nameof(wrapperManager));
            Should.NotBeNull(operationCallbackManager, nameof(operationCallbackManager));
            _viewModel                = viewModel;
            _threadManager            = threadManager;
            _viewManager              = viewManager;
            _wrapperManager           = wrapperManager;
            _operationCallbackManager = operationCallbackManager;
            var closeableViewModel = viewModel as ICloseableViewModel;

            if (closeableViewModel != null)
            {
                closeableViewModel.Closed += CloseableViewModelOnClosed;
            }
        }
Пример #13
0
 public WindowViewMediator([NotNull] IThreadManager threadManager, [NotNull] IViewManager viewManager,
                           [NotNull] IWrapperManager wrapperManager, [NotNull] INavigationDispatcher navigationDispatcher, [NotNull] IEventAggregator eventAggregator)
     : base(threadManager, viewManager, wrapperManager, navigationDispatcher, eventAggregator)
 {
 }
Пример #14
0
 public ModalViewMediator([NotNull] IThreadManager threadManager, [NotNull] IViewManager viewManager, [NotNull] IWrapperManager wrapperManager,
                          [NotNull] INavigationDispatcher navigationDispatcher, [NotNull] IEventAggregator eventAggregator)
     : base(threadManager, viewManager, wrapperManager, navigationDispatcher, eventAggregator)
 {
     _backButtonHandler = ReflectionExtensions
                          .CreateWeakDelegate <ModalViewMediator, CancelEventArgs, EventHandler <Page, CancelEventArgs> >(this,
                                                                                                                          (service, o, arg3) => service.OnBackButtonPressed((Page)o, arg3),
                                                                                                                          (o, handler) => XamarinFormsToolkitExtensions.BackButtonPressed -= handler, handler => handler.Handle);
     _closedHandler = ReflectionExtensions
                      .CreateWeakDelegate <ModalViewMediator, ModalPoppedEventArgs, EventHandler <ModalPoppedEventArgs> >(this,
                                                                                                                          (mediator, o, arg3) => mediator.OnModalClosed(arg3), (o, handler) => Application.Current.ModalPopped -= handler, handler => handler.Handle);
     UseAnimations = true;
 }
 protected override WindowViewMediatorBase <IWindowView> Create(IViewModel viewModel, IThreadManager threadManager, IViewManager viewManager,
                                                                IWrapperManager wrapperManager, IOperationCallbackManager callbackManager)
 {
     return(new WindowViewMediator(viewModel, threadManager, viewManager, wrapperManager, callbackManager));
 }
Пример #16
0
 public WindowViewMediator([NotNull] IViewModel viewModel, [NotNull] IThreadManager threadManager,
                           [NotNull] IViewManager viewManager, [NotNull] IWrapperManager wrapperManager, [NotNull] IOperationCallbackManager callbackManager)
     : base(viewModel, threadManager, viewManager, wrapperManager, callbackManager)
 {
 }
Пример #17
0
 protected abstract WindowViewMediatorBase <TView> Create(IViewModel viewModel, IThreadManager threadManager, IViewManager viewManager,
                                                          IWrapperManager wrapperManager, IOperationCallbackManager callbackManager, INavigationDispatcher navigationDispatcher);
 public DynamicViewModelWindowPresenter([NotNull] IViewMappingProvider viewMappingProvider,
     [NotNull] IViewManager viewManager,
     [NotNull] IWrapperManager wrapperManager, [NotNull] IThreadManager threadManager,
     [NotNull] IOperationCallbackManager callbackManager)
 {
     Should.NotBeNull(viewMappingProvider, nameof(viewMappingProvider));
     Should.NotBeNull(viewManager, nameof(viewManager));
     Should.NotBeNull(wrapperManager, nameof(wrapperManager));
     Should.NotBeNull(threadManager, nameof(threadManager));
     Should.NotBeNull(callbackManager, nameof(callbackManager));
     _viewMappingProvider = viewMappingProvider;
     _viewManager = viewManager;
     _wrapperManager = wrapperManager;
     _threadManager = threadManager;
     _callbackManager = callbackManager;
 }