protected override void OnTemplateApplied(INameScope nameScope) { if (_popup != null) { _popup.Opened -= PopupOpened; } _popup = nameScope.Get <Popup>("PART_Popup"); _popup.Opened += PopupOpened; }
/// <summary> /// Called when the MenuItem's template has been applied. /// </summary> protected override void OnTemplateApplied(INameScope nameScope) { base.OnTemplateApplied(nameScope); _popup = nameScope.Get <Popup>("PART_Popup"); _popup.DependencyResolver = DependencyResolver.Instance; _popup.PopupRootCreated += PopupRootCreated; _popup.Opened += PopupOpened; _popup.Closed += PopupClosed; }
public static bool TryGet <T>(this INameScope scope, string name, out T result) where T : class { try { result = scope.Get <T>(name); } catch { result = null; } return(result != null); }
protected override void OnTemplateApplied(INameScope nameScope) { _presenter = nameScope.Get <TextPresenter>("PART_TextPresenter"); _presenter.Cursor = new Cursor(StandardCursorType.Ibeam); }
protected override void OnTemplateApplied(INameScope nameScope) { if (_popup != null) { _popup.Opened -= PopupOpened; } _popup = nameScope.Get<Popup>("PART_Popup"); _popup.Opened += PopupOpened; }
/// <summary> /// Called when the MenuItem's template has been applied. /// </summary> protected override void OnTemplateApplied(INameScope nameScope) { base.OnTemplateApplied(nameScope); _popup = nameScope.Get<Popup>("PART_Popup"); _popup.DependencyResolver = DependencyResolver.Instance; _popup.PopupRootCreated += PopupRootCreated; _popup.Opened += PopupOpened; _popup.Closed += PopupClosed; }
protected override void OnTemplateApplied(INameScope nameScope) { _presenter = nameScope.Get<TextPresenter>("PART_TextPresenter"); _presenter.Cursor = new Cursor(StandardCursorType.Ibeam); }
/// <inheritdoc/> protected override void OnTemplateApplied(INameScope nameScope) { _indicator = nameScope.Get <Border>("PART_Indicator"); UpdateIndicator(Bounds.Size); }
/// <inheritdoc/> protected override void OnTemplateApplied(INameScope nameScope) { _indicator = nameScope.Get<Border>("PART_Indicator"); UpdateIndicator(Bounds.Size); }