public DishonourReversalExcelImportViewModel(ReceiptBatchType receiptBatchType, int receiptBatchId)
        {
            batchType = receiptBatchType;
            receiptBatchID = receiptBatchId;

            reasonCodes = DishonourReversalFunctions.GetReasonCodes(batchType);

            Browse = new DelegateCommand(OnBrowse);
            Upload = new DelegateCommand(OnUpload);
            Save = new DelegateCommand(OnSave);
            Delete = new DelegateCommand(OnDelete);
            OpenExcelTemplate = new DelegateCommand(OnOpenExcelTemplate);

            Title = batchType.ToString() + " Receipts Excel Import";
            IconFileName = "Excel.jpg";
            UIConfirmation = new InteractionRequest<ConfirmationWindowViewModel>();

            if (batchType == ReceiptBatchType.Dishonour)
            {
                excelTemplateFileName = "DishonourReceiptImportTemplate.xlsx";
            }
            else
            {
                excelTemplateFileName = "ReversalReceiptImportTemplate.xlsx";
            }
        }
 /// <summary>
 /// Performs initialization of commands and requests.
 /// </summary>
 private void InitializeCommandsAndRequests()
 {
     ConfirmCommand = new DelegateCommand(DoConfirm, CanConfirm);
     CancelCommand = new DelegateCommand(DoCancel, CanCancel);
     ConfirmationRequest = new InteractionRequest<Notification>();
     CancellationRequest = new InteractionRequest<Notification>();
 }
		public BuildSettingsViewModel(IBuildSettingsRepository repository)
		{
			_repository = repository;

			ItemRebuildCommand = new DelegateCommand<BuildSettings>(RaiseItemRebuildInteractionRequest, x => x != null);
			CommonConfirmRequest = new InteractionRequest<Confirmation>();
		}
예제 #4
0
        public LoadProjectService(IProjectSerializer ProjectSerializer, ProjectViewModelFactory ProjectViewModelFactory)
        {
            _projectSerializer = ProjectSerializer;
            _projectViewModelFactory = ProjectViewModelFactory;

            OpenFileRequest = new InteractionRequest<OpenFileInteractionContext>();
        }
        public TaskCollectionsViewModel(
            INavigationService navigationService,
            IRtmServiceClient rtmServiceClient,
            ITaskStoreLocator taskStoreLocator,
            IListStoreLocator listStoreLocator,
            ILocationStoreLocator locationStoreLocator,
            ISynchronizationService synchronizationService)
            : base(navigationService)
        {
            this._rtmServiceClient = rtmServiceClient;
            this._taskStoreLocator = taskStoreLocator;
            this._listStoreLocator = listStoreLocator;
            this._locationStoreLocator = locationStoreLocator;
            this._synchronizationService = synchronizationService;

            this.submitErrorInteractionRequest = new InteractionRequest<Notification>();
            this.submitNotificationInteractionRequest = new InteractionRequest<Notification>();

            this.StartSyncCommand = new DelegateCommand(
                () => { this.StartSync(); },
                () => !this.IsSyncing && !this.SettingAreNotConfigured);

            this.ViewTaskCollectionCommand = new DelegateCommand(
                () => { this.NavigationService.Navigate(new Uri("/Views/TaskCollectionView.xaml", UriKind.Relative)); },
                () => !this.IsSyncing);

            this.AppSettingsCommand = new DelegateCommand(
                () => { this.NavigationService.Navigate(new Uri("/Views/AppSettingsView.xaml", UriKind.Relative)); },
                () => !this.IsSyncing);

            this.IsBeingActivated();
        }
        public MultipleReversalReAllocationViewModel(int batchID, int reason, List<DishonourReversalReceiptSummary> receipts)
        {
            receiptBatchID = batchID;
            reasonSelected = reason;
            reversalReceipts = receipts;

            try
            {
                SetReceiptDefaults(receiptBatchID);

                Save = new DelegateCommand<string>(OnSave);
                ReAllocationSearch = new DelegateCommand(OnReAllocationSearch);

                Popup = new InteractionRequest<PopupWindow>();
                UIConfirmation = new InteractionRequest<ConfirmationWindowViewModel>();
                IconFileName = "ReAllocation.jpg";
            }
            catch (Exception ex)
            {
                ExceptionLogger.WriteLog(ex);
                ShowErrorMessage("Error occurred while initializing Reversal Receipts Re-Allocation Screen", "Receipt Reallocation - Error");
            }
            finally
            {
                IsBusy = false;
            }
        }
        public PropertyViewModel(IViewModelsFactory<IPropertyValueViewModel> propertyValueVmFactory, IViewModelsFactory<IPropertyAttributeViewModel> attributeVmFactory, ICatalogEntityFactory entityFactory, Property item, catalogModel.Catalog parentCatalog, IRepositoryFactory<ICatalogRepository> repositoryFactory, ObservableCollection<Property> properties)
        {
            InnerItem = item;
            _propertyValueVmFactory = propertyValueVmFactory;
            _attributeVmFactory = attributeVmFactory;
            _entityFactory = entityFactory;
            _properties = properties;
            ParentCatalog = parentCatalog;
            // _repositoryFactory = repositoryFactory;

            ValueAddCommand = new DelegateCommand(RaiseValueAddInteractionRequest);
            ValueEditCommand = new DelegateCommand<PropertyValueBase>(RaiseValueEditInteractionRequest, x => x != null);
            ValueDeleteCommand = new DelegateCommand<PropertyValueBase>(RaiseValueDeleteInteractionRequest, x => x != null);

            AttributeAddCommand = new DelegateCommand(RaiseAttributeAddInteractionRequest);
            AttributeEditCommand = new DelegateCommand<PropertyAttribute>(RaiseAttributeEditInteractionRequest, x => x != null);
            AttributeDeleteCommand = new DelegateCommand<PropertyAttribute>(RaiseAttributeDeleteInteractionRequest, x => x != null);


            CommonConfirmRequest = new InteractionRequest<Confirmation>();

            var allValueTypes = (PropertyValueType[])Enum.GetValues(typeof(PropertyValueType));
            PropertyTypes = new List<PropertyValueType>(allValueTypes);
            PropertyTypes.Sort((x, y) => x.ToString().CompareTo(y.ToString()));
        }
        public RegionWithPopupWindowActionExtensionsViewModel( Model model )
        {
            Model = model;

            ShowConfirmationCommand = new DelegateCommand( OnShowConfirmation );
            ConfirmationRequest = new InteractionRequest<INotification>();
        }
예제 #9
0
        public EditViewModel( IDataService dataService )
        {
            _dataService = dataService;

            // Initialize the Navigation Interaction Request .
            navigationInteractionRequest = new InteractionRequest<Confirmation>();
        }
