有人能帮我想办法解决这个问题吗?
我在一个名为DashView.xaml的WPF页面上创建了一个菜单,该菜单上有按钮,我想知道如何在单击按钮后使BottomDrawerContent可见。
下面我给出了DashView.xaml中的代码
<materialDesign:DialogHost x:Name="hostSales" >
<materialDesign:DrawerHost x:Name="SalesDrawerHost" Content="Sales" Foreground="GhostWhite"
FontWeight="Bold" FontSize="22" BottomDrawerCloseOnClickAway="True"
Cursor="Hand" Width="200" Height="30" ToggleButton.Checked="chkSalesBt1">
<materialDesign:DrawerHost.BottomDrawerContent x:Uid="dashSalesBt1">
<StackPanel x:Name="stkSalesBt1">
<Button Content="Record Sales" Foreground="GhostWhite" FontWeight="SemiBold"/>
<Button Content="Recent Sales" Foreground="GhostWhite" FontWeight="SemiBold"/>
</StackPanel>
</materialDesign:DrawerHost.BottomDrawerContent>
</materialDesign:DrawerHost>
</materialDesign:DialogHost>我确实有一个叫DashClass.cs的类
只是不知道我要在里面放什么,或者我是如何让执行显示BottomDrawerContent的
发布于 2022-04-04 12:32:10
Yout需要一个按钮:
<ToggleButton
x:Name="menuToggler"
Style="{DynamicResource MaterialDesignHamburgerToggleButton}" />`在IsLeftDrawerOpen中使用DrawerHost
<materialDesign:DrawerHost
x:Name="SalesDrawerHost"
Content="Sales"
Foreground="GhostWhite"
FontWeight="Bold"
FontSize="22"
BottomDrawerCloseOnClickAway="True"
Cursor="Hand"
Width="200"
Height="30"
IsBottomDrawerOpen="{Binding ElementName=menuToggler, Path=IsChecked}">
<materialDesign:DrawerHost.BottomDrawerContent x:Uid="dashSalesBt1">
<StackPanel x:Name="stkSalesBt1">
<Button Content="Record Sales" Foreground="GhostWhite" FontWeight="SemiBold"/>
<Button Content="Recent Sales" Foreground="GhostWhite" FontWeight="SemiBold"/>
</StackPanel>
</materialDesign:DrawerHost.BottomDrawerContent>
</materialDesign:DrawerHost>https://stackoverflow.com/questions/70520516
复制相似问题