Esempio n. 1
0
 public OutlookMailSender(IViewModelFactory vmf, ITempFileService tmpService)
 {
     if (vmf == null) throw new ArgumentNullException("vmf");
     if (tmpService == null) throw new ArgumentNullException("tmpService");
     _vmf = vmf;
     _tmpService = tmpService;
 }
Esempio n. 2
0
		public NavigationService(
			Frame frame,
			IPageDefinitionRegistry pageDefinitions,
			IViewModelFactory viewModelFactory,
			IScheduler dispatcherScheduler,
			IScheduler backgroundScheduler)
		{
			if (frame == null) throw new ArgumentNullException("frame");
			if (pageDefinitions == null) throw new ArgumentNullException("pageDefinitions");
			if (viewModelFactory == null) throw new ArgumentNullException("viewModelFactory");
			if (dispatcherScheduler == null) throw new ArgumentNullException("dispatcherScheduler");
			if (backgroundScheduler == null) throw new ArgumentNullException("backgroundScheduler");
			_frame = frame;
			_pageDefinitions = pageDefinitions;
			_viewModelFactory = viewModelFactory;
			_dispatcherScheduler = dispatcherScheduler;
			_backgroundScheduler = backgroundScheduler;
			_navigatingSubject = new Subject<INavigationRequest>();
			_navigatedSubject = new Subject<INavigationRequest>();
			_semaphore = new SemaphoreSlim(1);
			History = _history = new NavigationHistory(RemoveHistoryEntry, ClearHistory);

			_frame.Navigated += _frame_Navigated;
			//_frame.BackKeyPress += _frame_BackKeyPress;
		}
Esempio n. 3
0
 public DialogCreator(IZetboxContext ctx, IViewModelFactory mdlFactory, IFrozenContext frozenCtx)
 {
     ValueModels = new List<BaseValueViewModel>();
     DataContext = ctx;
     ViewModelFactory = mdlFactory;
     FrozenCtx = frozenCtx;
 }
        public NotificationService(IViewModelFactory viewModelFactory, IDispatcherService dispatcherService,
            INotificationPositionService notificationPositionService)
        {
            Argument.IsNotNull(() => viewModelFactory);
            Argument.IsNotNull(() => dispatcherService);
            Argument.IsNotNull(() => notificationPositionService);

            _viewModelFactory = viewModelFactory;
            _dispatcherService = dispatcherService;
            _notificationPositionService = notificationPositionService;

            CurrentNotifications = new ObservableCollection<INotification>();

            DefaultBorderBrush = Brushes.Black;
            DefaultBackgroundBrush = Brushes.DodgerBlue;
            DefaultFontBrush = Brushes.WhiteSmoke;

            var app = Application.Current;
            if (app != null)
            {
                var accentColorBrush = app.TryFindResource("AccentColorBrush") as SolidColorBrush;
                if (accentColorBrush != null)
                {
                    DefaultBorderBrush = accentColorBrush;
                    DefaultBackgroundBrush = new SolidColorBrush(Color.FromArgb(255, 245, 245, 245));
                    DefaultFontBrush = Brushes.Black;
                    accentColorBrush.Color.CreateAccentColorResourceDictionary();
                }

                _mainWindow = app.MainWindow;
            }
        }
