Skip to content

Community Toolkit in WPF XAML ISLAND, XAML parsing failed. #10884

@TekuSP

Description

@TekuSP

Describe the bug

I am crossreferencing this bug: CommunityToolkit/Windows#744
When I try to use community toolkit in XAML, the parsing of file fails:

Image

I initialize resources like this:

protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
{
    XamlControlsXamlMetaDataProvider.Initialize();
    xamlMetaDataProvider = new();
    this.Resources.MergedDictionaries.Add(new Microsoft.UI.Xaml.Controls.XamlControlsResources());
    //this.Resources.MergedDictionaries.Add(new Microsoft.UI.Xaml.ResourceDictionary() { Source = new Uri("ms-appx:///CommunityToolkit.WinUI.Controls.Segmented/Themes/Generic.xaml") });

}

Its possible I am initializing XAML Islands wrongly, there is not much documentation for that.

Why is this important?

This prevents me from launching any Control using external libraries?

Steps to reproduce the bug

https://github.com/castorix/WPF_XAML_Islands_WinUI3/tree/master

Clone this repo, update to newest WinUI SDK, add CommunityToolkit.WinUI.Segmented and add Segmented. Same issue.

Actual behavior

Image

Expected behavior

It should load

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.8.3: 1.8.251106002

Windows version

Windows 10 (21H2): Build 19044

Additional context

Is issue in Community Toolkit or WinUI XAML Islands, or my init?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-IslandsXaml Islands featurebugSomething isn't workingdocumentationAn issue with existing documentation or a request for documenation of a new topic

    Type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions