Esempio n. 1
0
        public FilterViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog, IFilterService service)
            : base(log, scheduler, standardDialog)
        {
            _service = service;

            Disposables.Add(service);
        }
Esempio n. 2
0
        public ReportLayoutViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                                     IReportLayoutService service,
                                     BindableCollection<ReportLayoutItemViewModel> availableCollection,
                                     BindableCollection<ReportLayoutItemViewModel> rowsCollection,
                                     BindableCollection<ReportLayoutItemViewModel> columnsCollection,
                                     Func<ReportLayoutItemViewModel> reportLayoutItemViewModelFactory)
            : base(log, scheduler, standardDialog)
        {
            _service = service;
            _reportLayoutItemViewModelFactory = reportLayoutItemViewModelFactory;

            this.SetupHeader(scheduler, "Layout");

            Available = availableCollection;
            Rows = rowsCollection;
            Columns = columnsCollection;

            ToRowsDropTarget = new ReportLayoutDropTarget(x => x.Type == AttributeType.Dimension,
                                                          Rows, Available, Columns);

            ToColumnsDropTarget = new ReportLayoutDropTarget(x => x.Type == AttributeType.Measure,
                                                             Columns, Available, Rows);

            ToAvailableDropTarget = new ReportLayoutDropTarget(x => true,
                                                               Available, Columns, Rows);

            OkCommand = new DelegateCommand(ClosingStrategy.Close);
        }
        public DynamicColumnEditViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog, IDynamicColumnEditService service)
            : base(log, scheduler, standardDialog)
        {
            _service = service;

            Disposables.Add(service);
        }
Esempio n. 4
0
 public ReportRunnerViewModel(ILog log, IStandardDialog standardDialog, IDispatcherSchedulerProvider scheduler,
                              IToolBarService toolBarService,
                              ReportParameterViewModel reportParameterViewModel, IReportRunnerService service,
                              BindableCollection <IViewModel> itemsCollection)
     : base(log, standardDialog, scheduler, toolBarService, reportParameterViewModel, service, itemsCollection)
 {
 }
        public DynamicColumnManagementViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog, IDynamicColumnManagementService service,
                                                BindableCollection<DynamicColumn> columnsCollection, 
                                                BindableCollection<IToolBarItem> toolBarItemsCollection,
                                                Func<DynamicColumnEditViewModel> editViewModelFactory,
                                                IToolBarService toolBarService)
            : base(log, scheduler, standardDialog)
        {
            _service = service;
            _editViewModelFactory = editViewModelFactory;

            Disposables.Add(service);

            Columns = columnsCollection;

            ToolBarItems = toolBarItemsCollection;

            var saveToolBarItem = toolBarService.CreateToolBarButtonItem();
            saveToolBarItem.DisplayName = "Save";
            _saveCommand = new DelegateCommand(() =>
            {
                ClosingStrategy.Close();
            });
            saveToolBarItem.Command = _saveCommand;
            ToolBarItems.Add(saveToolBarItem);

            var cancelToolBarItem = toolBarService.CreateToolBarButtonItem();
            cancelToolBarItem.DisplayName = "Cancel";
            cancelToolBarItem.Command = ClosingStrategy.CloseCommand;
            ToolBarItems.Add(cancelToolBarItem);
        }
Esempio n. 6
0
        public DataViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                             IDataService service, BindableCollection<IContextMenuItem> contextMenuCollection,
                             Func<BindableCollection<Dictionary<string, object>>> itemsCollectionFactory,
                             Func<BindableCollection<Column>> columnCollectionFactory,
            BindableCollection<SelectedCell> selectedCellsCollection)
            : base(log, scheduler, standardDialog)
        {
            _service = service;
            _itemsCollectionFactory = itemsCollectionFactory;
            _columnCollectionFactory = columnCollectionFactory;

            Disposables.Add(service);

            ContextMenu = contextMenuCollection;

            SelectedCells = selectedCellsCollection;

            SelectedCells.AddedItemsCollectionChanged
                         .TakeUntil(ClosingStrategy.Closed)
                         .ObserveOn(Scheduler.Dispatcher.RX)
                         .Subscribe(cells =>
                                    {

                                    });
        }