예제 #10
0
        public ClientViewModel(
            IAsyncRequestDispatcherFactory asyncRequestDispatcherFactory,
            IDialogService dialogService,
            IAddClientViewModel addClientViewModel,
            IAddPositionViewModel addPositionViewModel,
            IAddIndustryViewModel addIndustryViewModel)
        {
            _asyncRequestDispatcherFactory = asyncRequestDispatcherFactory;
            _dialogService = dialogService;
            _addClientViewModel = addClientViewModel;
            _addPositionViewModel = addPositionViewModel;
            _addIndustryViewModel = addIndustryViewModel;

            _addClientRequest = new InteractionRequest<ResponseNotification>();
            _addPositionRequest = new InteractionRequest<ResponseNotification>();
            _addIndustryRequest = new InteractionRequest<ResponseNotification>();

            AddClientCommand = new DelegateCommand(AddClient);
            RemoveClientCommand = new DelegateCommand(RemoveClient);
            AddPositionCommand = new DelegateCommand(AddPosition);
            RemovePositionCommand = new DelegateCommand(RemovePosition);
            AddIndustryCommand = new DelegateCommand(AddIndustry);
            RemoveIndustryCommand = new DelegateCommand(RemoveIndustry);
            EditClientCommand = new DelegateCommand<ClientModel>(EditClient);
        }
 public ExchangeAddViewModel(IEventAggregator eventAggregator, IMdmService entityService)
 {
     this.eventAggregator = eventAggregator;
     this.confirmationFromViewModelInteractionRequest = new InteractionRequest<Confirmation>();
     this.entityService = entityService;
     this.Exchange = new ExchangeViewModel(this.eventAggregator);
 }
		public PickAssetViewModel(IAssetService assetRepository,
			IViewModelsFactory<IInputNameDialogViewModel> inputNameVmFactory)
		{
			_assetRepository = assetRepository;
			_inputNameVmFactory = inputNameVmFactory;

			AddressBarItems = new ObservableCollection<AssetEntitySearchViewModelBase>();
			SelectedFolderItems = new ObservableCollection<AssetEntitySearchViewModelBase>();

			CommonNotifyRequest = new InteractionRequest<Notification>();

			OpenItemCommand = new DelegateCommand<object>(RaiseOpenItemRequest);
			RefreshCommand = new DelegateCommand(LoadItems);
			UploadCommand = new DelegateCommand(RaiseUploadRequest, () => ParentItem.Type == AssetType.Container || ParentItem.Type == AssetType.Folder);
			CreateFolderCommand = new DelegateCommand(RaiseCreateFolderRequest);
			RenameCommand = new DelegateCommand(RaiseRenameRequest);
			DeleteCommand = new DelegateCommand(RaiseDeleteRequest);
			ParentItem = new RootSearchViewModel(null);
			CommonConfirmRequest = new InteractionRequest<Confirmation>();

			InputNameDialogRequest = new InteractionRequest<ConditionalConfirmation>();

			AssetPickMode = true;
			RootItemId = null;
		}
		public MainFulfillmentViewModel(
			IInventoryHomeViewModel inventoryVm, 
			IPicklistHomeViewModel picklistVm, 
			IRmaHomeViewModel rmaVm, 
			IViewModelsFactory<ICompleteShipmentViewModel> completeShipmentVmFactory,
			IRepositoryFactory<IOrderRepository> orderRepositoryFactory,
			IOrderService orderService,
			IAuthenticationContext authContext)
        {
            ViewTitle = new ViewTitleBase { Title = "Fulfillment", SubTitle = "FULFILLMENT SERVICE" };
			_inventoryHomeVm = inventoryVm;
			_inventoryHomeVm.ParentViewModel = this;
			
			_picklistHomeVm = picklistVm;
			_picklistHomeVm.ParentViewModel = this;

			_rmaHomeVm = rmaVm;
			_rmaHomeVm.ParentViewModel = this;

			_completeShipmentVmFactory = completeShipmentVmFactory;
			_orderRepositoryFactory = orderRepositoryFactory;
			_authContext = authContext;

			_orderService = orderService;

			PopulateTabItems();
			CompleteShipmentCommand = new DelegateCommand(RaiseCompleteShipment);
			CommonConfirmRequest = new InteractionRequest<Confirmation>();
			CommonNotifyRequest = new InteractionRequest<Notification>();
        }
예제 #14
0
        public MainWindow(
            IAudioService audioService,
            IDictionaryService dictionaryService,
            IInputService inputService)
        {
            InitializeComponent();

            this.audioService = audioService;
            this.dictionaryService = dictionaryService;
            this.inputService = inputService;

            managementWindowRequest = new InteractionRequest<NotificationWithServices>();

            //Setup key binding (Alt-C and Shift-Alt-C) to open settings
            InputBindings.Add(new KeyBinding
            {
                Command = new DelegateCommand(RequestManagementWindow),
                Modifiers = ModifierKeys.Alt,
                Key = Key.M
            });
            InputBindings.Add(new KeyBinding
            {
                Command = new DelegateCommand(RequestManagementWindow),
                Modifiers = ModifierKeys.Shift | ModifierKeys.Alt,
                Key = Key.M
            });

            Title = string.Format(Properties.Resources.WINDOW_TITLE, DiagnosticInfo.AssemblyVersion);
        }
 public BrokerAddViewModel(IEventAggregator eventAggregator, IMdmService entityService)
 {
     this.eventAggregator = eventAggregator;
     this.confirmationFromViewModelInteractionRequest = new InteractionRequest<Confirmation>();
     this.entityService = entityService;
     this.Broker = new BrokerViewModel(this.eventAggregator);
 }
        public RegionOnPopupWindowContentControlViewModel( Model model )
        {
            Model = model;

            ShowConfirmationCommand = new DelegateCommand( OnShowConfirmation );
            ConfirmationRequest = new InteractionRequest<INotification>();
        }
		private void Initialize()
		{
			CancelCommand = new DelegateCommand<object>(x => Cancel(), x => !_cancelled || IsValid);
			CancelConfirmRequest = new InteractionRequest<Confirmation>();

			InitStepsAndViewTitle();
		}
예제 #18
0
        public CategoriesViewModel(Client client)
        {
            _client = client;

            Categories = new ObservableCollection<Category>(
                _client.Context.Categories.ToList());

            AddNewCategoryRequest = new InteractionRequest<IConfirmation>();
            AddCategoryCommand = new DelegateCommand(() =>
                AddNewCategoryRequest.Raise(
                    new Confirmation()
                    {
                        Title = "Nowa kategoria",
                        Content = new System.Windows.Controls.TextBox()
                        {
                            VerticalAlignment = System.Windows.VerticalAlignment.Top
                        }
                    },
                    AddCategory));
            ConfirmDeleteCategoryRequest = new InteractionRequest<IConfirmation>();
            DeleteCategoryCommand = new DelegateCommand(() =>
                ConfirmDeleteCategoryRequest.Raise(
                    new Confirmation()
                    {
                        Title = "Potwierdź",
                        Content = "Czy na pewno usunąć wybraną kategorię?"
                    },
                    DeleteCategory)
                , CanDeleteCategory);
        }
예제 #19
0
        public AddReceiptsViewModel(int receiptbatchType, int batchID)
        {
            BatchType batch;

            try
            {
                batchType = receiptbatchType;
                ReceiptBatch = ReceiptBatchFunctions.Get(batchID);
                ReceiptDate = ReceiptBatch.ReceiptDate;

                Save = new DelegateCommand(OnSave);
                SearchCommand = new DelegateCommand(OnSearch);
                ReceiptSelectedCommand = new DelegateCommand<ObservableCollection<object>>(ReceiptSelected);

                UIConfirmation = new InteractionRequest<ConfirmationWindowViewModel>();
                Popup = new InteractionRequest<PopupWindow>();
                SelectList = BatchTypeFunctions.GetSelectList(batchType);
                SetReceiptBatchDefaults();

                IconFileName = "AddMultiple.jpg";
            }
            catch (Exception ex)
            {
                ExceptionLogger.WriteLog(ex);
                ShowErrorMessage("Error encountered while initializing Add Receipts.", "Add Receipts - Error");
            }
            finally
            {
                IsBusy = false;
            }
        }
