C# 如何从代码运行对话框?
我正在使用材质设计编写一个c#应用程序 以下是我的UserControl的xaml代码:C# 如何从代码运行对话框?,c#,wpf,xaml,material-design,C#,Wpf,Xaml,Material Design,我正在使用材质设计编写一个c#应用程序 以下是我的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.o
<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>
我使用dialog.IsOpen=true获得了要显示的对话框
DialogHost.Show()
?我在DialogHost属性和方法中搜索,没有.Show()或.open()。运行()!我已经试过了,但是没有显示出来,因为就在对话框之后。IsOpen=true;我用来清洁窗户的说明xD这就是为什么我认为它不起作用。。。谢谢,先生:')