Esempio n. 7
0
        public AppearanceViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                                   BindableCollection<string> fontSizesCollection,
                                   BindableCollection<Color> accentColorsCollection,
                                   BindableCollection<ThemeItemViewModel> themesCollection)
            : base(log, scheduler, standardDialog)
        {
            this.SetupHeader(scheduler, "Appearance");

            FontSizes = fontSizesCollection;
            FontSizes.AddRange(new[] {FONT_SMALL, FONT_LARGE});

            SelectedFontSize = AppearanceManager.Current.FontSize == FontSize.Large ? FONT_LARGE : FONT_SMALL;

            AccentColors = accentColorsCollection;
            foreach (var accentColor in _accentColors)
            {
                AccentColors.Add(accentColor);
            }

            // add the default themes
            Themes = themesCollection;
            Themes.AddRange(new[]
            {
                new ThemeItemViewModel {Name = "Dark", Source = AppearanceManager.DarkThemeSource},
                new ThemeItemViewModel {Name = "Light", Source = AppearanceManager.LightThemeSource}
            });

            SyncThemeAndColor();

            AppearanceManager.Current.PropertyChanged += OnAppearanceManagerPropertyChanged;
        }
Esempio n. 8
0
        public AppearanceViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                                   BindableCollection <string> fontSizesCollection,
                                   BindableCollection <Color> accentColorsCollection,
                                   BindableCollection <ThemeItemViewModel> themesCollection)
            : base(log, scheduler, standardDialog)
        {
            this.SetupHeader(scheduler, "Appearance");

            FontSizes = fontSizesCollection;
            FontSizes.AddRange(new[] { FONT_SMALL, FONT_LARGE });

            SelectedFontSize = AppearanceManager.Current.FontSize == FontSize.Large ? FONT_LARGE : FONT_SMALL;

            AccentColors = accentColorsCollection;
            foreach (var accentColor in _accentColors)
            {
                AccentColors.Add(accentColor);
            }

            // add the default themes
            Themes = themesCollection;
            Themes.AddRange(new[]
            {
                new ThemeItemViewModel {
                    Name = "Dark", Source = AppearanceManager.DarkThemeSource
                },
                new ThemeItemViewModel {
                    Name = "Light", Source = AppearanceManager.LightThemeSource
                }
            });

            SyncThemeAndColor();

            AppearanceManager.Current.PropertyChanged += OnAppearanceManagerPropertyChanged;
        }
Esempio n. 9
0
        public FilterViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog, IFilterService service)
            : base(log, scheduler, standardDialog)
        {
            _service = service;

            Disposables.Add(service);
        }
Esempio n. 10
0
 public ReportViewModel(ILog log, IStandardDialog standardDialog, IDispatcherSchedulerProvider scheduler,
                        BindableCollection <IViewModel> itemsCollection,
                        ReportRunnerViewModel reportRunnerViewModel)
     : base(log, standardDialog, scheduler, itemsCollection)
 {
     _reportRunnerViewModel = reportRunnerViewModel;
     this.SyncViewModelActivationStates(_reportRunnerViewModel).AddDisposable(Disposables);
 }
Esempio n. 11
0
 public ReportViewModel(ILog log, IStandardDialog standardDialog, IDispatcherSchedulerProvider scheduler,
                        BindableCollection<IViewModel> itemsCollection,
                        ReportRunnerViewModel reportRunnerViewModel)
     : base(log, standardDialog, scheduler, itemsCollection)
 {
     _reportRunnerViewModel = reportRunnerViewModel;
     this.SyncViewModelActivationStates(_reportRunnerViewModel).AddDisposable(Disposables);
 }
Esempio n. 12
0
        public HistoryViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                                BindableCollection <HistoryItemViewModel> itemsCollection)
            : base(log, scheduler, standardDialog)
        {
            Items = itemsCollection;

            this.SetupHeader(scheduler, "History");

            OpenCommand = new DelegateCommand <HistoryItemViewModel>(x => Open.SafeInvoke(this, new DataEventArgs <long>(x.Id)));
        }
Esempio n. 13
0
        public PathViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog, IPathService service,
                             ReactiveSingleSelectCollection<PathItemViewModel> pathCollection)
            : base(log, scheduler, standardDialog)
        {
            _service = service;

            Disposables.Add(service);

            Path = pathCollection;
        }
