我正在使用材料設計對ac#應用程序進行編碼這是我的UserControl的xaml代碼:<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:MediCare" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" x:Name="Usc1" " mc:Ignorable="d" Height="900" Width="600"><materialDesign:DialogHost x:Name="Dialog" > <materialDesign:DialogHost.DialogContent> <Grid Width="300" Height="100"> <TextBlock Text="DIALOG TEST"/> <Button Command="{x:StaticmaterialDesign:DialogHost.CloseDialogCommand}" Content="CloseDialog"/> </Grid> </materialDesign:DialogHost.DialogContent> <Grid> <Button Command="{x:Static materialDesign:DialogHost.OpenDialogCommand}" Content="CloseDialog" /> </Grid></materialDesign:DialogHost>我有一個帶有命令的按鈕Command="{x:Static materialDesign:DialogHost.OpenDialogCommand}"來打開我的對話框,但是我的目的是通過.xaml.cs打開它,我該怎么辦?
添加回答
舉報
0/150
提交
取消