Esempio n. 5
0
 static App()
 {
     bool sql = Convert.ToBoolean(ConfigurationManager.AppSettings["useSql"]);
     App.rFactory = sql ? (IRepositoryFactory)new SqlRepositoryFactory() : new SqlCeRepositoryFactory();
     App.imFactory = new ImportManagerFactory(App.RepositoryFactory);
     App.vmFactory = new ViewModelFactory(App.RepositoryFactory, App.ImportManagerFactory);
 }
 public static void Initialize()
 {
     var kernel = new StandardKernel(new RegistrationModule());
     kernel.Load("DD4T.ContentModel.Contracts");
     kernel.Load("DD4T.Factories");
     kernel.Load("DD4T.Providers.Test");
     kernel.Load("DD4T.ViewModels");
     PageFactory = kernel.Get<IPageFactory>();
     ComponentPresentationFactory = kernel.Get<IComponentPresentationFactory>();
     ComponentFactory = kernel.Get<IComponentFactory>();
     PageFactory.CacheAgent = kernel.Get<ICacheAgent>();
     PageFactory.PageProvider = kernel.Get<IPageProvider>();
     ComponentPresentationFactory.CacheAgent = kernel.Get<ICacheAgent>();
     ComponentPresentationFactory.ComponentPresentationProvider = kernel.Get<IComponentPresentationProvider>();
     ((ComponentFactory)ComponentFactory).ComponentPresentationFactory = ComponentPresentationFactory;
     ((TridionPageProvider)PageFactory.PageProvider).SerializerService = kernel.Get<ISerializerService>();
     ((TridionComponentPresentationProvider)ComponentPresentationFactory.ComponentPresentationProvider).SerializerService = kernel.Get<ISerializerService>();
     ((TridionPageProvider)PageFactory.PageProvider).ComponentPresentationProvider = ComponentPresentationFactory.ComponentPresentationProvider;
     kernel.Bind<IViewModelKeyProvider>().To <WebConfigViewModelKeyProvider>();
     kernel.Bind<IViewModelResolver>().To<DefaultViewModelResolver>();
     kernel.Bind<IViewModelFactory>().To<ViewModelFactory>();
     kernel.Bind<IReflectionHelper>().To<ReflectionOptimizer>();
     ViewModelFactory = kernel.Get<IViewModelFactory>();
     ViewModelFactory.LoadViewModels(new [] { typeof(TestViewModelA).Assembly });
 }
Esempio n. 7
0
 public UnhandledErrorViewModel(
     IViewModelManager viewModelManager, 
     IViewModelFactory viewModelFactory,
     IReactiveCommandFactory reactiveCommandFactory)
     : base(viewModelManager, viewModelFactory, reactiveCommandFactory)
 {
 }
        public ApplicationViewModel(INavigationService viewNavigationService, IUserService userService, IViewModelFactory viewModelFactory)
        {
            ObjectValidator.IfNullThrowException(viewNavigationService, "viewNavigationService");
            ObjectValidator.IfNullThrowException(userService,  "userService");
            ObjectValidator.IfNullThrowException(viewModelFactory, "viewModelFactory");

            this.viewModelFactory = viewModelFactory;
            this.ViewNavigationService = viewNavigationService;

            this.Back = new RelayCommand(o => this._GoBack(), o => true);
            this.Forward = new RelayCommand(o => this._GoForward(), o => true);
            this.Close = new RelayCommand(o => this._Close(), o => true);

            this.LeftNavigationButtonCollection = new List<DisplayableNavigationCommand>();

            /*All this behaviour needs to be moved to a loaded command*/
            this.ViewNavigationService.CurrentPage = viewModelFactory.Get<StartPageViewModel>();
            ViewNavigationService.GetDefaultPagesByNames().Each(page => this.LeftNavigationButtonCollection.Add(
                                                                    new DisplayableNavigationCommand(
                                                                     page.Key,
                                                                     async () => await TaskEx.Run(() => ViewNavigationService.CurrentPage = page.Value()),
                                                                     () => true)));

            ViewNavigationService.PageChanged += async (sender, args) =>
            {
                if ((ViewNavigationService.CurrentPage as ProjectDashBoardViewModel) != null)
                {
                    await this._LoadNonDefaultPages();
                }
            };
        }
Esempio n. 9
0
 public WrappingViewModel(
     IViewModelManager viewModelManager, 
     IViewModelFactory viewModelFactory,
     IReactiveCommandFactory reactiveCommandFactory)
     : base(viewModelManager, viewModelFactory, reactiveCommandFactory)
 {
 }
        public ChildWindowViewModel(IViewModelFactory viewModelFactory)
        {
            _viewModelFactory = viewModelFactory;

            Messenger.Default.Register<DisplayErrorSavingDataMessage>(this, HandleMessage);
            Messenger.Default.Register<DisplayErrorRetrievingDataMessage>(this, HandleMessage);
        }
        public ZetboxContextExceptionHandler(IViewModelFactory vmf, IFrozenContext frozenCtx)
        {
            if (vmf == null) throw new ArgumentNullException("vmf");
            if (frozenCtx == null) throw new ArgumentNullException("frozenCtx");

            this.vmf = vmf;
            this.frozenCtx = frozenCtx;
        }
