尝试HeaderedTextBlock
中的UWP-Community-toolkit
控件,我得到了
'System.TypeLoadException' occurred in Microsoft.Toolkit.Uwp.UI.Controls.dll
Additional information: Could not find Windows Runtime type 'Windows.UI.Composition.DropShadow'.
栈跟踪
at Microsoft.Toolkit.Uwp.UI.Controls.Microsoft_Toolkit_Uwp_UI_Controls_XamlTypeInfo.XamlTypeInfoProvider.InitTypeTables()
at Microsoft.Toolkit.Uwp.UI.Controls.Microsoft_Toolkit_Uwp_UI_Controls_XamlTypeInfo.XamlTypeInfoProvider.LookupTypeIndexByName(String typeName)
at Microsoft.Toolkit.Uwp.UI.Controls.Microsoft_Toolkit_Uwp_UI_Controls_XamlTypeInfo.XamlTypeInfoProvider.GetXamlTypeByName(String typeName)
at Microsoft.Toolkit.Uwp.UI.Controls.Microsoft_Toolkit_Uwp_UI_Controls_XamlTypeInfo.XamlMetaDataProvider.GetXamlType(String fullName)
at Test_uwp.Test_uwp_XamlTypeInfo.XamlTypeInfoProvider.CheckOtherMetadataProvidersForName(String typeName)
at Test_uwp.Test_uwp_XamlTypeInfo.XamlTypeInfoProvider.GetXamlTypeByName(String typeName)
at Test_uwp.App.GetXamlType(String fullName)
其中
typeName
:Windows.UI.Composition.DropShadow
和
fullName
:Microsoft.Toolkit.Uwp.UI.Controls.HamburgerMenu
HamburgerMenu
甚至来自哪里?
MainPage.xaml中
<Page
x:Class="Test_uwp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Test_uwp"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
mc:Ignorable="d">
<Grid>
<controls:HeaderedTextBlock
Header="Name"
Text="UWP Toolkit"
Orientation="Vertical"
Margin="20,10,0,0" />
</Grid>
</Page>
MainPage.xaml.cs中
namespace Test_uwp
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
}
}
RadialGuage
我得到了同样的例外
工具包版本:1.2.0
答案 0 :(得分:1)
我按照getting Started with the UWP Toolkit page设置了uwp社区工具包。它在我身边运作良好。
请检查您的环境是否符合要求:
您也可以在您身边运行source code sample,如果环境没有问题,它应该有效。
如果您对此问题有任何其他疑虑,请随时告诉我。