예제 #20
0
        public FilesViewModel(IFilesRepository filesRepository, IAuthStore authStore, IProductsRepository productsRepository, 
            Func<CreateFileViewModel> createFactory, Func<EditFileViewModel> editFactory)
        {
            this.filesRepository = filesRepository;
            this.productsRepository = productsRepository;
            this.createFactory = createFactory;
            this.editFactory = editFactory;

            var token = authStore.LoadToken();
            if (token != null)
            {
                IsEditor = token.IsEditor();
                IsAdmin = token.IsAdmin();
            }

            cvs = new CollectionViewSource();
            items = new ObservableCollection<FileDescription>();
            cvs.Source = items;
            cvs.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
            cvs.SortDescriptions.Add(new SortDescription("Id", ListSortDirection.Ascending));

            editRequest = new InteractionRequest<IConfirmation>();
            BrowseCommand = new DelegateCommand(Browse);
            EditCommand = new DelegateCommand<FileDescription>(Edit);

            deleteCommand = new DelegateCommand(PromtDelete, HasSelectedItems);
            deleteRequest = new InteractionRequest<Confirmation>();
        }
        public PropertyValueBaseViewModel(IViewModelsFactory<IPickAssetViewModel> vmFactory, PropertyAndPropertyValueBase item, string locale)
        {
            InnerItem = item;
            _vmFactory = vmFactory;
            _locale = locale;

            if (InnerItem.IsEnum)
            {
                if (InnerItem.IsMultiValue)
                {
                    foreach (var value in InnerItem.Values)
                    {
                        var propertyValue = InnerItem.Property.PropertyValues.FirstOrDefault(x => x.PropertyValueId == value.KeyValue);
                        if (propertyValue != null)
                        {
                            value.BooleanValue = propertyValue.BooleanValue;
                            value.DateTimeValue = propertyValue.DateTimeValue;
                            value.DecimalValue = propertyValue.DecimalValue;
                            value.IntegerValue = propertyValue.IntegerValue;
                            value.LongTextValue = propertyValue.LongTextValue;
                            value.ShortTextValue = propertyValue.ShortTextValue;
                            value.KeyValue = propertyValue.PropertyValueId;
                        }
                    }
                }

                var defaultView = CollectionViewSource.GetDefaultView(InnerItem.Property.PropertyValues);
                defaultView.Filter = FilterPropertyValues;
            }

            SetVisibility();
            AssetPickCommand = new DelegateCommand(RaiseAssetPickInteractionRequest);
            AssetRemoveCommand = new DelegateCommand(RaiseAssetRemoveInteractionRequest);
            CommonConfirmRequest = new InteractionRequest<Confirmation>();
        }
예제 #22
0
        public MainViewModel(IEventAggregator eventAggregator, ISignalRClient signalRClient, IAuthStore authStore,
            IProductsRepository productsRepository)
        {
            this.eventAggregator = eventAggregator;
            this.signalRClient = signalRClient;
            this.productsRepository = productsRepository;

            deleteRequest = new InteractionRequest<Confirmation>();
            CreateProductCommand = new DelegateCommand(CreateProduct);
            OpenProductCommand = new DelegateCommand<Product>(EditProduct);
            changePriceCommand = new DelegateCommand(ChangePrice, HasSelectedProducts);
            deleteCommand = new DelegateCommand(PromtDelete, HasSelectedProducts);

            cvs = new CollectionViewSource();
            items = new ObservableCollection<Product>();
            cvs.Source = items;
            cvs.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
            cvs.SortDescriptions.Add(new SortDescription("Size", ListSortDirection.Ascending));

            var token = authStore.LoadToken();
            if (token != null)
            {
                IsEditor = token.IsEditor();
                IsAdmin = token.IsAdmin();
            }
        }
예제 #23
0
        public ChatViewModel(IChatService chatService)
        {
            _contacts = new ObservableCollection<Contact>();
            _contactsView = new CollectionView(_contacts);
            _sendMessageRequest = new InteractionRequest<SendMessageViewModel>();
            _showReceivedMessageRequest = new InteractionRequest<ReceivedMessage>();
            _showDetailsCommand = new ShowDetailsCommandImplementation(this);

            _contactsView.CurrentChanged += OnCurrentContactChanged;

            _chatService = chatService;
            _chatService.Connected = true;
            _chatService.ConnectionStatusChanged += (s, e) => RaisePropertyChanged(() => CurrentConnectionState);
            _chatService.MessageReceived += OnMessageReceived;

            _chatService.GetContacts(
                result =>
                    {
                        if (result.Error != null) return;
                        foreach (var item in result.Result)
                        {
                            _contacts.Add(item);
                        }
                    });
            RaisePropertyChanged(() => CurrentConnectionState);
        }
		public PropertyEditViewModel(
			IViewModelsFactory<IPickAssetViewModel> pickAssetVmFactory,
			IViewModelsFactory<ISearchCategoryViewModel> searchCategoryVmFactory,
			DynamicContentItemProperty item)
		{
			_pickAssetVmFactory = pickAssetVmFactory;
			_searchCategoryVmFactory = searchCategoryVmFactory;

			InnerItem = item;

			var itemValueType = (PropertyValueType)InnerItem.ValueType;
			IsShortStringValue = itemValueType == PropertyValueType.ShortString;
			IsLongStringValue = itemValueType == PropertyValueType.LongString;
			IsDecimalValue = itemValueType == PropertyValueType.Decimal;
			IsIntegerValue = itemValueType == PropertyValueType.Integer;
			IsBooleanValue = itemValueType == PropertyValueType.Boolean;
			IsDateTimeValue = itemValueType == PropertyValueType.DateTime;
			IsAssetValue = itemValueType == PropertyValueType.Image;
			IsCategoryValue = itemValueType == PropertyValueType.Category;

			if (IsAssetValue)
				SelectedAssetDisplayName = InnerItem.LongTextValue;

			if (IsCategoryValue)
				SelectedCategoryName = InnerItem.Alias;

			AssetPickCommand = new DelegateCommand(RaiseItemPickInteractionRequest);
			CategoryPickCommand = new DelegateCommand(RaiseCategoryPickInteractionRequest);
			CommonConfirmRequest = new InteractionRequest<Confirmation>();
		}
        public ComplexCustomViewViewModel( Model model )
        {
            Model = model;

            ShowConfirmationCommand = new DelegateCommand( OnShowConfirmation );
            ConfirmationRequest = new InteractionRequest<INotification>();
        }
예제 #26
0
        public ChatViewModel(IChatService chatService)
        {
            this.contacts = new ObservableCollection<Contact>();
            this.contactsView = new CollectionView(this.contacts);
            this.sendMessageRequest = new InteractionRequest<SendMessageViewModel>();
            this.showReceivedMessageRequest = new InteractionRequest<ReceivedMessage>();
            this.showDetailsCommand = new DelegateCommand<bool?>(this.ExecuteShowDetails, this.CanExecuteShowDetails);

            this.contactsView.CurrentChanged += this.OnCurrentContactChanged;

            this.chatService = chatService;
            this.chatService.Connected = true;
            this.chatService.ConnectionStatusChanged += (s, e) => this.OnPropertyChanged(() => this.ConnectionStatus);
            this.chatService.MessageReceived += this.OnMessageReceived;

            this.chatService.GetContacts(
                result =>
                {
                    if (result.Error == null)
                    {
                        foreach (var item in result.Result)
                        {
                            this.contacts.Add(item);
                        }
                    }
                });
        }
예제 #27
0
        public MainViewModel()
        {
            LaunchPopupCommand = new DelegateCommand(ExecuteLaunchPopupCommand, CanExecuteLaunchPopupCommand);
            LaunchPopupRequest = new InteractionRequest<Confirmation>();

            
        }
 public ReferenceDataAddViewModel(IEventAggregator eventAggregator, IReferenceDataService entityService)
 {
     this.eventAggregator = eventAggregator;
     this.confirmationFromViewModelInteractionRequest = new InteractionRequest<Confirmation>();
     this.entityService = entityService;
     this.ReferenceData = new ReferenceDataViewModel(null, null, this.eventAggregator);
 }
		private void CommandsInit()
		{
			AddLabelCommand = new DelegateCommand(RaiseAddLabelRequest);
			EditLabelCommand = new DelegateCommand<Label>(RaiseEditLabelRequest, l => l != null);
			DeleteLabelCommand = new DelegateCommand<Label>(RaiseDeleteLabelRequest, l => l != null);

			CommonConfirmRequest = new InteractionRequest<Confirmation>();
		}
예제 #30
0
        public PackageSavingService(ILaunchParameters LaunchParameters, IPackageSavingTool SavingTool, IVariablesProcessor VariablesProcessor)
        {
            _launchParameters = LaunchParameters;
            _savingTool = SavingTool;
            _variablesProcessor = VariablesProcessor;

            SaveFileRequest = new InteractionRequest<SaveFileInteractionContext>();
        }
