How to make a RightDrawerContent? #3255
-
In MaterialDesign demo source, I try to change the LeftDrawerContent to RightDrawerContent, the drawer doesn't show. What else i should to do? thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@hxhgxy If I understand your question correctly, you simply want the Setting the |
Beta Was this translation helpful? Give feedback.
-
oh, yes, i fotgot to change the IsLeftDrawerOpen to IsRightDrawerOpen... |
Beta Was this translation helpful? Give feedback.
@hxhgxy If I understand your question correctly, you simply want the
DrawerHost
to open up the right drawer instead of the left drawer?Setting the
RightDrawerContent
only tells the drawer host what should be displayed if/when the right drawer is opened. You also need something to actually trigger the opening. In the demo app (MainWindow) this is bound to theMenuToggleButton
and the state of that is in turn bound to theDrawerHost.IsLeftDrawerOpen
which effectively means when you toggle the button, it will show the left drawer. So you need to change BOTH the content and the "trigger", to get what I think you want. These changes to MainWindow.xaml should do the trick: