0
中序使用mahapp自定義對話框,我添加了一個新的窗口,我的項目,然後替換從下面的代碼XAML文件:mahapp自定義對話框 - 錯誤在WPF表示
<Dialog:CustomDialog x:Class="GUIcode.Main_Window"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Closing="Window_Closing"
Loaded="Window_Opening"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:Dialog="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro"
>
<textbox/>
</Dialog:CustomDialog>
後來我升C代碼
using MahApps.Metro.Controls;
using MahApps.Metro.Controls.Dialogs;
private void Window_Opening(object sender, RoutedEventArgs e)
{
this.ShowLoginDialog();
}
public async void ShowLoginDialog()
{
DiagnosticDialog diag_dialog = new DiagnosticDialog();
await this.ShowMetroDialogAsync(diag_dialog);
}
然而,有一個持續的錯誤指示說: 類型「對話框:CustomDialog」沒有被發現。驗證你是否誤認爲一個程序集引用,並且所有引用的程序集都已經構建完成。
MahApps.Metro.Controls.Dialogs存在於refernece組件。我不明白這個問題究竟在哪裏?