예제 #31
0
        public void WhenAssociatedObjectIsReloaded_ShouldReactToEventBeingRaisedAgain()
        {
            InteractionRequest <INotification> request = new InteractionRequest <INotification>();
            TestableInteractionRequestTrigger  trigger = new TestableInteractionRequestTrigger();
            MockFrameworkElement associatedObject      = new MockFrameworkElement();

            trigger.Attach(associatedObject);
            trigger.SourceObject = request;

            Assert.IsTrue(trigger.ExecutionCount == 0);

            request.Raise(new Notification());
            Assert.IsTrue(trigger.ExecutionCount == 1);

            associatedObject.RaiseUnloaded();
            request.Raise(new Notification());
            Assert.IsTrue(trigger.ExecutionCount == 1);

            associatedObject.RaiseLoaded();
            request.Raise(new Notification());
            Assert.IsTrue(trigger.ExecutionCount == 2);
        }
예제 #32
0
        public MainViewModel(
            IAudioService audioService,
            ICalibrationService calibrationService,
            IDictionaryService dictionaryService,
            IKeyStateService keyStateService,
            ISuggestionStateService suggestionService,
            ICapturingStateManager capturingStateManager,
            ILastMouseActionStateManager lastMouseActionStateManager,
            IInputService inputService,
            IKeyboardOutputService keyboardOutputService,
            IMouseOutputService mouseOutputService,
            IWindowManipulationService mainWindowManipulationService,
            List <INotifyErrors> errorNotifyingServices)
        {
            this.audioService                  = audioService;
            this.calibrationService            = calibrationService;
            this.dictionaryService             = dictionaryService;
            this.keyStateService               = keyStateService;
            this.suggestionService             = suggestionService;
            this.capturingStateManager         = capturingStateManager;
            this.lastMouseActionStateManager   = lastMouseActionStateManager;
            this.inputService                  = inputService;
            this.keyboardOutputService         = keyboardOutputService;
            this.mouseOutputService            = mouseOutputService;
            this.mainWindowManipulationService = mainWindowManipulationService;
            this.errorNotifyingServices        = errorNotifyingServices;

            calibrateRequest = new InteractionRequest <NotificationWithCalibrationResult>();
            SelectionMode    = SelectionModes.Key;

            this.translationService = new TranslationService(new HttpClient());

            SetupInputServiceEventHandlers();
            InitialiseKeyboard(mainWindowManipulationService);
            AttachScratchpadEnabledListener();
            AttachKeyboardSupportsCollapsedDockListener(mainWindowManipulationService);
            AttachKeyboardSupportsSimulateKeyStrokesListener();
            AttachKeyboardSupportsMultiKeySelectionListener();
        }
예제 #33
0
        private void RegisterInteractionRequestPerThread(Container container)
        {
            var threadMapping = new Dictionary <Thread, IInteractionRequest>();

            container.Register <IInteractionRequest>(() =>
            {
                var thread = Thread.CurrentThread;
                if (threadMapping.ContainsKey(thread))
                {
                    return(threadMapping[thread]);
                }

                var interactionRequest = new InteractionRequest();
                threadMapping[thread]  = interactionRequest;

                return(interactionRequest);
                //using (ThreadScopedLifestyle.BeginScope(container))
                //{
                //    return container.GetInstance<IInteractionRequest>();
                //}
            });
        }
예제 #34
0
        public UploadWizardContext(IExporter exporter,
                                   ILogManager logManager,
                                   ISettingsStore settingsStore,
                                   IDateUtils dateUtils,
                                   ILogger logger)
        {
            _exporter                   = exporter;
            _logManager                 = logManager;
            _settingsStore              = settingsStore;
            _dateUtils                  = dateUtils;
            _logger                     = logger;
            _errorNotificationRequest   = new InteractionRequest <Notification>();
            _successNotificationRequest = new InteractionRequest <Notification>();
            _exportWorker               = new BackgroundWorker {
                WorkerSupportsCancellation = false, WorkerReportsProgress = true
            };
            _exportWorker.DoWork             += OnExport;
            _exportWorker.ProgressChanged    += OnProgressChanged;
            _exportWorker.RunWorkerCompleted += OnExportCompleted;

            UserProfileSettings = _settingsStore.GetSettings <UserProfileSettings>();
        }
예제 #35
0
        public GanttChartManagerViewModel(
            ICoreViewModel coreViewModel,
            IMapper mapper,
            IEventAggregator eventService)
            : base(eventService)
        {
            m_Lock          = new object();
            m_CoreViewModel = coreViewModel ?? throw new ArgumentNullException(nameof(coreViewModel));
            m_Mapper        = mapper ?? throw new ArgumentNullException(nameof(mapper));
            m_EventService  = eventService ?? throw new ArgumentNullException(nameof(eventService));

            m_NotificationInteractionRequest = new InteractionRequest <Notification>();

            InitializeCommands();
            SubscribeToEvents();

            SubscribePropertyChanged(m_CoreViewModel, nameof(m_CoreViewModel.ProjectStart), nameof(ProjectStart), ThreadOption.BackgroundThread);
            SubscribePropertyChanged(m_CoreViewModel, nameof(m_CoreViewModel.IsBusy), nameof(IsBusy), ThreadOption.BackgroundThread);
            SubscribePropertyChanged(m_CoreViewModel, nameof(m_CoreViewModel.HasStaleOutputs), nameof(HasStaleGanttChart), ThreadOption.BackgroundThread);
            SubscribePropertyChanged(m_CoreViewModel, nameof(m_CoreViewModel.HasCompilationErrors), nameof(HasCompilationErrors), ThreadOption.BackgroundThread);
            SubscribePropertyChanged(m_CoreViewModel, nameof(m_CoreViewModel.UseBusinessDays), nameof(UseBusinessDays), ThreadOption.BackgroundThread);
        }
예제 #36
0
    public StartupViewModel(IMessenger messenger) : base(messenger)
    {
        //ApplicationContext context = Context.GetApplicationContext();

        this.dismissRequest = new InteractionRequest(this);
        //this.wheelRequest = new InteractionRequest<CardBagViewModel>(this);

        //var cardDrawViewModel = new CardBagViewModel();

        this.idleRequest = new InteractionRequest(this);

        this.command = new SimpleCommand(() => {
            this.command.Enabled = false;
            //dismissRequest.Raise();
            //ISession session = context.GetService<ISession>();
            //session.Connect("127.0.0.1", 10001);

            //this.wheelRequest.Raise(cardDrawViewModel);
            //this.dismissRequest.Raise();
            this.idleRequest.Raise();
        });
    }
