/// <summary> /// Создает тег с запросом. /// </summary> public TagViewModel(ITagParentAutocomplete parent, string query) : this(parent) { Contract.Ensures(State == State.Typing); Query = query; }
/// <summary> /// Создает тег с сущностью. /// </summary> public TagViewModel(ITagParentAutocomplete parent, IHrItemObject item) : this(parent) { Contract.Requires(item != null); Contract.Ensures(State == State.Completed); Blank = item; }
/// <summary> /// Создает пустой тег. /// </summary> public TagViewModel(ITagParentAutocomplete parent) { Contract.Requires(parent != null); Contract.Ensures(State == State.Init); this.autocomplete = parent; emh.Add(this.Subscribe(Event.EntityPersisted, (e) => { var word = e.GetValue <IEntity>(MessageKeys.Entity) as Word; if (word != null && Blank as Word == word) { // убираем сигнал "новое" после сохранения слова SetSignalization(); } })); IsDraggable = !autocomplete.SingleTag; Reset(); }