how to Open DrawerHost outside it ? #2909
-
how to fill _________ get same behavior as btn0.
|
Beta Was this translation helpful? Give feedback.
Answered by
nicolaihenriksen
Nov 29, 2022
Replies: 1 comment
-
@after1990s I think what you're trying to accomplish is to activate the drawer from an element located outside of the <Button
Command="{x:Static materialDesign:DrawerHost.OpenDrawerCommand}"
CommandParameter="{x:Static Dock.Left}"
CommandTarget="{Binding ElementName=DrawerHost}"
Content="{materialDesign:PackIcon Kind=ArrowLeft}"/>
<materialDesign:DrawerHost x:Name="DrawerHost">
<materialDesign:DrawerHost.LeftDrawerContent>
<Button/>
</materialDesign:DrawerHost.LeftDrawerContent>
<Button
x:Name="btn0"
Command="{x:Static materialDesign:DrawerHost.OpenDrawerCommand}"
CommandParameter="{x:Static Dock.Left}"
Content="{materialDesign:PackIcon Kind=ArrowLeft}">
</materialDesign:DrawerHost> With this, pressing the top |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
nicolaihenriksen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@after1990s I think what you're trying to accomplish is to activate the drawer from an element located outside of the
DrawerHost
? For that, you could use theCommandTarget
attribute to target theDrawerHost
(or any other element inside of it) by its name: