public DelayPropertiesViewModel(IElementDelay element, CommonDesignerCanvas designerCanvas) { IElementDelay = element; PositionSettingsViewModel = new PositionSettingsViewModel(element as ElementBase, designerCanvas); Title = "Свойства фигуры: Задержка"; CreateCommand = new RelayCommand(OnCreate); EditCommand = new RelayCommand(OnEdit, CanEdit); ShowState = element.ShowState; ShowDelay = element.ShowDelay; Delays = new ObservableCollection<GKDelay>(GKManager.Delays); if (element.DelayUID != Guid.Empty) SelectedDelay = Delays .Where(delay => delay.UID == element.DelayUID) .FirstOrDefault(); }
private void Initialize(IElementDelay element) { var delay = PlanPresenter.Cache.Get<GKDelay>(element.DelayUID); AddState(delay); }