Esempio n. 14
0
        public PathViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog, IPathService service,
                             ReactiveSingleSelectCollection <PathItemViewModel> pathCollection)
            : base(log, scheduler, standardDialog)
        {
            _service = service;

            Disposables.Add(service);

            Path = pathCollection;
        }
Esempio n. 15
0
        public HistoryViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                                BindableCollection<HistoryItemViewModel> itemsCollection)
            : base(log, scheduler, standardDialog)
        {
            Items = itemsCollection;

            this.SetupHeader(scheduler, "History");

            OpenCommand = new DelegateCommand<HistoryItemViewModel>(x => Open.SafeInvoke(this, new DataEventArgs<long>(x.Id)));
        }
        public DataSourceSelectorViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                                           IDataSourceSelectorService service,
                                           ReactiveSingleSelectCollection<DataSource> dataSourceCollection)
            : base(log, scheduler, standardDialog)
        {
            _service = service;

            Disposables.Add(service);

            DataSources = dataSourceCollection;
        }
Esempio n. 17
0
        public ChartViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                              BindableCollection <HistoricalDataDto> itemsCollection, IChartService service)
            : base(log, scheduler, standardDialog)
        {
            _service = service;
            Disposables.Add(service);

            this.SetupHeader(Scheduler, "Chart");

            Items     = itemsCollection;
            GoCommand = new DelegateCommand(GetData, () => !string.IsNullOrEmpty(Ticker));
        }
Esempio n. 18
0
        public ChartViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                              BindableCollection<HistoricalDataDto> itemsCollection, IChartService service)
            : base(log, scheduler, standardDialog)
        {
            _service = service;
            Disposables.Add(service);

            this.SetupHeader(Scheduler, "Chart");

            Items = itemsCollection;
            GoCommand = new DelegateCommand(GetData, () => !string.IsNullOrEmpty(Ticker));
        }
Esempio n. 19
0
        public DialogViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                               BindableCollection <DialogItemViewModel <T> > answersCollection)
            : base(log, scheduler, standardDialog)
        {
            Answers = answersCollection;

            ExecuteCommand = new DelegateCommand <DialogItemViewModel <T> >(x =>
            {
                SelectedAnswer = x.Response;

                ClosingStrategy.Close();
            });
        }
Esempio n. 20
0
        public QuoteEditViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                                  IQuoteEditService service,
                                  BindableCollection <IToolBarItem> toolBarItemsCollection,
                                  BindableCollection <LookupValue> instrumentsCollection,
                                  Func <ToolBarButtonItem> toolBarButtonItemFactory)
            : base(log, scheduler, standardDialog)
        {
            _service = service;

            ToolBarItems = toolBarItemsCollection;

            CreateToolBar(toolBarButtonItemFactory);

            Instruments = instrumentsCollection;
        }
Esempio n. 21
0
        public QuoteBlotterViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog viewService,
                                     BindableCollection<QuoteBlotterItemViewModel> itemsCollection, IQuoteBlotterService service,
                                     IToolBarService toolBarService)
            : base(log, scheduler, viewService)
        {
            _service = service;

            Items = itemsCollection;

            this.SetupHeader(Scheduler, "Blotter");

            OpenCommand = new DelegateCommand<QuoteBlotterItemViewModel>(x => Open(x));

            CreateToolBar(toolBarService);
        }
Esempio n. 22
0
        public QuoteEditViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                                  IQuoteEditService service,
                                  BindableCollection<IToolBarItem> toolBarItemsCollection,
                                  BindableCollection<LookupValue> instrumentsCollection,
                                  Func<ToolBarButtonItem> toolBarButtonItemFactory)
            : base(log, scheduler, standardDialog)
        {
            _service = service;

            ToolBarItems = toolBarItemsCollection;

            CreateToolBar(toolBarButtonItemFactory);

            Instruments = instrumentsCollection;
        }
