public DashboardViewModel(IViewModelResolver viewModelResolver, IElementsProvider elementsProvider) : base(viewModelResolver) { _elementsProvider = elementsProvider; Elements = new BindableCollection<ToDoTask>(); }
public WaiterTabViewModel(IViewModelResolver viewModelResolver) : base(viewModelResolver) { DisplayName = "Waiters"; Get<WaiterListViewModel>().ShowOn(this); }
public MainWindowViewModel(IViewModelResolver viewModelResolver) : base(viewModelResolver) { DisplayName = "Table application"; Get<AccessViewModel>().ShowOn(this); }
public XpmRenderer(IViewModel model, IXpmMarkupService service, IViewModelResolver resolver, IReflectionHelper reflectionHelper) { if (model == null) { throw new ArgumentNullException("model"); } if (service == null) { throw new ArgumentNullException("service"); } if (resolver == null) { throw new ArgumentNullException("resolver"); } if (reflectionHelper == null) { throw new ArgumentNullException("reflectionHelper"); } this.model = model; if (model.ModelData is IModel) { contentModel = model.ModelData as IModel; } //if (model.ModelData is IComponentPresentation) //{ // contentData = model.ModelData as IComponentPresentation; //} this.reflectionHelper = reflectionHelper; this.xpmMarkupService = service; this.resolver = resolver; }
public XamarinFormsPageEventsEmulatedNavigation( IViewModelResolver viewModelResolver, IStack stack, IViewModelLifeCycleHandler viewModelLifeCycleHandler) : this(viewModelResolver, new HistoryStack.HistoryStack(stack), viewModelLifeCycleHandler) { }
public ConfigurationPageViewModel(IViewModelResolver viewModelResolver, ICatchableButtonFactory buttonFactory) : base("Install", "Back") { this.viewModelResolver = viewModelResolver; InstallLocalUser = buttonFactory.CreateCatchableButton(InstallLocalUserFunc); InstallAdmin = buttonFactory.CreateCatchableButton(InstallAdminFunc); }
public TableTabViewModel(IViewModelResolver viewModelResolver) : base(viewModelResolver) { DisplayName = "Tables"; Get<TableListViewModel>().ShowOn(this); }
public static IViewModelResolver UseDefaultConfigure(this IViewModelResolver @this) => @this .IfInheritsFrom<ViewModelBase>((view, viewModel) => { viewModel.Dispatcher = view.Dispatcher; }) .IfInheritsFrom<ILocalizable>((view, viewModel) => { viewModel.I18nManager = I18nManager.Instance; view.Loaded += (sender, args) => I18nManager.Instance.CurrentUICultureChanged += viewModel.OnCurrentUICultureChanged; view.Unloaded += (sender, args) => I18nManager.Instance.CurrentUICultureChanged -= viewModel.OnCurrentUICultureChanged; }) .IfInheritsFrom<IViewLoadedAndUnloadedAware>((view, viewModel) => { view.Loaded += (sender, e) => viewModel.OnLoaded(); view.Unloaded += (sender, e) => viewModel.OnUnloaded(); }) .IfInheritsFrom(typeof(IViewLoadedAndUnloadedAware<>), (view, viewModel, interfaceInstance) => { var viewType = view.GetType(); if (interfaceInstance.GenericArguments.Single() != viewType) { throw new InvalidOperationException(); } var onLoadedMethod = interfaceInstance.GetMethod<Action<object>>("OnLoaded", viewType); var onUnloadedMethod = interfaceInstance.GetMethod<Action<object>>("OnUnloaded", viewType); view.Loaded += (sender, args) => onLoadedMethod(sender); view.Unloaded += (sender, args) => onUnloadedMethod(sender); }) .IfInheritsFrom<INotificable>((view, viewModel, container) => { viewModel.GlobalMessageQueue = container.Resolve<ISnackbarMessageQueue>(); });
public MenuTabViewModel(IViewModelResolver viewModelResolver) : base(viewModelResolver) { DisplayName = "Menu"; Get<MenuListViewModel>().ShowOn(this); }
public MainWindowViewModel(IViewModelResolver viewModelResolver) : base(viewModelResolver) { DisplayName = "Table application"; Get <AccessViewModel>().ShowOn(this); }
public WaiterTabViewModel(IViewModelResolver viewModelResolver) : base(viewModelResolver) { DisplayName = "Waiters"; Get <WaiterListViewModel>().ShowOn(this); }
public AccessViewModel(IViewModelResolver viewModelResolver, IAccessProvider accessProvider, IWaiterConnectionProvider waiterConnectionProvider) : base(viewModelResolver) { _accessProvider = accessProvider; _waiterConnectionProvider = waiterConnectionProvider; _wrongUsernameOrPassword = Visibility.Hidden; _connectionError = Visibility.Hidden; }
public MenuListViewModel(IViewModelResolver viewModelResolver, IViewProvider viewProvider, ICommandBus commandBus) : base(viewModelResolver) { _viewProvider = viewProvider; _commandBus = commandBus; Elements = new BindableCollection <MenuItemView>(); }
public MenuListViewModel(IViewModelResolver viewModelResolver, IViewProvider viewProvider, ICommandBus commandBus) : base(viewModelResolver) { _viewProvider = viewProvider; _commandBus = commandBus; Elements = new BindableCollection<MenuItemView>(); }
public AddMenuItemViewModel(IViewModelResolver viewModelResolver, IViewProvider viewProvider, ICommandBus commandBus) : base(viewModelResolver) { _viewProvider = viewProvider; _commandBus = commandBus; Categories = new BindableCollection<CategoryView>(); }
public AddWaiterViewModel(IViewModelResolver viewModelResolver, ICommandBus commandBus) : base(viewModelResolver) { if (commandBus == null) throw new ArgumentNullException("commandBus"); _commandBus = commandBus; }
public static IViewModelResolver IfInheritsFrom(this IViewModelResolver @this, Type genericInterfaceType, Action<FrameworkElement, object, IGenericInterface> configuration) { Guards.ThrowIfNull(@this, configuration); return @this.IfInheritsFrom<FrameworkElement>( genericInterfaceType, (view, viewModel, interfaceInstance, container) => configuration(view, viewModel, interfaceInstance)); }
public AddMenuItemViewModel(IViewModelResolver viewModelResolver, IViewProvider viewProvider, ICommandBus commandBus) : base(viewModelResolver) { _viewProvider = viewProvider; _commandBus = commandBus; Categories = new BindableCollection <CategoryView>(); }
public EmployerViewModelsFactory( IViewModelResolver viewModelResolver, EmployerFacade employerFacade ) { _viewModelResolver = viewModelResolver; _employerFacade = employerFacade; }
public BindingContainer(IViewModelResolver resolver, IReflectionHelper helper, params IBindingModule[] modules) { this.resolver = resolver; foreach (var module in modules) { module.OnLoad(resolver, helper); Load(module); } }
public MainWindowViewModel(IViewModelResolver viewModelResolver) : base(viewModelResolver) { DisplayName = "Waiter manager"; Items.Add(Get<TableTabViewModel>()); Items.Add(Get<MenuTabViewModel>()); Items.Add(Get<WaiterTabViewModel>()); }
public Navigation( IViewModelResolver viewModelResolver, IHistoryStack historyStack, IViewModelLifeCycleHandler viewModelLifeCycle) { _viewModelResolver = viewModelResolver; _historyStack = historyStack; _viewModelLifeCycle = viewModelLifeCycle; }
public CategoryListViewModel(IViewModelResolver viewModelResolver, IViewProvider viewProvider, ICommandBus commandBus) : base(viewModelResolver) { _viewProvider = viewProvider; _commandBus = commandBus; Elements = new BindableCollection<CategoryView>(); IsBusy = true; }
private XamarinFormsPageEventsEmulatedNavigation( IViewModelResolver viewModelResolver, IHistoryStack historyStack, IViewModelLifeCycleHandler viewModelLifeCycleHandler) : base(viewModelResolver, historyStack, viewModelLifeCycleHandler) { HistoryStack = historyStack; ViewModelLifeCycleHandler = viewModelLifeCycleHandler; }
public CategoryListViewModel(IViewModelResolver viewModelResolver, IViewProvider viewProvider, ICommandBus commandBus) : base(viewModelResolver) { _viewProvider = viewProvider; _commandBus = commandBus; Elements = new BindableCollection <CategoryView>(); IsBusy = true; }
public MainWindowViewModel(IViewModelResolver viewModelResolver) : base(viewModelResolver) { DisplayName = "Waiter manager"; Items.Add(Get <TableTabViewModel>()); Items.Add(Get <MenuTabViewModel>()); Items.Add(Get <WaiterTabViewModel>()); }
public DeprecatedOsPageViewModel(IViewModelResolver viewModelResolver) : base("I Understand", "") { this.viewModelResolver = viewModelResolver; var version = Environment.OSVersion; var bitness = IntPtr.Size == 8 ? "64 Bit" : "32 Bit"; CurrentSystem = $"Detected {version.VersionString} {bitness}"; }
public EditWaiterViewModel(IViewModelResolver viewModelResolver, ICommandBus commandBus) : base(viewModelResolver) { if (commandBus == null) { throw new ArgumentNullException("commandBus"); } _commandBus = commandBus; }
public TableListViewModel(IViewModelResolver viewModelResolver, IViewProvider viewProvider, ICommandBus commandBus) : base(viewModelResolver) { _viewProvider = viewProvider; _commandBus = commandBus; DisplayName = "Tables"; Elements = new BindableCollection<TableView>(); IsBusy = true; }
public TableListViewModel(IViewModelResolver viewModelResolver, IViewProvider viewProvider, ICommandBus commandBus) : base(viewModelResolver) { _viewProvider = viewProvider; _commandBus = commandBus; DisplayName = "Tables"; Elements = new BindableCollection <TableView>(); IsBusy = true; }
/// <summary> /// Initializes a new instance of the <see cref="NavigationManager{TPageIdentifier}"/> class. /// To gather page definitions it searches for classes marked with <see cref="NavigationPageAttribute"/> from <see cref="Assembly.GetCallingAssembly"/> /// </summary> /// <param name="fragmentManager">Fragment manager of main activity.</param> /// <param name="rootFrame">The view which will be used as the one being replaced with new Views</param> /// <param name="viewModelResolver">Class used to resolve ViewModels for pages derived from <see cref="FragmentBase{TViewModel}"/></param> /// <param name="stackResolver">Class allowing to differentiate to which stack given indentigier belongs.</param> /// <param name="interceptTransaction">Delegate allowing to modify <see cref="FragmentTransaction"/> before commiting.</param> public NavigationManager( FragmentManager fragmentManager, ViewGroup rootFrame, IViewModelResolver viewModelResolver = null, IStackResolver <NavigationFragmentBase, TPageIdentifier> stackResolver = null, Action <FragmentTransaction> interceptTransaction = null) : base(stackResolver) { _fragmentManager = fragmentManager; _rootFrame = rootFrame; _interceptTransaction = interceptTransaction; NavigationFragmentBase.ViewModelResolver = viewModelResolver; var types = Assembly.GetCallingAssembly().GetTypes(); foreach (var type in types) { var attr = type.GetTypeInfo().GetCustomAttribute <NavigationPageAttribute>(); if (attr != null) { IPageProvider <NavigationFragmentBase> provider = null; switch (attr.PageProviderType) { case NavigationPageAttribute.PageProvider.Cached: provider = ObtainProviderFromType(typeof(CachedPageProvider <>)); break; case NavigationPageAttribute.PageProvider.Oneshot: provider = ObtainProviderFromType(typeof(OneshotPageProvider <>)); break; default: throw new ArgumentOutOfRangeException(); } PageDefinitions.Add((TPageIdentifier)(object)attr.Page, provider); } IPageProvider <NavigationFragmentBase> ObtainProviderFromType(Type providerType) { return((IPageProvider <NavigationFragmentBase>)providerType.MakeGenericType(type) .GetConstructor(new Type[] { }) .Invoke(null)); } } foreach (var pageDefinition in PageDefinitions) { pageDefinition.Value.PageIdentifier = pageDefinition.Key; } }
/// <summary> /// Initializes a new instance of the <see cref="NavigationManager{TPageIdentifier}"/> class. /// </summary> /// <param name="navigationController">Root navigation controller.</param> /// <param name="pageDefinitions">The dictionary defining pages.</param> /// <param name="viewModelResolver">Class used to resolve ViewModels for pages like <see cref="ViewControllerBase{TViewModel}"/> and <see cref="TabBarViewControllerBase{TViewModel}"/></param> /// <param name="stackResolver">Class allowing to differentiate to which stack given indentigier belongs.</param> public NavigationManager( UINavigationController navigationController, Dictionary <TPageIdentifier, IPageProvider <INavigationPage> > pageDefinitions, IViewModelResolver viewModelResolver, IStackResolver <INavigationPage, TPageIdentifier> stackResolver = null) : base(pageDefinitions, stackResolver) { _navigationController = navigationController; ArgumentNavigationViewControler.ViewModelResolver = viewModelResolver; ArgumentNavigationTabBarViewController.ViewModelResolver = viewModelResolver; }
public MainViewModel( IEventAggregator eventAggregator, IViewModelResolver <IViewModel> viewModelResolver ) { _viewModels = new Dictionary <string, IViewModel>(); _viewModelResolver = viewModelResolver; // zaregistrujeme tÅ™Ãdu do EventAggregatoru, aby naslouchala konkrétnÃm pÅ™ÃchozÃm zprávám // Hlavnà okno bude naslouchat zprávám ChangeViewMessage (Proto je implementováno rozhranà IHandle<ChangeViewMessage>) eventAggregator.Subscribe(this); }
public OrderViewModel(IViewModelResolver viewModelResolver, ITableConnectionProvider tableConnectionProvider, ITableAppSubscriber tableAppSubscriber) : base(viewModelResolver) { _tableConnectionProvider = tableConnectionProvider; tableAppSubscriber.NotifyEvent += (sender, message) => Application.Current.Dispatcher.Invoke(() => Message = message); tableAppSubscriber.NotifyOrderEndedEvent += TableAppSubscriber_NotifyOrderEndedEvent; tableAppSubscriber.OrderItemStateChangedEvent += TableAppSubscriber_OrderItemStateChangedEvent; tableAppSubscriber.ReservationOrderScheduledEvent += TableAppSubscriberOnReservationOrderScheduledEvent; Elements = new BindableCollection <MenuItemView>(); AddedElements = new BindableCollection <OrderMenuItemModel>(); }
/// <summary> /// New View Model Builder /// </summary> /// <param name="keyProvider">A View Model Key provider</param> public ViewModelFactory(IViewModelKeyProvider keyProvider, IViewModelResolver resolver) { if (keyProvider == null) { throw new ArgumentNullException("keyProvider"); } if (resolver == null) { throw new ArgumentNullException("resolver"); } this.keyProvider = keyProvider; this.resolver = resolver; }
public OrderViewModel(IViewModelResolver viewModelResolver, ITableConnectionProvider tableConnectionProvider, ITableAppSubscriber tableAppSubscriber) : base(viewModelResolver) { _tableConnectionProvider = tableConnectionProvider; tableAppSubscriber.NotifyEvent += (sender, message) => Application.Current.Dispatcher.Invoke(() => Message = message); tableAppSubscriber.NotifyOrderEndedEvent += TableAppSubscriber_NotifyOrderEndedEvent; tableAppSubscriber.OrderItemStateChangedEvent += TableAppSubscriber_OrderItemStateChangedEvent; tableAppSubscriber.ReservationOrderScheduledEvent += TableAppSubscriberOnReservationOrderScheduledEvent; Elements = new BindableCollection<MenuItemView>(); AddedElements = new BindableCollection<OrderMenuItemModel>(); }
public void OnLoad(IViewModelResolver resolver, IReflectionHelper helper) { if (resolver == null) { throw new ArgumentNullException("resolver"); } if (helper == null) { throw new ArgumentNullException("helper"); } this.resolver = resolver; this.helper = helper; ModelMappings = new Dictionary <Type, IList <IPropertyMapping> >(); }
/// <summary> /// Initializes a new instance of the <see cref="NavigationManager{TPageIdentifier}"/> class. /// </summary> /// <param name="fragmentManager">Fragment manager of main activity.</param> /// <param name="rootFrame">The view which will be used as the one being replaced with new Views</param> /// <param name="pageDefinitions">The dictionary defining pages.</param> /// <param name="viewModelResolver">Class used to resolve ViewModels for pages derived from <see cref="FragmentBase{TViewModel}"/></param> /// <param name="stackResolver">Class allowing to differentiate to which stack given indentigier belongs.</param> /// <param name="interceptTransaction">Delegate allowing to modify <see cref="FragmentTransaction"/> before commiting.</param> public NavigationManager( FragmentManager fragmentManager, ViewGroup rootFrame, Dictionary <TPageIdentifier, IPageProvider <NavigationFragmentBase> > pageDefinitions, IViewModelResolver viewModelResolver = null, IStackResolver <NavigationFragmentBase, TPageIdentifier> stackResolver = null, Action <FragmentTransaction> interceptTransaction = null) : base(pageDefinitions, stackResolver) { _fragmentManager = fragmentManager; _rootFrame = rootFrame; _interceptTransaction = interceptTransaction; NavigationFragmentBase.ViewModelResolver = viewModelResolver; }
public WaiterListViewModel(IViewModelResolver viewModelResolver, IViewProvider viewProvider, ICommandBus commandBus) : base(viewModelResolver) { if (viewProvider == null) throw new ArgumentNullException(nameof(viewProvider)); if (commandBus == null) throw new ArgumentNullException(nameof(commandBus)); _viewProvider = viewProvider; _commandBus = commandBus; DisplayName = "Waiters"; Elements = new BindableCollection<WaiterView>(); IsBusy = true; }
public DefaultModelMapping(IViewModelResolver resolver, IReflectionHelper helper, Type modelType) { if (helper == null) { throw new ArgumentNullException("helper"); } if (resolver == null) { throw new ArgumentNullException("resolver"); } if (modelType == null) { throw new ArgumentNullException("modelType"); } this.helper = helper; this.resolver = resolver; this.ModelType = modelType; }
public ModelBinding(IBindingModule module, IViewModelResolver resolver, IReflectionHelper helper) { if (module == null) { throw new ArgumentNullException("module"); } if (resolver == null) { throw new ArgumentNullException("resolver"); } if (helper == null) { throw new ArgumentNullException("helper"); } this.module = module; this.resolver = resolver; this.helper = helper; }
public PropertyBinding(PropertyInfo propInfo, IBindingModule module, IViewModelResolver resolver) { if (propInfo == null) { throw new ArgumentNullException("propInfo"); } if (module == null) { throw new ArgumentNullException("module"); } if (resolver == null) { throw new ArgumentNullException("resolver"); } this.module = module; this.propInfo = propInfo; this.resolver = resolver; modelType = typeof(TModel); }
public WaiterListViewModel(IViewModelResolver viewModelResolver, IViewProvider viewProvider, ICommandBus commandBus) : base(viewModelResolver) { if (viewProvider == null) { throw new ArgumentNullException(nameof(viewProvider)); } if (commandBus == null) { throw new ArgumentNullException(nameof(commandBus)); } _viewProvider = viewProvider; _commandBus = commandBus; DisplayName = "Waiters"; Elements = new BindableCollection <WaiterView>(); IsBusy = true; }
public AccessViewModel(IViewModelResolver viewModelResolver, IAccessProvider accessProvider, ITableConnectionProvider tableConnectionProvider) : base(viewModelResolver) { _accessProvider = accessProvider; _tableConnectionProvider = tableConnectionProvider; _wrongUsernameOrPassword = Visibility.Hidden; _connectionError = Visibility.Hidden; }
public ConcreteTestingParentViewModelBase(IViewModelResolver viewModelResolver) : base(viewModelResolver) { }
public ChangePasswordViewModel(IViewModelResolver viewModelResolver, ICommandBus commandBus) : base(viewModelResolver) { _commandBus = commandBus; }
public NewTaskParentViewModel(IViewModelResolver viewModelResolver, ICommandBus commandBus, AddTaskCommand addTaskCommand) : base(viewModelResolver) { _commandBus = commandBus; _addTaskCommand = addTaskCommand; }
public MainWindowViewModel(IViewModelResolver viewModelResolver) : base(viewModelResolver) { Get<IDashboardViewModel>().ShowOn(this); }
protected ParentViewModelBase(IViewModelResolver viewModelResolver) : base(viewModelResolver) { _activatedItems = new Stack<IViewModel>(); }
public AddTableViewModel(IViewModelResolver viewModelResolver, ICommandBus commandBus) : base(viewModelResolver) { _commandBus = commandBus; }
public AddCategoryViewModel(IViewModelResolver viewModelResolver, ICommandBus commandBus) : base(viewModelResolver) { _commandBus = commandBus; }