Esempio n. 12
0
        public ReportingErrorDialog(IViewModelFactory vmFactory, Lazy<IZetboxContext> lazyCtx)
        {
            if (vmFactory == null) throw new ArgumentNullException("vmFactory");
            if (lazyCtx == null) throw new ArgumentNullException("lazyCtx");

            _viewModelFactory = vmFactory;
            _lazyCtx = lazyCtx;
        }
Esempio n. 13
0
        public BasicAuthCredentialsResolver(IViewModelFactory vmf, Func<BaseMemoryContext> ctxFactory)
        {
            if (vmf == null) throw new ArgumentNullException("vmf");
            if (ctxFactory == null) throw new ArgumentNullException("ctxFactory");

            _vmf = vmf;
            _ctxFactory = ctxFactory;
        }
        public AllListsViewModel(IPresentListRepository listRepository, IViewModelFactory viewModelFactory)
        {
            _listRepository = listRepository;
            _viewModelFactory = viewModelFactory;

            NewListCommand = new RelayCommand(CreateNewList);
            ShowPresentsCommand = new RelayCommand(ShowPresents);
        }
        public EmployeesVM(IUnitOfWork unitOfWork, IDisposable scope, IViewModelFactory viewModelFactory)
        {
            _unitOfWork = unitOfWork;
            _scope = scope;
            _viewModelFactory = viewModelFactory;

            LoadEmployees();
        }
Esempio n. 16
0
 public ViewModelDependencies(IViewModelFactory f, IUiThreadManager ui, IAsyncThreadManager async, IFrozenContext frozenCtx, IIdentityResolver idResolver)
 {
     Factory = f;
     UiThread = ui;
     AsyncThread = async;
     FrozenContext = frozenCtx;
     IdentityResolver = idResolver;
 }
Esempio n. 17
0
 public ProjectViewModelTests()
 {
     _dialogService = MockRepository.GenerateMock<IDialogService>();
     _projectService = MockRepository.GenerateMock<IProjectService>();
     _statusService = MockRepository.GenerateMock<IStatusService>();
     _windowManager = MockRepository.GenerateMock<IWindowManager>();
     _viewModelFactory = MockRepository.GenerateMock<IViewModelFactory>();
 }
Esempio n. 18
0
 public Launcher(Func<ContextIsolationLevel, IZetboxContext> ctxFactory, IViewModelFactory mdlFactory, IFrozenContext frozenCtx, ZetboxConfig cfg, IPerfCounter perfCounter)
 {
     this.frozenCtx = frozenCtx;
     this.ctxFactory = ctxFactory;
     this.mdlFactory = mdlFactory;
     this.cfg = cfg;
     this.perfCounter = perfCounter;
 }
		public MonitoringInstancesViewModelFactory(IViewModelFactory innerViewModelFactory, TimeSpan time)
		{
			if (innerViewModelFactory == null) throw new ArgumentNullException("innerViewModelFactory");
			_innerViewModelFactory = innerViewModelFactory;

			_instanceMonitor = InstanceTracker.MonitorByType<IViewModel>(time);
			_instanceMonitor.Update += _instanceMonitor_Update;
		}
Esempio n. 20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WordRibbonFactory"/> class.
 /// </summary>
 /// <param name="viewModelFactory">A view model factory</param>
 /// <param name="customTaskPaneCollection">A delayed resolution instance of the custom task pane collection of your addin 'new Lazy(()=>CustomTaskPaneCollection)'</param>
 /// <param name="vstoFactory">The VSTO factory (Globals.Factory)</param>
 /// <param name="assemblies">Assemblies to scan for view models</param>
 public WordRibbonFactory(
     IViewModelFactory viewModelFactory,
     Func<object> customTaskPaneCollection, 
     Factory vstoFactory, 
     params Assembly[] assemblies)
     : base(new RibbonFactoryController<WordRibbonType>(assemblies, new WordViewContextProvider(), viewModelFactory, customTaskPaneCollection, vstoFactory))
 {
 }
Esempio n. 21
0
        public UICreator(IViewModelFactory vmf, IZetboxContext ctx, ViewModel parent)
        {
            if (vmf == null) throw new ArgumentNullException("vmf");
            if (ctx == null) throw new ArgumentNullException("ctx");

            ViewModelFactory = vmf;
            DataContext = ctx;
            Parent = parent;
        }