Esempio n. 23
0
        protected Workspace(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog)
        {
            _log = log;
            _scheduler = scheduler;
            _standardDialog = standardDialog;

            ClosingStrategy = new ClosingStrategy(log);
            ClosingStrategy.AddDisposable(Disposables);

            ClosingStrategy.Closing
                           .TakeUntil(ClosingStrategy.Closed)
                           .Subscribe(_ =>
                                      {
                                          Closing();

                                          CleanUp();
                                      });

            this.ExecuteOnClosed(() => Disposables.Dispose());

            BusyViewModel = new BusyViewModel(scheduler);
            BusyViewModel.AddDisposable(Disposables);

            ActivationStateViewModel = new ActivationStateViewModel(log, scheduler);
            ActivationStateViewModel.AddDisposable(Disposables);

            ActivationStateViewModel.OnInitialise
                                    .SelectMany(_ => OnInitialise().ToObservable()
                                                                   .TakeUntil(BusyViewModel.BusyLatch))
                                    .TakeUntil(ClosingStrategy.Closed)
                                    .Subscribe(_ => { });

            ActivationStateViewModel.ActivationStateChanged
                                    .ObserveOn(scheduler.Dispatcher.RX)
                                    .Where(isActive => isActive)
                                    .TakeUntil(ClosingStrategy.Closed)
                                    .Subscribe(_ => OnActivate());

            ActivationStateViewModel.ActivationStateChanged
                                    .ObserveOn(scheduler.Dispatcher.RX)
                                    .Where(isActive => !isActive)
                                    .TakeUntil(ClosingStrategy.Closed)
                                    .Subscribe(_ => OnDeActivate());

            Show();
        }
Esempio n. 24
0
        protected Workspace(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog)
        {
            _log            = log;
            _scheduler      = scheduler;
            _standardDialog = standardDialog;

            ClosingStrategy = new ClosingStrategy(log);
            ClosingStrategy.AddDisposable(Disposables);

            ClosingStrategy.Closing
            .TakeUntil(ClosingStrategy.Closed)
            .Subscribe(_ =>
            {
                Closing();

                CleanUp();
            });

            this.ExecuteOnClosed(() => Disposables.Dispose());

            BusyViewModel = new BusyViewModel(scheduler);
            BusyViewModel.AddDisposable(Disposables);

            ActivationStateViewModel = new ActivationStateViewModel(log, scheduler);
            ActivationStateViewModel.AddDisposable(Disposables);

            ActivationStateViewModel.OnInitialise
            .SelectMany(_ => OnInitialise().ToObservable()
                        .TakeUntil(BusyViewModel.BusyLatch))
            .TakeUntil(ClosingStrategy.Closed)
            .Subscribe(_ => { });

            ActivationStateViewModel.ActivationStateChanged
            .ObserveOn(scheduler.Dispatcher.RX)
            .Where(isActive => isActive)
            .TakeUntil(ClosingStrategy.Closed)
            .Subscribe(_ => OnActivate());

            ActivationStateViewModel.ActivationStateChanged
            .ObserveOn(scheduler.Dispatcher.RX)
            .Where(isActive => !isActive)
            .TakeUntil(ClosingStrategy.Closed)
            .Subscribe(_ => OnDeActivate());

            Show();
        }
Esempio n. 25
0
        public ClientEditViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                                   IToolBarService toolBarService, BindableCollection<IToolBarItem> toolBarCollection,
                                   IClientEditService service, ClientModel model, BindableCollection<string> genderCollection)
            : base(log, scheduler, standardDialog)
        {
            _service = service;

            ToolBarItems = toolBarCollection;

            Model = model;
            Model.AddDisposable(Disposables);

            Genders = genderCollection;

            CreateSaveToolBar(toolBarService);
            CreateCancelToolBar(toolBarService);
        }
Esempio n. 26
0
        public ClientEditViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                                   IToolBarService toolBarService, BindableCollection <IToolBarItem> toolBarCollection,
                                   IClientEditService service, ClientModel model, BindableCollection <string> genderCollection)
            : base(log, scheduler, standardDialog)
        {
            _service = service;

            ToolBarItems = toolBarCollection;

            Model = model;
            Model.AddDisposable(Disposables);

            Genders = genderCollection;

            CreateSaveToolBar(toolBarService);
            CreateCancelToolBar(toolBarService);
        }
Esempio n. 27
0
        public ShellViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                              IToolBarService toolBarService, IMenuService menuService, IMessageStream messageStream,
                              IAppearanceViewModel appearanceViewModel,
                              BindableCollection <IViewModel> itemsCollection,
                              BindableCollection <Link> linkCollection,
                              IUserInteraction userInteraction,
                              Func <IUserInteractionHostViewModel> userInteractionHostViewModelFactory)
            : base(log, scheduler, standardDialog)
        {
            _userInteractionHostViewModelFactory = userInteractionHostViewModelFactory;
            ToolBarItems = toolBarService.Items;
            MenuItems    = menuService.Items;
            Items        = itemsCollection;

            TitleLinks = linkCollection;

            TitleLinks.Add(new Link(scheduler)
            {
                DisplayName = "Appearance",
                Command     = new DelegateCommand(() => userInteraction.ShowModalAsync(appearanceViewModel))
            });

            messageStream.Of <IViewModel>()
            .ObserveOn(Scheduler.Dispatcher.RX)
            .Subscribe(x => Items.Add(x));

            userInteraction.RegisterHandler(UserInteractionModalHandler);

            // Dummy menu item to test UserInterations
            var menuGroupItem = menuService.CreateMenuGroupItem();

            menuGroupItem.DisplayName = "Test";

            var menuItem = menuService.CreateMenuButtonItem();

            menuItem.DisplayName = "User Interactions";
            menuItem.Command     = new DelegateCommand(() => standardDialog.InformationAsync("Title", "Message")
                                                       .Do(x =>
            {
            }, Scheduler.Task.TPL));
            menuGroupItem.Items.Add(menuItem);
            menuService.Items.Add(menuGroupItem);
        }
Esempio n. 28
0
        public SearchViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog, ISearchService service,
                               ReactiveSingleSelectCollection<Entity> entityCollection,
                               ReactiveSingleSelectCollection<Dimension> dimensionCollection,
                               BindableCollection<string> logOutputCollection)
            : base(log, scheduler, standardDialog)
        {
            _service = service;

            Disposables.Add(service);

            Entity = entityCollection;
            Dimension = dimensionCollection;
            LogOutput = logOutputCollection;

            EntityEnterCommand = new ObservableCommand();
            DimensionEnterCommand = new ObservableCommand();

            EntitySetup();
            DimensionSetup();
        }
Esempio n. 29
0
        public SearchViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog, ISearchService service,
                               ReactiveSingleSelectCollection <Entity> entityCollection,
                               ReactiveSingleSelectCollection <Dimension> dimensionCollection,
                               BindableCollection <string> logOutputCollection)
            : base(log, scheduler, standardDialog)
        {
            _service = service;

            Disposables.Add(service);

            Entity    = entityCollection;
            Dimension = dimensionCollection;
            LogOutput = logOutputCollection;

            EntityEnterCommand    = new ObservableCommand();
            DimensionEnterCommand = new ObservableCommand();

            EntitySetup();
            DimensionSetup();
        }
Esempio n. 30
0
        protected WizardViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog)
            : base(log, scheduler, standardDialog)
        {
            GoBackCommand = new DelegateCommand(() => GoBack(),
                                                () => CurrentStep.Ordinal > 0);

            GoForwardCommand = new DelegateCommand(() => GoForward(),
                                                   () => CurrentStep.Ordinal < _steps.Count - 1);

            FinishCommand = new DelegateCommand(() => Finish(),
                                                () => _canBeFinished);

            Context.CanBeFinishedChanged
            .TakeUntil(ClosingStrategy.Closed)
            .Subscribe(x =>
            {
                _canBeFinished = true;
                FinishCommand.RaiseCanExecuteChanged();
            });
        }
Esempio n. 31
0
        protected ReportRunnerViewModel(ILog log, IStandardDialog standardDialog, IDispatcherSchedulerProvider scheduler,
                                        IToolBarService toolBarService, TReportParameterViewModel reportParameterViewModel,
                                        TReportRunnerService service, BindableCollection <IViewModel> itemsCollection)
            : base(log, scheduler, standardDialog)
        {
            ToolBarService = toolBarService;
            Service        = service;
            IsExpanded     = true;
            Items          = itemsCollection;

            ParameterViewModel = reportParameterViewModel;
            this.SyncViewModelActivationStates(ParameterViewModel).AddDisposable(Disposables);

            this.SetupHeader(scheduler, "Runner", IconNames.EXCEL);

            ParameterViewModel.GenerateReport
            .TakeUntil(ClosingStrategy.Closed)
            .Subscribe(_ => GenerateReport());

            CreateExportToExcelToolBarItem();
        }
