コード例 #1
0
        protected override void OnTemplateApplied(INameScope nameScope)
        {
            if (_popup != null)
            {
                _popup.Opened -= PopupOpened;
            }

            _popup         = nameScope.Get <Popup>("PART_Popup");
            _popup.Opened += PopupOpened;
        }
コード例 #2
0
ファイル: MenuItem.cs プロジェクト: Serg2DFX/Perspex
        /// <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;
        }
コード例 #3
0
 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);
 }
コード例 #4
0
 protected override void OnTemplateApplied(INameScope nameScope)
 {
     _presenter        = nameScope.Get <TextPresenter>("PART_TextPresenter");
     _presenter.Cursor = new Cursor(StandardCursorType.Ibeam);
 }
コード例 #5
0
ファイル: DropDown.cs プロジェクト: furesoft/Perspex
        protected override void OnTemplateApplied(INameScope nameScope)
        {
            if (_popup != null)
            {
                _popup.Opened -= PopupOpened;
            }

            _popup = nameScope.Get<Popup>("PART_Popup");
            _popup.Opened += PopupOpened;
        }
コード例 #6
0
ファイル: MenuItem.cs プロジェクト: furesoft/Perspex
        /// <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;
        }
コード例 #7
0
ファイル: TextBox.cs プロジェクト: furesoft/Perspex
 protected override void OnTemplateApplied(INameScope nameScope)
 {
     _presenter = nameScope.Get<TextPresenter>("PART_TextPresenter");
     _presenter.Cursor = new Cursor(StandardCursorType.Ibeam);
 }
コード例 #8
0
ファイル: ProgressBar.cs プロジェクト: Serg2DFX/Perspex
 /// <inheritdoc/>
 protected override void OnTemplateApplied(INameScope nameScope)
 {
     _indicator = nameScope.Get <Border>("PART_Indicator");
     UpdateIndicator(Bounds.Size);
 }
コード例 #9
0
ファイル: ProgressBar.cs プロジェクト: furesoft/Perspex
 /// <inheritdoc/>
 protected override void OnTemplateApplied(INameScope nameScope)
 {
     _indicator = nameScope.Get<Border>("PART_Indicator");
     UpdateIndicator(Bounds.Size);
 }