Home > OS >  I building a control for my UWP application where I needed the community toolskit's Expander co
I building a control for my UWP application where I needed the community toolskit's Expander co

Time:06-14

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>

CodePudding user response:

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.

  • Related