Is it possible to get a popup to ignore MenuDropAlignment in a WPF / Touch app?

前端 未结 5 2114
终归单人心
终归单人心 2021-02-04 05:26

As a bit of background - Windows has a facility for Touch/TabletPCs whereby it shifts the position of popups/menus depending on your \"handedness\" (to prevent the menu appearin

5条回答
  •  無奈伤痛
    2021-02-04 06:10

    This is pretty old but I found another way if you have .net 4.5 at least.

    By overriding your menuitem/popup templates, you can use the following trigger:

    
        
    
    

    Off course, set the following :

    • True or False to your datatrigger value,
    • Left or Right as your setter value.

    It's important that the binding use Binding Path=() syntax and not Binding={x:static ...} so that you can use the StaticPropertyChanged event from your static class.

提交回复
热议问题