Esempio n. 32
0
        public ShellViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                              IToolBarService toolBarService, IMenuService menuService,
                              BindableCollection <IViewModel> itemsCollection,
                              BindableCollection <Link> lnkCollection,
                              IMessageStream messageStream,
                              IUserInteraction userInteraction,
                              Func <IUserInteractionHostViewModel> userInteractionHostViewModelFactory)
            : base(log, scheduler, standardDialog)
        {
            _userInteractionHostViewModelFactory = userInteractionHostViewModelFactory;
            ToolBarItems = toolBarService.Items;
            MenuItems    = menuService.Items;

            TitleLinks = lnkCollection;
            Items      = itemsCollection;

            messageStream.Of <IViewModel>()
            .ObserveOn(Scheduler.Dispatcher.RX)
            .Subscribe(x => Items.Add(x));

            userInteraction.RegisterHandler(UserInteractionModalHandler);
        }
Esempio n. 33
0
        public DataViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                             IDataService service, BindableCollection <IContextMenuItem> contextMenuCollection,
                             Func <BindableCollection <Dictionary <string, object> > > itemsCollectionFactory,
                             Func <BindableCollection <Column> > columnCollectionFactory,
                             BindableCollection <SelectedCell> selectedCellsCollection)
            : base(log, scheduler, standardDialog)
        {
            _service = service;
            _itemsCollectionFactory  = itemsCollectionFactory;
            _columnCollectionFactory = columnCollectionFactory;

            Disposables.Add(service);

            ContextMenu = contextMenuCollection;

            SelectedCells = selectedCellsCollection;

            SelectedCells.AddedItemsCollectionChanged
            .TakeUntil(ClosingStrategy.Closed)
            .ObserveOn(Scheduler.Dispatcher.RX)
            .Subscribe(cells =>
            {
            });
        }
Esempio n. 34
0
        public QuoteBlotterViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog viewService,
                                     BindableCollection <QuoteBlotterItemViewModel> itemsCollection, IQuoteBlotterService service,
                                     IToolBarService toolBarService)
            : base(log, scheduler, viewService)
        {
            _service = service;

            Items = itemsCollection;

            this.SetupHeader(Scheduler, "Blotter");

            OpenCommand = new DelegateCommand <QuoteBlotterItemViewModel>(x => Open(x));

            CreateToolBar(toolBarService);
        }
