public PropertiesCanBeReadHintViewModel(PropertiesManager PropertiesManager, IReadiness StorageManagerReadiness)
 {
     _propertiesManager = PropertiesManager;
     _storageManagerReadiness = StorageManagerReadiness;
     _storageManagerReadiness.Changed += InvalidateActiveness;
     foreach (PropertyModel property in PropertiesManager.Properties)
         property.CurrentValueChanged += InvalidateActiveness;
 }
Пример #2
0
        protected CardViewModelBase(PropertiesManager PropertiesManager, IPropertiesEditorViewModelProvider EditorViewModelProvider,
                                    IEventAggregator EventAggregator, IList<IHintViewModel> Hints)
        {
            this.PropertiesManager = PropertiesManager;
            _editorViewModelProvider = EditorViewModelProvider;
            _eventAggregator = EventAggregator;
            _hints = Hints;

            EditCommand = new DelegateCommand(EditLocomotive);
            EditDialogRequest = new InteractionRequest<EditPropertiesRequestedEventArgs>();
        }
Пример #3
0
        private DetailedCardViewModel(PropertiesManager PropertiesManager,
                                      IPropertiesEditorViewModelProvider EditorViewModelProvider,
                                      IEventAggregator EventAggregator,
                                      IPropertyViewModelFactory PropertyViewModelFactory,
                                      IList<IHintViewModel> Hints)
            : base(PropertiesManager, EditorViewModelProvider, EventAggregator, Hints)
        {
            _propertyViewModelFactory = PropertyViewModelFactory;
            Properties =
                new ObservableCollection<PropertyViewModel>(
                    PropertiesManager.Properties.Where(p => p.Placement != null).Select(FabricateViewModel));

            PropertiesManager.NewPropertyAdded += PropertiesManagerOnNewPropertyAdded;
        }
 public MismatchedPropertiesHintViewModel(PropertiesManager PropertiesManager)
 {
     _propertiesManager = PropertiesManager;
     foreach (PropertyModel property in _propertiesManager.Properties)
         property.CurrentValueChanged += PropertyOnCurrentValueChanged;
 }
 public PropertiesCanBeReadHintViewModel GetViewModel(PropertiesManager PropertiesManager)
 {
     return new PropertiesCanBeReadHintViewModel(PropertiesManager, _storageManager.Readiness);
 }
Пример #6
0
 /// <summary>Создаёт команду на запись свойств</summary>
 /// <param name="PropertiesManager">Используемый командой менеджер свойств</param>
 public ICommand GetWriteCommand(PropertiesManager PropertiesManager)
 {
     return new DispatchingCommandDecorator(
         new WritePropertiesCommand(_storageManager, PropertiesManager));
 }
Пример #7
0
 public ReadPropertiesCommand(IStorageManager StorageManager, PropertiesManager PropertiesManager)
     : base(StorageManager)
 {
     _propertiesManager = PropertiesManager;
 }
Пример #8
0
 private IList<IHintViewModel> GetHints(PropertiesManager PropertiesManager)
 {
     return new List<IHintViewModel>
            {
                new MismatchedPropertiesHintViewModel(PropertiesManager),
                _propertiesCanBeReadHintViewModelFactory.GetViewModel(PropertiesManager)
            };
 }
Пример #9
0
 public PropertiesManager GetPropertiesManager(LocomotiveModel Locomotive)
 {
     var propertiesManager = new PropertiesManager(Locomotive, _dbSource);
     _storageManager.StorageRead += (Sender, Args) => propertiesManager.UpdateStorageCurrentValue(Args.Index, Args.ReadValue);
     return propertiesManager;
 }