如何修复 wpf/xaml 中未定义"materialDesign"



我最近在我的WPF项目中添加了材料设计。到目前为止,一切都很好,直到我尝试添加对话框。
https://gyazo.com/13E65442CDD241108FA397BD1C5695E6

我搜索了整个互联网,但找不到解决方案

<StackPanel
  VerticalAlignment="Center">
  <!--the request to open the dialog will bubble up to the top-most DialogHost, but we can used the attached property based event to handle the response -->
  <Button
    Command="{x:Static materialDesign:DialogHost.OpenDialogCommand}"
    materialDesign:DialogHost.DialogClosingAttached="Sample2_DialogHost_OnDialogClosing"
    Width="128">
    <Button.CommandParameter>
      <StackPanel
        Margin="16">
        <ProgressBar
          Style="{DynamicResource MaterialDesignCircularProgressBar}"
          HorizontalAlignment="Center"
          Margin="16"
          IsIndeterminate="True"
          Value="0" />
        <Button
          Style="{StaticResource MaterialDesignFlatButton}"
          IsCancel="True"
          Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
          CommandParameter="Sample2Cancel"
          HorizontalAlignment="Center">
        CANCEL
      </Button>
      </StackPanel>
    </Button.CommandParameter>
  PASS VIEW
</Button>
  <Button
    Command="{x:Static materialDesign:DialogHost.OpenDialogCommand}"
    Width="128"
    Margin="0 32 0 0">
    <Button.CommandParameter>
      <!-- the simplest view model of all, a DateTime. the view can be found in the resources of MainWindow.xaml  -->
      <system:DateTime xmlns:system="clr-namespace:System;assembly=mscorlib">
      1966-JUL-30
    </system:DateTime>
    </Button.CommandParameter>
  PASS MODEL
</Button>
</StackPanel>

获取以下错误:https://gyazo.com/C3038B28C90EBD81C94BEA5A7BC9B671

我希望在材料设计工具包的演示中进行对话框。

https://gyazo.com/435b4136a056784555386848548548c9c6c6c6de

我必须添加:xmlns:materialdesign =" http://materialialdesigninxaml.net/winfx/xaml/themes"在XAML文件的顶部

最新更新