예제 #37
0
        public AbilityEditorViewModel(
            IEventAggregator eventAggregator,
            IObservableDataFactory observableDataFactory,
            IModuleDataService moduleDataService)
        {
            _eventAggregator       = eventAggregator;
            _observableDataFactory = observableDataFactory;
            _moduleDataService     = moduleDataService;

            NewCommand    = new DelegateCommand(New);
            DeleteCommand = new DelegateCommand(Delete);

            Abilities = new ObservableCollectionEx <AbilityDataObservable>();
            Scripts   = new Dictionary <string, ScriptDataObservable>();

            ConfirmDeleteRequest           = new InteractionRequest <IConfirmation>();
            Abilities.ItemPropertyChanged += AbilitiesOnItemPropertyChanged;

            _eventAggregator.GetEvent <ModuleLoadedEvent>().Subscribe(ModuleLoaded);
            _eventAggregator.GetEvent <DataEditorClosedEvent>().Subscribe(DataEditorClosed);
            _eventAggregator.GetEvent <ModuleClosedEvent>().Subscribe(ModuleClosed);
        }
        public TaskEditModel(ITaskRemoteService service, IEventAggregator eventAggregator, [Named("WpfClientMapper")] IMapper mapper)
        {
            this._service         = service;
            this._eventAggregator = eventAggregator;
            this._mapper          = mapper;
            this.EditMode         = false;
            this._originalTask    = null;
            this._users           = new ObservableCollection <User>();

            TaskEditStartedEvent taskEditStartEvent = eventAggregator.GetEvent <TaskEditStartedEvent>();

            taskEditStartEvent.Subscribe(StartEdit, ThreadOption.UIThread, false, t => t == Task);
            taskEditStartEvent.Subscribe(OnCancelExecute, ThreadOption.UIThread, false, t => t != Task);
            CategoryEditStartedEvent categoryEditEvent = eventAggregator.GetEvent <CategoryEditStartedEvent>();

            categoryEditEvent.Subscribe(OnCancelExecute);

            OkCommand               = new AwaitableDelegateCommand(OnOkExecute);
            CancelCommand           = new DelegateCommand(OnCancelExecute);
            DeleteCommand           = new DelegateCommand(OnDeleteExecute);
            this.DeleteConfirmation = new InteractionRequest <IConfirmation>();
        }
        private void Init()
        {
            SelectCommand              = new RelayCommand(SelectBoardRange);
            ClearCommand               = new RelayCommand(Clear);
            CalculateEquityCommand     = new RelayCommand((Action <object>)CalculateEquity);
            ExportDataCommand          = new RelayCommand(ExportData);
            ResetAllCommand            = new RelayCommand(ResetAll);
            RangeCommand               = new RelayCommand(SelectPlayerRange);
            CalculateBluffCommand      = new RelayCommand(CalculateBluff);
            ShowStreetCardsCommand     = new RelayCommand(ShowStreetCards);
            SetAutoRangeForHeroCommand = new RelayCommand(SetAutoRangeForHero);

            CardSelectorRequest   = new InteractionRequest <CardSelectorNotification>();
            CalculateBluffRequest = new InteractionRequest <CalculateBluffNotification>();
            ExportRequest         = new InteractionRequest <ExportNotification>();

            InitPlayersList();

            _board.PropertyChanged += (s, e) =>
            {
                if (e.PropertyName == nameof(BoardModel.Cards))
                {
                    // need to set new cards for each player model
                    PlayersList?.ForEach(x =>
                    {
                        x.Ranges
                        .OfType <EquityRangeSelectorItemViewModel>()
                        .ForEach(r => r.UsedCards = _board.Cards);

                        x.UpdateEquityData();

                        x.CheckBluffToValueBetRatio(CountOpponents(), SelectedStreet);
                    });
                }
            };

            ServiceLocator.Current.GetInstance <IEventAggregator>().GetEvent <RequestEquityCalculatorEvent>().Subscribe(LoadData);
            ServiceLocator.Current.GetInstance <IEventAggregator>().GetEvent <EquityCalculatorRangeRemovedEvent>().Subscribe(RangeRemoved);
        }
예제 #40
0
        public PackagingGraphBuilderViewModel(IPresentationCreationService presentationCreationService, IStatusMessageService statusMessageService, PackageAnalysisClient analysisClient)
        {
            myPresentationCreationService = presentationCreationService;
            myStatusMessageService        = statusMessageService;
            myAnalysisClient = analysisClient;

            Document          = new TextDocument();
            Document.Changed += Document_Changed;

            Packages = new ObservableCollection <string>();

            CreateGraphCommand = new DelegateCommand(OnCreateGraph, () => IsReady && Packages.Count > 0);
            CancelCommand      = new DelegateCommand(OnCancel, () => !IsReady);

            ClosedCommand = new DelegateCommand(OnClosed);

            OpenCommand     = new DelegateCommand(OnOpen, () => IsReady);
            OpenFileRequest = new InteractionRequest <OpenFileDialogNotification>();

            myCompletionData = GetType().Assembly.GetTypes()
                               .Where(t => t.Namespace == typeof(SystemPackaging).Namespace)
                               .Where(t => !t.IsAbstract)
                               .Where(t => t.GetCustomAttribute(typeof(CompilerGeneratedAttribute), true) == null)
                               .Select(t => new ElementCompletionData(t))
                               .ToList();

            UsedTypesOnly = true;

            myGraphToSpecSynchronizer = new GraphToSpecSynchronizer(
                () => SpecUtils.Deserialize(Document.Text),
                spec =>
            {
                Document.Text = SpecUtils.Serialize(spec);
                Save();
            });

            IsReady = true;
        }
예제 #41
0
        /*
         * InteractionRequest es la manera que tiene la ui de avisarnos que existe un pedido del
         * usuario para por ejemplo mostrar unn dialogo
         * En este caso el tipo T es IConfirmation porque tengo que decir si acepto o no la ejecucion
         *
         * Para cada interaccion CASI SIEMPRE tambien tenemos que poner un comando
         */

        public MainWindowViewModel()
        {
            DisplayLogin = new InteractionRequest <INotification>();

            Login = new RelayCommand(() =>
            {
                DisplayLogin.Raise(new Notification()
                {
                    Title = "Ingreso al sistema"
                }, LoginTerminado);
            }, CanLogin);

            Logout = new RelayCommand(() =>
            {
                SecurityServices serv = new SecurityServices();

                serv.Logout();
                Usuario = null;
                Status  = null;
            }, CanLogout);

            NullCommand = new RelayCommand(() => { }, () => false);

            Buscar = new RelayCommand(() => BuscarTexto());

            ConfirmarComando = new InteractionRequest <IConfirmation>();

            //if (IsInDesignMode)
            //{
            //  Usuario = new Usuario()
            //  {
            //    Empleado = new Empleado()
            //    {
            //      Persona = new Persona() { Nombres = "Enrique", Apellidos = "Thedy" }
            //    }
            //  };
            //}
        }
예제 #42
0
 public MainViewModel()
 {
     ConfirmationRequest = new InteractionRequest <IConfirmation>();
     ConfirmationCommand = new DelegateCommand(() =>
     {
         ConfirmationRequest.Raise(new Confirmation
         {
             Title   = "Confirmation box",
             Content = "Confirmation message displayed"
         },
                                   (dialog) =>
         {
             if (dialog.Confirmed)
             {
                 Status = "Confirmed";
             }
             else
             {
                 Status = "Cancelled";
             }
         });
     });
 }
        public TravelExpenseListViewModel(RegionManager regionManager, IEventAggregator eventaggregator)
        {
            NewTravelExpenseCommand                   = new DelegateCommand(OnNewTravelExpense);
            ShowTravelExpenseCommand                  = new DelegateCommand(OnShowTravelExpense);
            PrepareForDatevCommand                    = new DelegateCommand(OnPrepareForDatev);
            PrepareTaxableExpensesCommand             = new DelegateCommand(OnPrepareTaxableExpenses);
            SelectionChangedCommand                   = new DelegateCommand(OnSelectionChanged);
            DeletingTravelExpenseCommand              = new DelegateCommand <object>(OnDeletingTravelExpense);
            StartMovingExpensesCommand                = new DelegateCommand(OnStartMovingExpenses).ObservesCanExecute(() => CanStartMoving);
            CancelMovingExpensesCommand               = new DelegateCommand(OnCancelMovingExpenses);
            TravelExpenseItemsSelectionChangedCommand = new DelegateCommand <object>(OnTravelExpenseItemsSelectionChanged);
            DropDownItemSelectedCommand               = new DelegateCommand <object>(OnDropDownItemSelected);
            this.regionManager   = regionManager;
            this.eventaggregator = eventaggregator;
            ConfirmationRequest  = new Prism.Interactivity.InteractionRequest.InteractionRequest <Prism.Interactivity.InteractionRequest.IConfirmation>();
            NotificationRequest  = new InteractionRequest <INotification>();

            // set datevFolder
            string root  = Properties.Settings.Default.RootDirectory;
            string datev = Properties.Settings.Default.DatevDirectory;

            datevFolder = Path.Combine(root, datev);
        }