Esempio n. 22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OutlookRibbonFactory"/> class.
 /// </summary>
 /// <param name="viewModelFactory">A delegate taking a type and returning an instance of the requested type</param>
 /// <param name="customTaskPaneCollection">A delayed resolution instance of the custom task pane collection of your addin 'new Lazy(()=>CustomTaskPaneCollection)'</param>
 /// <param name="assemblies">Assemblies to scan for view models</param>
 /// <param name="vstoFactory">The VSTO factory (Globals.Factory)</param>
 /// <param name="viewLocationStrategy">The view location strategy, null for default strategy.</param>
 public OutlookRibbonFactory(
     IViewModelFactory viewModelFactory,
     Func<CustomTaskPaneCollection> customTaskPaneCollection,
     IViewLocationStrategy viewLocationStrategy,
     Factory vstoFactory, 
     params Assembly[] assemblies)
     : base(new RibbonFactoryController<OutlookRibbonType>(assemblies, new OutlookViewContextProvider(), viewModelFactory, customTaskPaneCollection, vstoFactory, viewLocationStrategy))
 {
 }
Esempio n. 23
0
        // private static IAssetsManager _assets;
        public DataTypeActions(IViewModelFactory vmf, IFrozenContext frozenCtx, IAssetsManager assets)
        {
            if (vmf == null) throw new ArgumentNullException("vmf");
            if (frozenCtx == null) throw new ArgumentNullException("frozenCtx");
            // if (assets == null) throw new ArgumentNullException("assets");

            _vmf = vmf;
            _frozenCtx = frozenCtx;
        }
 protected override Type GetModelType(IModel data, IViewModelFactory factory, IModelProperty property)
 {
     if (EmbeddedModelType == null)
     {
         return property.ModelType;
     }
     
     return EmbeddedModelType;
 }
        public PresentListViewModel(PresentList presentList, IPresentListRepository listRepository, IViewModelFactory viewModelFactory)
        {
            _presentList = presentList;
            _listRepository = listRepository;
            _viewModelFactory = viewModelFactory;

            EditCommand = new RelayCommand(EditList);
            AddPresentCommand = new RelayCommand(AddPresent);
        }
Esempio n. 26
0
        public override IEnumerable GetFieldValues(IField field, IModelProperty property, ITemplate template, IViewModelFactory factory)
        {
            string pageId = null;
            if (_contextModel != null)
                pageId = _contextModel.PageId.ToString();

            return field.Values
                .Select(v => new MvcHtmlString(factory.RichTextResolver.Resolve(v, pageId).ToString())); 
        }
        public ApplicationViewModel([NotNull] IViewModelFactory viewModelFactory, SuperheroesViewModel superheroesViewModel)
        {
            if (viewModelFactory == null) throw new ArgumentNullException(nameof(viewModelFactory));
            if (superheroesViewModel == null) throw new ArgumentNullException(nameof(superheroesViewModel));

            this.viewModelFactory = viewModelFactory;

            SuperheroesViewModel = superheroesViewModel;
            InitializeEvents();
        }
Esempio n. 28
0
 public TestRibbonFactory(
     IViewModelFactory viewModelFactory, 
     Func<CustomTaskPaneCollection> customTaskPaneCollection,
     IViewProvider<TestRibbonTypes> viewProvider,
     IViewContextProvider contextProvider,
     params Assembly[] assemblies)
     : base(new RibbonFactoryController<TestRibbonTypes>(assemblies, contextProvider, viewModelFactory, customTaskPaneCollection, Substitute.For<Factory>(), new DefaultViewLocationStrategy()))
 {
     this.viewProvider = viewProvider;
 }
Esempio n. 29
0
        public override IEnumerable GetFieldValues(IField field, IModelProperty property, ITemplate template, IViewModelFactory factory)
        {
            IEnumerable fieldValue = null;
            var values = field.Values;
            if (IsBooleanValue)
                fieldValue = values.Select(v => { bool b; return bool.TryParse(v, out b) && b; });
            else fieldValue = values;

            return fieldValue;
        }
        public OptionsMenuViewModel(IPlayShellViewModel playShellViewModel) {
            _shellViewModel = playShellViewModel;
            _softwareUpdate = _shellViewModel.SoftwareUpdate;
            _factory = _shellViewModel.Factory;
            _settings = _shellViewModel.Settings;

            OptionsMenu = new OptionsMenu(this);

            this.SetCommand(x => x.OptionsMenuCommand).Subscribe(x => OptionsMenu.IsOpen = !OptionsMenu.IsOpen);
        }