Esempio n. 35
0
        public ExplorerViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog, 
                                 IExplorerService service,
                                 DataSourceSelectorViewModel dataSourceSelectorViewModel,
                                 SearchViewModel searchViewModel,
                                 DataViewModel dataViewModel,
                                 FilterViewModel filterViewModel,
                                 PathViewModel pathViewModel,
                                 Func<PathItemViewModel> pathItemViewModelFactory)
            : base(log, scheduler, standardDialog)
        {
            _service = service;
            _pathItemViewModelFactory = pathItemViewModelFactory;

            Disposables.Add(service);

            this.SetupHeader(Scheduler, "Explorer");

            DataSourceSelectorViewModel = dataSourceSelectorViewModel;
            this.SyncViewModelActivationStates(DataSourceSelectorViewModel).AddDisposable(Disposables);
            this.SyncViewModelBusy(DataSourceSelectorViewModel).AddDisposable(Disposables);

            SearchViewModel = searchViewModel;
            this.SyncViewModelActivationStates(SearchViewModel).AddDisposable(Disposables);
            this.SyncViewModelBusy(SearchViewModel).AddDisposable(Disposables);

            DataViewModel = dataViewModel;
            this.SyncViewModelActivationStates(DataViewModel).AddDisposable(Disposables);
            this.SyncViewModelBusy(DataViewModel).AddDisposable(Disposables);

            FilterViewModel = filterViewModel;
            this.SyncViewModelActivationStates(FilterViewModel).AddDisposable(Disposables);
            this.SyncViewModelBusy(FilterViewModel).AddDisposable(Disposables);

            PathViewModel = pathViewModel;
            this.SyncViewModelActivationStates(PathViewModel).AddDisposable(Disposables);
            this.SyncViewModelBusy(PathViewModel).AddDisposable(Disposables);

            // When the selected DataSource changes, keep the Search upto date.
            DataSourceSelectorViewModel.DataSources.SelectedItemChanged
                                       .Where(x => x != null)
                                       .SelectMany(dataSource => SearchViewModel.Reset(dataSource).ToObservable())
                                       .TakeUntil(ClosingStrategy.Closed)
                                       .Subscribe(_ => { });

            // When the selected Dimension changes, create a new root level path node with the correct query.
            SearchViewModel.Dimension.SelectedItemChanged
                           .Where(x => x != null)
                           .TakeUntil(ClosingStrategy.Closed)
                           .ObserveOn(Scheduler.Dispatcher.RX)
                           .Subscribe(_ =>
                                      {
                                          var query = new Query
                                                      {
                                                          DataSource = DataSourceSelectorViewModel.DataSources.SelectedItem,
                                                          Entity = SearchViewModel.Entity.SelectedItem,
                                                          GroupingDimensions = new[] {SearchViewModel.Dimension.SelectedItem},
                                                          ParentQuery = null
                                                      };

                                          var pathItem = _pathItemViewModelFactory();
                                          pathItem.DisplayText = query.GroupingDimensions.First().Name;
                                          pathItem.Query = query;

                                          PathViewModel.Path.Items.Add(pathItem);
                                          PathViewModel.Path.SelectedItem = pathItem;
                                      });

            // When a DrillDownDimensionRequest is recieved, create a new path node under the currectly selected
            // node.
            DataViewModel.DrillDownDimensionRequest
                         .Where(x => x != null)
                         .TakeUntil(ClosingStrategy.Closed)
                         .ObserveOn(Scheduler.Dispatcher.RX)
                         .Subscribe(query =>
                                    {
                                        var pathItem = _pathItemViewModelFactory();
                                        pathItem.DisplayText = query.GroupingDimensions.First().Name;
                                        pathItem.Query = query;

                                        PathViewModel.Path.SelectedItem.AddChild(pathItem);
                                        PathViewModel.Path.SelectedItem = pathItem;
                                    });

            // As the SelectedPathItem changes, keep the Data upto date.
            PathViewModel.Path.SelectedItemChanged
                         .Where(x => x != null)
                         .SelectMany(x => GetData(x.Query))
                         .TakeUntil(ClosingStrategy.Closed)
                         .Subscribe(_ => { });
        }
Esempio n. 36
0
 protected ReportParameterWizardViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog)
     : base(log, scheduler, standardDialog)
 {
 }
Esempio n. 37
0
        public DynamicColumnEditViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog, IDynamicColumnEditService service)
            : base(log, scheduler, standardDialog)
        {
            _service = service;

            Disposables.Add(service);
        }
Esempio n. 38
0
 public StubViewModelWithUseViewAttribute(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog)
     : base(log, scheduler, standardDialog)
 {
 }
Esempio n. 39
0
 public UserInteractionHostViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog)
     : base(log, scheduler, standardDialog)
 {
     _viewModel.ConnectINPCProperty(this, () => ViewModel, scheduler).AddDisposable(Disposables);
     _showClose.ConnectINPCProperty(this, () => ShowClose, scheduler).AddDisposable(Disposables);
 }
Esempio n. 40
0
 public StubViewModelWithUseViewAttribute(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog)
     : base(log, scheduler, standardDialog)
 {
 }
Esempio n. 41
0
 public ReportParameterStepViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                                     IReportParameterStepService service,
                                     BindableCollection <DateTime> datesCollection)
     : base(log, scheduler, standardDialog)
 {
     _service = service;
     Dates    = datesCollection;
 }
        public DynamicColumnManagementViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog, IDynamicColumnManagementService service,
                                                BindableCollection <DynamicColumn> columnsCollection,
                                                BindableCollection <IToolBarItem> toolBarItemsCollection,
                                                Func <DynamicColumnEditViewModel> editViewModelFactory,
                                                IToolBarService toolBarService)
            : base(log, scheduler, standardDialog)
        {
            _service = service;
            _editViewModelFactory = editViewModelFactory;

            Disposables.Add(service);

            Columns = columnsCollection;

            ToolBarItems = toolBarItemsCollection;

            var saveToolBarItem = toolBarService.CreateToolBarButtonItem();

            saveToolBarItem.DisplayName = "Save";
            _saveCommand = new DelegateCommand(() =>
            {
                ClosingStrategy.Close();
            });
            saveToolBarItem.Command = _saveCommand;
            ToolBarItems.Add(saveToolBarItem);

            var cancelToolBarItem = toolBarService.CreateToolBarButtonItem();

            cancelToolBarItem.DisplayName = "Cancel";
            cancelToolBarItem.Command     = ClosingStrategy.CloseCommand;
            ToolBarItems.Add(cancelToolBarItem);
        }