예제 #44
0
        public SupplierRetrieveViewModel()
        {
            SearchCommand = new DelegateCommand(Search);
            DetailCommand = new DelegateCommand(Detail, CanDetail)
                            .ObservesProperty(() => SuppliersView);
            UpdateCommand = new DelegateCommand(Update, CanUpdate)
                            .ObservesProperty(() => SuppliersView);
            DeleteCommand = new DelegateCommand(Delete, CanDelete)
                            .ObservesProperty(() => SuppliersView);

            MoveToFirstPageCommand = new DelegateCommand(MoveToFirstPage, CanMoveToFirstPage)
                                     .ObservesProperty(() => PageIndex);
            MoveToPreviousPageCommand = new DelegateCommand(MoveToPreviousPage, CanMoveToPreviousPage)
                                        .ObservesProperty(() => PageIndex);
            MoveToNextPageCommand = new DelegateCommand(MoveToNextPage, CanMoveToNextPage)
                                    .ObservesProperty(() => PageIndex).ObservesProperty(() => TotalPages);
            MoveToLastPageCommand = new DelegateCommand(MoveToLastPage, CanMoveToLastPage)
                                    .ObservesProperty(() => PageIndex).ObservesProperty(() => TotalPages);
            PageSizeSelectionChanged = new DelegateCommand(PageSizeChanged);

            NotificationRequest = new InteractionRequest <INotification>();
            ConfirmationRequest = new InteractionRequest <IConfirmation>();
        }
예제 #45
0
        //コンストラクタ
        public EditFormViewModel(IRegionManager regionManager)
        {
            //IRegionManager
            _regionManager = regionManager;

            //カテゴリのコンボボックス
            CategoryModelsList = SingleCategoryList.Instance;

            //新規追加
            AddCommand = new DelegateCommand(ExecuteAdd, CanExecuteAdd).ObservesProperty(() => IsEnabled1);

            //修正保存
            UpdateCommand = new DelegateCommand(ExecuteUpdate, CanExecuteUpdate).ObservesProperty(() => IsEnabled2);

            //削除
            DelCommand = new DelegateCommand(ExecuteDel, CanExecuteUpdate).ObservesProperty(() => IsEnabled2);

            //メッセージボックス用
            NotificationRequest = new InteractionRequest <INotification>();

            //確認画面
            ConfirmationRequest = new InteractionRequest <IConfirmation>();
        }
        public ActivitiesManagerViewModel(
            ICoreViewModel coreViewModel,
            IEventAggregator eventService)
            : base(eventService)
        {
            m_Lock          = new object();
            m_CoreViewModel = coreViewModel ?? throw new ArgumentNullException(nameof(coreViewModel));
            m_EventService  = eventService ?? throw new ArgumentNullException(nameof(eventService));

            SelectedActivities = new ObservableCollection <ManagedActivityViewModel>();

            m_NotificationInteractionRequest = new InteractionRequest <Notification>();

            InitializeCommands();
            SubscribeToEvents();

            SubscribePropertyChanged(m_CoreViewModel, nameof(m_CoreViewModel.IsBusy), nameof(IsBusy), ThreadOption.BackgroundThread);
            SubscribePropertyChanged(m_CoreViewModel, nameof(m_CoreViewModel.HasStaleOutputs), nameof(HasStaleOutputs), ThreadOption.BackgroundThread);
            SubscribePropertyChanged(m_CoreViewModel, nameof(m_CoreViewModel.HasCompilationErrors), nameof(HasCompilationErrors), ThreadOption.BackgroundThread);
            SubscribePropertyChanged(m_CoreViewModel, nameof(m_CoreViewModel.CompilationOutput), nameof(CompilationOutput), ThreadOption.BackgroundThread);
            SubscribePropertyChanged(m_CoreViewModel, nameof(m_CoreViewModel.ShowDates), nameof(ShowDates), ThreadOption.BackgroundThread);
            SubscribePropertyChanged(m_CoreViewModel, nameof(m_CoreViewModel.ShowDates), nameof(ShowDays), ThreadOption.BackgroundThread);
        }
예제 #47
0
        //Standard registration
        //public SubCategoryViewModel(ISubCategoryView view, IRegionManager regionManager)
        //    : base(view)
        //Navigation registration
        public SubCategoryViewModel(IRegionManager regionManager)
        {
            _regionManager = regionManager;

            _subCategoryBl = new SubCategoryBL();
            _subCategories = new ObservableCollection <SubCategoryVO>(_subCategoryBl.FindAll());

            _categoryBl = new CategoryBL();
            _categories = new ObservableCollection <CategoryVO>(_categoryBl.FindAll());

            NotificationRequest = new InteractionRequest <INotification>();
            NotificationCommand = new DelegateCommand(RaiseNotification);

            ConfirmationRequest = new InteractionRequest <IConfirmation>();
            ConfirmationCommand = new DelegateCommand(RaiseConfirmation);

            CustomPopupRequest = new InteractionRequest <INotification>();
            CustomPopupCommand = new DelegateCommand(RaiseCustomPopup);

            SelectItemCommand = new DelegateCommand <object[]>(SelectItem);

            CategoryInfoCommand = new DelegateCommand <SubCategoryVO>(CategoryInfo);
        }
예제 #48
0
        public CasePropertySetViewModel(IViewModelsFactory <ICasePropertyViewModel> casePropertyVmFactory, IRepositoryFactory <ICustomerRepository> repositoryFactory, ICustomerEntityFactory entityFactory, IHomeSettingsViewModel parent,
                                        INavigationManager navManager, CasePropertySet item)
            : base(entityFactory, item)
        {
            ViewTitle = new ViewTitleBase()
            {
                Title    = "INFO",
                SubTitle = (item != null && !string.IsNullOrEmpty(item.Name)) ? item.Name : ""
            };
            _casePropertyVmFactory = casePropertyVmFactory;
            _repositoryFactory     = repositoryFactory;
            _navManager            = navManager;
            _parent = parent;

            OpenItemCommand = new DelegateCommand(() => _navManager.Navigate(NavigationData));


            ItemAddCommand    = new DelegateCommand(RaiseItemAddInteractionRequest);
            ItemEditCommand   = new DelegateCommand <CaseProperty>(RaiseItemEditInteractionRequest, x => x != null);
            ItemDeleteCommand = new DelegateCommand <CaseProperty>(RaiseItemDeleteInteractionRequest, x => x != null);

            CommonWizardDialogRequest = new InteractionRequest <Confirmation>();
        }
        public EmployeeSalariesViewModel(IEventAggregator eventAggregator)
        {
            EditCurrentSalaryCommand   = new DelegateCommand(OnEditCurrentSalary);
            AddBonusPaymentCommand     = new DelegateCommand(OnAddBonusPayment);
            EditSalaryHistoryCommand   = new DelegateCommand(OnEditSalaryHistory);
            SetFinalPaymentCommand     = new DelegateCommand(OnSetFinalPayment);
            SalaryOverviewCommand      = new DelegateCommand(OnSalaryOverview);
            PayrollCostCommand         = new DelegateCommand(OnPayrollCost);
            UserControlLoadedCommand   = new DelegateCommand <object>(OnUserControlLoaded);
            AddingNewDetailCommand     = new DelegateCommand <object>(OnAddingNewDetail);
            AddNewPaymentDetailCommand = new DelegateCommand(OnAddNewPaymentDetail);
            RowDetailDeletingCommand   = new DelegateCommand(OnRowDetailDeleting);
            RowEditEndedCommand        = new DelegateCommand(OnRowEditEnded);
            CellValidatingCommand      = new DelegateCommand <object>(OnCellValidating);
            SaveCommand               = new DelegateCommand <string>(OnSave);
            CancelCommand             = new DelegateCommand <string>(OnCancel);
            SalaryItemDeletingCommand = new DelegateCommand <object>(OnSalaryItemDeleting);
            VacationLiabilityCommand  = new DelegateCommand(OnVacationLiability);
            ConfirmationRequest       = new InteractionRequest <IConfirmation>();
            this.eventAggregator      = eventAggregator;

            NotificationRequest = new InteractionRequest <INotification>();
        }
