I building a control for my UWP application where I needed the community toolskit's Expander control, but I had this error: XDG0066 Unspecified error

Issue

I’m trying to create control that contains an expander which should be available for my application as I dowloaded the necessary packages, I suspected that it is my windows build version because many other controls don’t work eather, I just get error : "XDG0066 Unspecified error".

Code:

<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>

Solution

but I had this error: XDG0066 Unspecified error

The problem looks you have missed XamlControlsResources for current Application Resources. please add the following into App.xaml file

<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>

It will solve the problem.

Answered By – Nico Zhu – MSFT

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published