Esempio n. 43
0
 public StubViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog)
     : base(log, scheduler, standardDialog)
 {
 }
Esempio n. 44
0
        public ReportLayoutViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                                     IReportLayoutService service,
                                     BindableCollection <ReportLayoutItemViewModel> availableCollection,
                                     BindableCollection <ReportLayoutItemViewModel> rowsCollection,
                                     BindableCollection <ReportLayoutItemViewModel> columnsCollection,
                                     Func <ReportLayoutItemViewModel> reportLayoutItemViewModelFactory)
            : base(log, scheduler, standardDialog)
        {
            _service = service;
            _reportLayoutItemViewModelFactory = reportLayoutItemViewModelFactory;

            this.SetupHeader(scheduler, "Layout");

            Available = availableCollection;
            Rows      = rowsCollection;
            Columns   = columnsCollection;

            ToRowsDropTarget = new ReportLayoutDropTarget(x => x.Type == AttributeType.Dimension,
                                                          Rows, Available, Columns);

            ToColumnsDropTarget = new ReportLayoutDropTarget(x => x.Type == AttributeType.Measure,
                                                             Columns, Available, Rows);

            ToAvailableDropTarget = new ReportLayoutDropTarget(x => true,
                                                               Available, Columns, Rows);

            OkCommand = new DelegateCommand(ClosingStrategy.Close);
        }
Esempio n. 45
0
 public UserInteractionHostViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog)
     : base(log, scheduler, standardDialog)
 {
     _viewModel.ConnectINPCProperty(this, () => ViewModel, scheduler).AddDisposable(Disposables);
     _showClose.ConnectINPCProperty(this, () => ShowClose, scheduler).AddDisposable(Disposables);
 }
Esempio n. 46
0
 public ReportViewerViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                              IReportViewerService service, IToolBarService toolBarService,
                              HistoryViewModel historyViewModel, BindableCollection <IViewModel> itemsCollection)
     : base(log, scheduler, standardDialog, service, toolBarService, historyViewModel, itemsCollection)
 {
 }
Esempio n. 47
0
 public WorkspaceViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog)
     : base(log, scheduler, standardDialog)
 {
     Disposables.Add(AnonymousDisposable.Create(() => DisposablesWasDisposed.SafeInvoke(this)));
 }
        public ReportParameterStepViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                                            IReportParameterStepService service,
                                            IValidationAsync <ReportParameterStepViewModel, ReportParameterStepValidator> validation,
                                            BindableCollection <DateTime> datesCollection)
            : base(log, scheduler, standardDialog)
        {
            _service = service;

            _validation = validation;
            _validation.Initialise(this);
            _validation.ErrorsChanged
            .TakeUntil(ClosingStrategy.Closed)
            .ObserveOn(Scheduler.Dispatcher.RX)
            .Subscribe(x => ErrorsChanged.SafeInvoke(this, new DataErrorsChangedEventArgs(x)));

            Dates = datesCollection;
        }
Esempio n. 49
0
 public WorkspaceViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog)
     : base(log, scheduler, standardDialog)
 {
     Disposables.Add(AnonymousDisposable.Create(() => DisposablesWasDisposed.SafeInvoke(this)));
 }
Esempio n. 50
0
 public ReportParameterViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog,
                                 Func <ReportParameterStepViewModel> reportParameterStepViewModelFactory)
     : base(log, scheduler, standardDialog)
 {
     _reportParameterStepViewModelFactory = reportParameterStepViewModelFactory;
 }
Esempio n. 51
0
 protected ReportViewModel(ILog log, IStandardDialog standardDialog, IDispatcherSchedulerProvider scheduler,
                           BindableCollection<IViewModel> itemsCollection)
     : base(log, scheduler, standardDialog)
 {
     Items = itemsCollection;
 }
Esempio n. 52
0
 public StubViewModel(ILog log, IDispatcherSchedulerProvider scheduler, IStandardDialog standardDialog)
     : base(log, scheduler, standardDialog)
 {
 }