예제 #50
0
        public AddPurchaseViewModel(IRegionManager regionManager,
                                    PurchaseTransactionModel purchaseTransaction,
                                    SupplierModel supplierModel,
                                    ProductModel products)
        {
            _purchaseTransaction = purchaseTransaction;
            _regionManager       = regionManager;
            _supplierModel       = supplierModel;
            _products            = products;

            SupplierList    = _supplierModel.GetSuppliers();
            UOMList         = _products.GetUoMCategories();
            TaxRateList     = _products.GetProductCategories();
            PaymentModeList = new List <string>()
            {
                "CASH", "CARD"
            };

            GoToViewCmd          = new DelegateCommand <string>(GoToView);
            PurchaseCmd          = new DelegateCommand(Purchase);
            SearchProductByIdCmd = new DelegateCommand <string>(SearchProductById);
            NotificationRequest  = new InteractionRequest <INotification>();
        }
예제 #51
0
        public MenuBarViewModel(IEventAggregator eventAggregator)
        {
            _eventAggregator = eventAggregator;

            NewModuleCommand        = new DelegateCommand(NewModule);
            OpenModuleCommand       = new DelegateCommand(OpenModule);
            CloseModuleCommand      = new DelegateCommand(CloseModule);
            SaveCommand             = new DelegateCommand(Save);
            SaveAsCommand           = new DelegateCommand(SaveAs);
            ImportCommand           = new DelegateCommand(Import);
            ExportCommand           = new DelegateCommand(Export);
            ExitCommand             = new DelegateCommand(Exit);
            UndoCommand             = new DelegateCommand(Undo);
            RedoCommand             = new DelegateCommand(Redo);
            CopyCommand             = new DelegateCommand(Copy);
            CutCommand              = new DelegateCommand(Cut);
            PasteCommand            = new DelegateCommand(Paste);
            ModulePropertiesCommand = new DelegateCommand(ModuleProperties);
            DataEditorCommand       = new DelegateCommand(DataEditor);
            ResourceEditorCommand   = new DelegateCommand(ResourceEditor);
            BuildModuleCommand      = new DelegateCommand(BuildModule);
            ManageResourcesCommand  = new DelegateCommand(ManageResources);
            AboutCommand            = new DelegateCommand(About);

            NewModuleRequest            = new InteractionRequest <INotification>();
            SaveModuleAsRequest         = new InteractionRequest <INotification>();
            OpenModuleRequest           = new InteractionRequest <INotification>();
            OpenModulePropertiesRequest = new InteractionRequest <INotification>();
            OpenDataEditorRequest       = new InteractionRequest <INotification>();
            OpenManageResourcesRequest  = new InteractionRequest <INotification>();
            OpenResourceEditorRequest   = new InteractionRequest <INotification>();
            OpenBuildModuleRequest      = new InteractionRequest <INotification>();
            OpenAboutRequest            = new InteractionRequest <INotification>();

            _eventAggregator.GetEvent <ModuleLoadedEvent>().Subscribe(ModuleLoaded);
            _eventAggregator.GetEvent <ModuleClosedEvent>().Subscribe(() => IsModuleLoaded = false);
        }
        private void BindCommands()
        {
            SaveCommand   = new DelegateCommand(DoSave, CanSave);
            DeleteCommand = new DelegateCommand(DoDelete, CanDoDelete);
            CancelCommand = new DelegateCommand(DoCancel, CanDoCancel);
            PrintCommand  = new DelegateCommand(DoPrint, CanDoDelete);

            FindAccountCommand     = new DelegateCommand(FindAccount);
            GetAccountCommand      = new DelegateCommand <string>(LoadAccount);
            GenAccountNumCommand   = new DelegateCommand(GetNextAccountNumber);
            ValidateAddressCommand = new DelegateCommand <AddressWrapper>(ValidateAddress);
            NewOrderCommand        = new DelegateCommand <object>(StartNewOrder, CanStartNewOrder);

            NewFeeScheuleCommand    = new DelegateCommand(AddFeeSchedule);
            EditFeeScheuleCommand   = new DelegateCommand(EditFeeSchedule, CanEditFeeSchedule);
            DeleteFeeScheuleCommand = new DelegateCommand(DeleteFeeScheule, CanDeleteFeeScheule);

            NewAttributeCommand    = new DelegateCommand(AddAttribute);
            EditAttributeCommand   = new DelegateCommand(EditAttribute, CanEditAttribute);
            DeleteAttributeCommand = new DelegateCommand(DeleteAttribute, CanDeleteAttribute);

            FindAccountRequest             = new InteractionRequest <ItemSelectionNotification>();
            EditFeeScheduledRequest        = new InteractionRequest <ItemEditNotification>();
            EditAttributeRequest           = new InteractionRequest <ItemEditNotification>();
            EditAccountPersonRequest       = new InteractionRequest <ItemEditNotification>();
            EditContactRequest             = new InteractionRequest <ItemEditNotification>();
            SaveChangesConfirmationRequest = new InteractionRequest <IConfirmation>();
            DeleteConfirmationRequest      = new InteractionRequest <IConfirmation>();

            EditEmployeeCommand   = new DelegateCommand(EditEmployee, CanEditEmployee);
            DeleteEmployeeCommand = new DelegateCommand(DeleteEmployee, CanDeleteEmployee);
            AddEmployeeCommand    = new DelegateCommand(AddEmployee);

            EditContactCommand   = new DelegateCommand(EditContact, CanEditContact);
            DeleteContactCommand = new DelegateCommand(DeleteContact, CanDeleteContact);
            AddContactCommand    = new DelegateCommand(AddContact);
        }
예제 #53
0
        public ShellViewModel(IStatusMessageService statusMessageService, ConfigurationService configService)
        {
            myStatusMessageService = statusMessageService;
            myStatusMessageService.Messages.CollectionChanged += OnStatusMessagesChanged;

            myConfigurationService = configService;

            NodeMasksEditorRequest = new InteractionRequest <INotification>();
            OpenFilterEditor       = new DelegateCommand(OnOpenFilterEditor);

            ClusterEditorRequest = new InteractionRequest <INotification>();
            OpenClusterEditor    = new DelegateCommand(OnOpenClusterEditor);

            BookmarksRequest = new InteractionRequest <INotification>();
            OpenBookmarks    = new DelegateCommand(OnOpenBookmarks);

            SettingsEditorRequest = new InteractionRequest <IConfirmation>();
            OpenSettingsEditor    = new DelegateCommand(OnOpenSettingsEditor);

            ShowStatusMessagesRequest = new InteractionRequest <INotification>();
            ShowStatusMessagesCommand = new DelegateCommand(ShowStatusMessages);

            myConfigurationService.ConfigChanged += OnConfigChanged;
        }
예제 #54
0
        public EditorViewModel(string title, string path, bool showLineNumbers, Brush linkTextForeground, int fontSize)
        {
            //Config editor
            Title                          = title;
            ToolTip                        = path;
            IsSelected                     = true;
            EditorShowLineNumbers          = showLineNumbers;
            EditorLinkTextForegroundBrush  = linkTextForeground;
            EditorFontSize                 = fontSize;
            CloseCommand                   = new DelegateCommand(CloseFile);
            SaveCommand                    = new DelegateCommand(SaveFile);
            SaveChangesConfirmationRequest = new InteractionRequest <IConfirmation>();
            ReloadConfirmationRequest      = new InteractionRequest <IConfirmation>();

            //Load file
            var streamReader = File.OpenText(ToolTip);

            _document = new TextDocument(streamReader.ReadToEnd());
            streamReader.Close();

            //Load SyntaxHighlighting
            var syntaxHighlighterTool = new SyntaxHighlighterTool();

            SyntaxHighlighting = syntaxHighlighterTool.SyntaxHighlightingMode(path);


            _watcher = new FileSystemWatcher
            {
                Path         = Path.GetDirectoryName(path),
                Filter       = Path.GetFileName(path),
                NotifyFilter = NotifyFilters.LastWrite
            };
            _watcher.Changed += WatcherOnChanged;
            // Begin watching
            _watcher.EnableRaisingEvents = true;
        }
