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