我在用戶控件庫中構建了一個用戶控件,我想將它包含到我的Windows通用應用程序中。我記得在過去你不得不爲app.xaml添加一些東西(比如pack://這是我的xaml)。Windows通用應用程序UI庫解析器內部錯誤
所以我的想法(或希望)我只包括我的圖書館和用戶的控制。當我這樣做時 - 解析器內部錯誤:對象編寫器'xClassNotDerivedFromElement'。
我試着將它添加爲App.Xaml中的msappx引用,但我可能有語法錯誤。如果我可以通過將代碼本身複製到我的項目(我不想這麼做)來實現這一目標。建議? 感謝
編輯:添加源代碼
public MainPage()
{
_webControl = new NativeWebView.WebUserControl();
_webControl.Loaded += _webControl_Loaded;
_contentView = new NativeWebView.ContentView(_webControl);
this.InitializeComponent();
root.Children.Add(_webControl);
}
public sealed partial class WebUserControl : UserControl, IWebView
{
public WebUserControl()
{
this.InitializeComponent();
}
}
我會添加一些源代碼。 – MrSteamfist