Esempio n. 31
0
 public static SingleDownloadViewModel CreateSingleDownloadViewModel(this IViewModelFactory factory)
 {
     return(new SingleDownloadViewModel());
 }
 public MainWindowViewModel(IViewModelFactory viewModelFactory)
 {
     this.viewModelFactory = viewModelFactory;
 }
Esempio n. 33
0
 public AssemblyActions(IViewModelFactory mdlFactory)
 {
     _mdlFactory = mdlFactory;
 }
 public SecurityController(IViewModelFactory <bool, SignInViewModel> signInViewModelFactory, IViewModelFactory <RegisterViewModel> registerViewModelFactory,
                           IViewModelFactory <RegisterFluentViewModel> registerFluentViewModelFactory, IMembershipProvider membershipProvider, ILogger logger)
 {
     this.signInViewModelFactory         = signInViewModelFactory;
     this.registerViewModelFactory       = registerViewModelFactory;
     this.registerFluentViewModelFactory = registerFluentViewModelFactory;
     this.membershipProvider             = membershipProvider;
     this.logger = logger;
 }
Esempio n. 35
0
        public MessageService(IDispatcherService dispatcherService, IUIVisualizerService uiVisualizerService, IViewModelFactory viewModelFactory)
            : base(dispatcherService)
        {
            Argument.IsNotNull(() => dispatcherService);
            Argument.IsNotNull(() => uiVisualizerService);
            Argument.IsNotNull(() => viewModelFactory);

            _dispatcherService   = dispatcherService;
            _uiVisualizerService = uiVisualizerService;
            _viewModelFactory    = viewModelFactory;
        }
Esempio n. 36
0
        public override IEnumerable GetPropertyValues(IModel modelData, IModelProperty property, IViewModelFactory factory)
        {
            IEnumerable result = null;

            if (modelData != null)
            {
                //need null checks on Template
                IFieldSet fields   = null;
                ITemplate template = null;
                if (IsTemplateMetadata)
                {
                    if (modelData is IComponentPresentation)
                    {
                        var templateData = modelData as IComponentPresentation;
                        template = templateData.ComponentTemplate;
                    }
                    else if (modelData is IPage)
                    {
                        var templateData = modelData as IPage;
                        template = templateData.PageTemplate;
                    }
                    fields = template != null ? template.MetadataFields : null;
                }
                else if (IsMetadata)
                {
                    if (modelData is IComponentPresentation)
                    {
                        fields = (modelData as IComponentPresentation).Component.MetadataFields;
                    }
                    else if (modelData is IComponent)
                    {
                        fields = (modelData as IComponent).MetadataFields;
                    }
                    else if (modelData is IPage)
                    {
                        fields = (modelData as IPage).MetadataFields;
                    }
                    else if (modelData is ITemplate)
                    {
                        fields = (modelData as ITemplate).MetadataFields;
                    }
                    else if (modelData is IKeyword)
                    {
                        fields = (modelData as IKeyword).MetadataFields;
                    }
                    //Any other things with MetadataFields?
                }
                else if (modelData is IComponentPresentation)
                {
                    fields = (modelData as IComponentPresentation).Component.Fields;
                }

                if (String.IsNullOrEmpty(FieldName))
                {
                    FieldName = GetFieldName(property.Name);                                  //Convention over configuration by default -- Field name = Property name
                }
                if (fields != null && fields.ContainsKey(FieldName))
                {
                    result = this.GetFieldValues(fields[FieldName], property, template, factory);
                }
            }
            return(result);
        }
Esempio n. 37
0
 /// <summary>
 /// When overriden in a derived class, this gets the value of the Property for a given Component
 /// </summary>
 /// <param name="component">Component for the View Model</param>
 /// <param name="propertyType">Actual return type for the Property</param>
 /// <param name="template">Component Template</param>
 /// <param name="factory">View Model factory</param>
 /// <returns>The Property value</returns>
 public abstract IEnumerable GetPropertyValues(IComponent component, IModelProperty property, ITemplate template, IViewModelFactory factory);
