示例#1
0
        /// <inheritdoc/>
        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            PointerEventHandler pointerPressedHandler = RichEditBox_OnPointerPressed;
            PointerEventHandler pointerMovedHandler   = RichEditBox_OnPointerMoved;

            _suggestionPopup      = (Popup)GetTemplateChild(PartSuggestionsPopup);
            _richEditBox          = (RichEditBox)GetTemplateChild(PartRichEditBox);
            _suggestionsList      = (ListViewBase)GetTemplateChild(PartSuggestionsList);
            _suggestionsContainer = (Border)GetTemplateChild(PartSuggestionsContainer);
            ConditionallyLoadElement(Header, PartHeaderContentPresenter);
            ConditionallyLoadElement(Description, PartDescriptionPresenter);

            if (_richEditBox != null)
            {
                _richEditBox.SizeChanged            -= RichEditBox_SizeChanged;
                _richEditBox.TextChanging           -= RichEditBox_TextChanging;
                _richEditBox.TextChanged            -= RichEditBox_TextChanged;
                _richEditBox.TextCompositionStarted -= RichEditBox_TextCompositionStarted;
                _richEditBox.TextCompositionChanged -= RichEditBox_TextCompositionChanged;
                _richEditBox.TextCompositionEnded   -= RichEditBox_TextCompositionEnded;
                _richEditBox.SelectionChanging      -= RichEditBox_SelectionChanging;
                _richEditBox.SelectionChanged       -= RichEditBox_SelectionChanged;
                _richEditBox.Paste          -= RichEditBox_Paste;
                _richEditBox.PreviewKeyDown -= RichEditBox_PreviewKeyDown;
                _richEditBox.RemoveHandler(PointerMovedEvent, pointerMovedHandler);
                _richEditBox.RemoveHandler(PointerPressedEvent, pointerPressedHandler);
                _richEditBox.ProcessKeyboardAccelerators -= RichEditBox_ProcessKeyboardAccelerators;

                _richEditBox.SizeChanged            += RichEditBox_SizeChanged;
                _richEditBox.TextChanging           += RichEditBox_TextChanging;
                _richEditBox.TextChanged            += RichEditBox_TextChanged;
                _richEditBox.TextCompositionStarted += RichEditBox_TextCompositionStarted;
                _richEditBox.TextCompositionChanged += RichEditBox_TextCompositionChanged;
                _richEditBox.TextCompositionEnded   += RichEditBox_TextCompositionEnded;
                _richEditBox.SelectionChanging      += RichEditBox_SelectionChanging;
                _richEditBox.SelectionChanged       += RichEditBox_SelectionChanged;
                _richEditBox.Paste          += RichEditBox_Paste;
                _richEditBox.PreviewKeyDown += RichEditBox_PreviewKeyDown;
                _richEditBox.AddHandler(PointerMovedEvent, pointerMovedHandler, true);
                _richEditBox.AddHandler(PointerPressedEvent, pointerPressedHandler, true);
                _richEditBox.ProcessKeyboardAccelerators += RichEditBox_ProcessKeyboardAccelerators;
            }

            if (_suggestionsList != null)
            {
                _suggestionsList.ItemClick   -= SuggestionsList_ItemClick;
                _suggestionsList.SizeChanged -= SuggestionsList_SizeChanged;
                _suggestionsList.GotFocus    -= SuggestionList_GotFocus;

                _suggestionsList.ItemClick   += SuggestionsList_ItemClick;
                _suggestionsList.SizeChanged += SuggestionsList_SizeChanged;
                _suggestionsList.GotFocus    += SuggestionList_GotFocus;
            }
        }
示例#2
0
 public PopupPanel(Popup popup)
 {
     Popup      = popup;
     Visibility = Visibility.Collapsed;
     Background = SolidColorBrushHelper.Transparent;
 }
示例#3
0
 protected PlacementPopupPanel(Popup popup) : base(popup)
 {
     Loaded   += (s, e) => Windows.UI.Xaml.Window.Current.SizeChanged += Current_SizeChanged;
     Unloaded += (s, e) => Windows.UI.Xaml.Window.Current.SizeChanged -= Current_SizeChanged;
 }
示例#4
0
 public static void SetPopup(DependencyObject obj, Popup value)
 {
     obj.SetValue(PopupProperty, value);
 }
示例#5
0
 protected PlacementPopupPanel(Popup popup) : base(popup)
 {
 }
示例#6
0
 public DropDownLayouter(ComboBox combo, Popup popup)
 {
     _combo = (combo as IWeakReferenceProvider).WeakReference;
     _popup = (popup as IWeakReferenceProvider).WeakReference;
 }