Defining a Silverlight combobox popup (dropup)

Is it possible to bring out a combo-box silverlight "drop up", i.e. display popup above combo box instead of default lower level?

+3
source share
1 answer

The first step is to define your own ComboBox template containing a popup definition. For example, edit a copy using Blend.

However, placing this popup is not an easy task, as Silverlight Popups has no properties Placementor PlacementTarget, as in WPF, which allows you to display it higher.

Kent Boogaart Attached Behavior, , :

<Popup b:PopupPlacement.PlacementTarget="{Binding ElementName=ContentPresenterBorder}">
    <b:Popup.PreferredOrientations>
        <b:PopupOrientationCollection>
            <b:PopupOrientation Placement="Top" HorizontalAlignment="Center"/>
            <b:PopupOrientation Placement="Bottom" HorizontalAlignment="Center"/>
            <b:PopupOrientation Placement="Right" VerticalAlignment="Center"/>
            <b:PopupOrientation Placement="Right" VerticalAlignment="TopCenter"/>
        </b:PopupOrientationCollection>
    </b:Popup.PreferredOrientations>

    <!--Popup content with the ItemPresenter-->
</Popup>

ContentPresenterBorder - , ToggleButton ComboBox.

+2

Source: https://habr.com/ru/post/1795460/


All Articles