Esempio n. 38
0
 public LapPickerController(ITelemetryViewsSynchronization telemetryViewsSynchronization, ITelemetryLoadController telemetryLoadController, IMainWindowViewModel mainWindowViewModel, IViewModelFactory viewModelFactory,
                            IColorPaletteProvider colorPaletteProvider, IOpenWindowController openWindowController, ISettingsWindowController settingsWindowController, IUserInputProvider userInputProvider)
 {
     _allAvailableLaps = new List <LapSummaryDto>();
     _loadedLaps       = new List <LapSummaryDto>();
     _telemetryViewsSynchronization = telemetryViewsSynchronization;
     _telemetryLoadController       = telemetryLoadController;
     _lapSelectionViewModel         = mainWindowViewModel.LapSelectionViewModel;
     _viewModelFactory         = viewModelFactory;
     _colorPaletteProvider     = colorPaletteProvider;
     _openWindowController     = openWindowController;
     _settingsWindowController = settingsWindowController;
     _userInputProvider        = userInputProvider;
 }
Esempio n. 39
0
 /// <summary>
 /// When overriden in a derived class, this method should return the value of the View Model property from a Field object
 /// </summary>
 /// <param name="field">The Field</param>
 /// <param name="propertyType">The concrete type of the view model property for this attribute</param>
 /// <param name="template">The Component Template to use</param>
 /// <param name="factory">The View Model Builder</param>
 /// <returns></returns>
 public abstract IEnumerable GetFieldValues(IField field, IModelProperty property, ITemplate template, IViewModelFactory factory = null);
Esempio n. 40
0
 public HomeController(IViewModelFactory viewfactory)
 {
     this.viewfactory = viewfactory;
 }
Esempio n. 41
0
 public CheckOutPageController(IViewModelFactory viewModelFactory, IMediator mediator, IContentLoader contentLoader)
 {
     _viewModelFactory = viewModelFactory;
     _mediator         = mediator;
     _contentLoader    = contentLoader;
 }
Esempio n. 42
0
 /// <summary>
 /// Creates the screen.
 /// </summary>
 /// <param name="factory">The factory.</param>
 /// <param name="constructionComplete">The construction completion callback.</param>
 public void CreateSubjectHost(IViewModelFactory factory, Action <IHaveSubject> constructionComplete)
 {
     constructionComplete(factory.CreateFor(subject));
 }
Esempio n. 43
0
 public AccordionContainerItemPreviewController(IViewModelFactory viewModelFactory) : base(viewModelFactory)
 {
 }
Esempio n. 44
0
        public override IEnumerable GetFieldValues(IField field, IModelProperty property, ITemplate template, IViewModelFactory factory = null)
        {
            IEnumerable fieldValue = null;
            var         values     = GetRawValues(field);

            if (values != null)
            {
                if (ComplexTypeMapping == null && ReturnRawData)
                {
                    fieldValue = values;
                }
                else
                {
                    fieldValue = values.Cast <object>()
                                 .Select(value => BuildModel(factory, BuildModelData(value, field, template)))
                                 .Where(value => value != null);
                }
            }
            return(fieldValue);
        }
Esempio n. 45
0
 protected abstract Type GetModelType(IModel data, IViewModelFactory factory);
Esempio n. 46
0
 public abstract IEnumerable GetPropertyValues(IModel modelData, IModelProperty property, IViewModelFactory factory);
Esempio n. 47
0
 public UpdateCurrentViewModelCommand(IViewModelNavigator navigator, IViewModelFactory viewModelFactory)
 {
     _navigator        = navigator;
     _viewModelFactory = viewModelFactory;
 }
Esempio n. 48
0
 /// <summary>
 /// When overriden in a derived class, this gets the value of the Property for a given Template
 /// </summary>
 /// <param name="template">Template for the View Model</param>
 /// <param name="propertyType">Actual return type for the Property</param>
 /// <param name="factory">View Model factory</param>
 /// <returns>The Property value</returns>
 public abstract IEnumerable GetPropertyValues(ITemplate template, Type propertyType, IViewModelFactory factory);
Esempio n. 49
0
 public TabsViewModel(IViewModelFactory viewModelFactory)
 {
     this.viewModelFactory = viewModelFactory;
 }
