我正在嘗試創建包含擴展器的控制元件,當我下載必要的包時,它應該可用于我的應用程式,我懷疑這是我的 Windows 構建版本,因為許多其他控制元件不起作用,我只是得到錯誤:“ XDG0066 未指定的錯誤”。
代碼:
<UserControl
x:Class="Swiftry.MyUserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="White">
<ScrollViewer>
<controls:Expander>
</controls:Expander>
</ScrollViewer>
</Grid>
</UserControl>
uj5u.com熱心網友回復:
但我有這個錯誤:XDG0066 Unspecified error
這個問題看起來你錯過XamlControlsResources了當前的應用程式資源。請將以下內容添加到 App.xaml 檔案中
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
它將解決問題。
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/491388.html
