microsoft / microsoft/microsoft-ui-xaml
Community Toolkit in WPF XAML ISLAND, XAML parsing failed.
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
I am crossreferencing this bug: https://github.com/CommunityToolkit/Windows/issues/744
When I try to use community toolkit in XAML, the parsing of file fails:
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
### 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?
Contributor guide
Research direction
Clone the linked WPF_XAML_Islands_WinUI3 reproduction and start with the OnLaunched initialization shown in the issue, including XamlControlsXamlMetaDataProvider and merged resources. Add the Segmented package and control as described, then determine whether the parsing failure comes from the Community Toolkit or WinUI XAML Islands; done means the ownership and required initialization are established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100