Esempio n. 50
0
        public override IEnumerable GetPropertyValues(IModel modelData, IModelProperty property, IViewModelFactory factory)
        {
            IEnumerable result = null;

            if (modelData != null && modelData is IComponentPresentation &&
                (modelData as IComponentPresentation).ComponentTemplate != null)
            {
                ITemplate templateData = (modelData as IComponentPresentation).ComponentTemplate;
                result = this.GetPropertyValues(templateData, property.ModelType, factory);
            }
            return(result);
        }
Esempio n. 51
0
 /// <summary>
 /// When overriden in a derived class, this gets the value of the Property for a given Page
 /// </summary>
 /// <param name="page">Page for the View Model</param>
 /// <param name="propertyType">Actual return type for the Property</param>
 /// <param name="factory">View Model factory</param>
 /// <returns>The Property value</returns>
 public abstract IEnumerable GetPropertyValues(IPage page, Type propertyType, IViewModelFactory factory);
Esempio n. 52
0
        public override IEnumerable GetPropertyValues(IModel modelData, IModelProperty property, IViewModelFactory factory)
        {
            IEnumerable result = null;

            if (modelData is IPage)
            {
                var pageModel = modelData as IPage;
                result = this.GetPropertyValues(pageModel, property.ModelType, factory);
            }
            return(result);
        }
Esempio n. 53
0
 public StackShellViewModel(IServiceDispatcher serviceDispatcher, IViewModelFactory viewModelFactory)
     : base(serviceDispatcher, viewModelFactory)
 {
     BackCommand = new Command(Back, CanBack);
 }
Esempio n. 54
0
 //Really leaving the bulk of the work to implementer -- they must both find out if the CP matches this attribute and then construct an object with it
 /// <summary>
 /// When overriden in a derived class, this gets a set of values representing Component Presentations of a Page
 /// </summary>
 /// <param name="cps">Component Presentations for the Page Model</param>
 /// <param name="propertyType">Actual return type of the Property</param>
 /// <param name="factory">A View Model factory</param>
 /// <returns>The Property value</returns>
 public abstract IEnumerable GetPresentationValues(IList <IComponentPresentation> cps, IModelProperty property, IViewModelFactory factory);
Esempio n. 55
0
 public PopupViewStackServiceFixture WithViewModelFactory(IViewModelFactory viewModelFactory) =>
 this.With(out _viewModelFactory, viewModelFactory);
Esempio n. 56
0
        public override IEnumerable GetPropertyValues(IModel modelData, IModelProperty property, IViewModelFactory factory)
        {
            IEnumerable result = null;

            if (modelData is IPage)
            {
                var cpModels = (modelData as IPage).ComponentPresentations;
                result = GetPresentationValues(cpModels, property, factory);
            }
            return(result);
        }
Esempio n. 57
0
        public override IEnumerable GetPropertyValues(IModel modelData, IModelProperty property, IViewModelFactory factory)
        {
            IEnumerable result = null;

            if (modelData != null)
            {
                if (modelData is IComponentPresentation)
                {
                    var cpData = modelData as IComponentPresentation;
                    if (cpData != null)
                    {
                        result = GetPropertyValues(cpData.Component, property,
                                                   cpData.ComponentTemplate, factory);
                    }
                }
                else if (modelData is IComponent) //Not all components come with Templates (Multimedia?)
                {
                    result = GetPropertyValues(modelData as IComponent, property, null, factory);
                }
            }
            return(result);
        }
Esempio n. 58
0
 public static SettingsViewModel CreateSettingsViewModel(this IViewModelFactory factory)
 {
     return(new SettingsViewModel());
 }
Esempio n. 59
0
 public static MultipleDownloadViewModel CreateMultipleDownloadViewModel(this IViewModelFactory factory)
 {
     return(new MultipleDownloadViewModel());
 }
Esempio n. 60
0
        public static DownloadSingleSetupViewModel CreateDownloadSingleSetupViewModel(this IViewModelFactory factory,
                                                                                      string title, Video video, IReadOnlyList <DownloadOption> availableDownloadOptions)
        {
            var viewModel = factory.CreateDownloadSingleSetupViewModel();

            viewModel.Title = title;
            viewModel.Video = video;
            viewModel.AvailableDownloadOptions = availableDownloadOptions;

            return(viewModel);
        }