예제 #55
0
        public MainViewModel()
        {
#if DESIGN
            if (IsInDesignMode)
            {
                RegisterWizardSteps();
                Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary {
                    Source = new Uri("/VirtoCommerce.Bootstrapper.Main;component/MainModuleDictionary.xaml", UriKind.Relative)
                });
            }
#endif
            ViewTitle = new ViewTitleBase {
                Title = Resources.SDKTitle
            };
            Cancelled            = false;
            CancelCommand        = new DelegateCommand <object>(x => Cancel(), x => !IsInitializing && !CurrentStep.IsLast && !Cancelled);
            CancelConfirmRequest = new InteractionRequest <Confirmation>();

            OKDialogRequest               = new InteractionRequest <Notification>();
            OKCancelDialogRequest         = new InteractionRequest <Confirmation>();
            YesNoDialogRequest            = new InteractionRequest <Confirmation>();
            YesNoCancelDialogRequest      = new InteractionRequest <Confirmation>();
            AbortRetryIgnoreDialogRequest = new InteractionRequest <Confirmation>();
        }
        private void BindCommands()
        {
            SaveCommand   = new DelegateCommand(DoSave, CanSave);
            CancelCommand = new DelegateCommand(DoCancel, CanDoCancel);

            EditEmployeeCommand   = new DelegateCommand(EditEmployee, CanEditEmployee);
            DeleteEmployeeCommand = new DelegateCommand(DeleteEmployee, CanDeleteEmployee);
            AddEmployeeCommand    = new DelegateCommand(AddEmployee);

            EditCOACommand   = new DelegateCommand(EditChartOfAccount, CanEditChartOfAccount);
            DeleteCOACommand = new DelegateCommand(DeleteChartOfAccount, CanDeleteChartOfAccount);
            AddCOACommand    = new DelegateCommand(AddChartOfAccount);

            NewAttributeCommand    = new DelegateCommand(AddAttribute);
            EditAttributeCommand   = new DelegateCommand(EditAttribute, CanEditAttribute);
            DeleteAttributeCommand = new DelegateCommand(DeleteAttribute, CanDeleteAttribute);

            EditEmployeeRequest            = new InteractionRequest <ItemEditNotification>();
            EditChartOfAccountRequest      = new InteractionRequest <ItemEditNotification>();
            EditAttributeRequest           = new InteractionRequest <ItemEditNotification>();
            SaveChangesConfirmationRequest = new InteractionRequest <IConfirmation>();
            ValidateAddressCommand         = new DelegateCommand <AddressWrapper>(ValidateAddress);
            InvalidateCommands();
        }
예제 #57
0
        public PlaylistsViewModel(IHorsifyDialogService horsifyDialogService, IPlaylistService horsifyPlaylistService, IEventAggregator eventAggregator,
                                  IRegionManager regionManager, IUnityContainer unityContainer, ILoggerFacade loggerFacade) : base(loggerFacade)
        {
            _eventAggregator        = eventAggregator;
            _regionManager          = regionManager;
            _unityContainer         = unityContainer;
            _horsifyPlaylistService = horsifyPlaylistService;
            _horsifyDialogService   = horsifyDialogService;

            PlayListViewModels     = new ObservableCollection <PlaylistTabViewModel>();
            OpenPlayListViewModels = new ObservableCollection <PlaylistTabViewModel>();

            #region Commands
            CreatePlaylistCommand    = new DelegateCommand <string>(OnCreatePlaylist);
            OpenSavedPlaylistCommand = new DelegateCommand <PlaylistTabViewModel>(OnOpenSavedPlaylist);

            #endregion

            CreatePlayList("Preparation Playlist", true);

            _horsifyPlaylistService.UpdateFromDatabaseAsync().GetAwaiter().OnCompleted(() =>
            {
                OnPlaylistsUpdated();
            });

            DeletePlaylistCommand = new DelegateCommand(OnDeletePlaylist);
            CloseAllTabsCommand   = new DelegateCommand(OnCloseTabs);
            CloseTabCommand       = new DelegateCommand <PlaylistTabViewModel>(OnCloseTab);

            #region Notification for help
            HelpNotificationRequest = new InteractionRequest <INotification>();
            HelpWindowCommand       = new DelegateCommand(RaiseHelpNotification);

            ConfirmationRequest = new InteractionRequest <IConfirmation>();
            #endregion
        }
예제 #58
0
        public MainWindowViewModel(IDialogService dialogService, IMessageService messageService, IEventAggregator ea)
        {
            this.OpenMediaCommand        = new DelegateCommand(this.OnOpenMediaCommand);
            this.OpenMessagesCommand     = new DelegateCommand(this.OnOpenMessagesCommand);
            this.PlayPauseCommand        = new DelegateCommand(this.OnPlayPauseCommand, CanPlayPause);
            this.SkipForward5sCommand    = new DelegateCommand <object>(OnSkipForwardCommand, CanSkip);
            this.SkipForward30sCommand   = new DelegateCommand <object>(OnSkipForwardCommand, CanSkip);
            this.SkipForward60sCommand   = new DelegateCommand <object>(OnSkipForwardCommand, CanSkip);
            this.PlayStateLabel          = "Play";
            this._dialogService          = dialogService;
            this._controlWindowViewModel = new ControlWindowViewModel();

            CustomNotificationRequest = new InteractionRequest <IOptionsNotification>();
            CustomNotificationCommand = new DelegateCommand(RaiseOptionNotifications);
            this._debugMessageList    = new ObservableCollection <string>();
            this.PropertyChanged     += MainWindowViewModel_PropertyChanged;
            this._messageService      = messageService;
            this._ea        = ea;
            this._stopWatch = new System.Diagnostics.Stopwatch();
            this.microTimer.MicroTimerElapsed += new MicroTimer.MicroTimerElapsedEventHandler(OnTimedEvent);
            this.microTimer.Interval           = 10000;
            _dispatcher        = System.Windows.Application.Current.Dispatcher;
            this.WindowClosing = new DelegateCommand <object>(this.OnWindowClosing);
        }
        public StoresSettingsViewModel(
            IViewModelsFactory <IStoreViewModel> storeVmFactory,
            IRepositoryFactory <IAppConfigRepository> seoRepository,
            IAppConfigEntityFactory seoFactory,
            IRepositoryFactory <IStoreRepository> repositoryFactory,
            IStoreEntityFactory entityFactory,
            IViewModelsFactory <ICreateStoreViewModel> wizardVmFactory,
            IViewModelsFactory <IStoreViewModel> editVmFactory,
            IAuthenticationContext authContext,
            NavigationManager navManager,
            TileManager tileManager)
            : base(entityFactory, wizardVmFactory, editVmFactory)
        {
            _repositoryFactory = repositoryFactory;
            _navManager        = navManager;
            _tileManager       = tileManager;
            _authContext       = authContext;
            _seoFactory        = seoFactory;
            _seoRepository     = seoRepository;
            _storeVmFactory    = storeVmFactory;
            PopulateTiles();

            LinkedStoreNotifictaionRequest = new InteractionRequest <ConditionalConfirmation>();
        }
예제 #60
0
        public MySqlConnectionsViewModel()
        {
            LoginCommand            = new DelegateCommand(Login);
            SaveConnectionCommand   = new DelegateCommand(SaveConnection);
            NewConnectionCommand    = new DelegateCommand(NewConnection);
            DeleteConnectionCommand = new DelegateCommand(DeleteConnection);
            SelectionChangedCommand = new DelegateCommand(SelectionChanged);
            CancelCommand           = new DelegateCommand(CancelNewConnection);

            NotificationRequest = new InteractionRequest <INotification>();
            SaveAsRequest       = new InteractionRequest <SaveAsNotification>();

            ConnectionsModel = new MySqlConnectionsModel
            {
                LoginContent    = "Login",
                LoginIsEnabled  = true,
                NewIsEnabled    = true,
                DeleteIsEnabled = true,
                Visibility      = "Hidden",
                Connections     = new ObservableCollection <string>()
            };

            InitializeConnections();
        }