Microsoft.UI.Xaml.Media.PointCollection throws TypeLoadException
See original GitHub issueDescribe the bug You cannot create a Polygon from code. XAML works. App throws: TypeLoadException: Could not load type ‘ABI.Windows.Foundation.Point’ from assembly ‘Microsoft.WinUI, Version=3.0.0.0, Culture=neutral, PublicKeyToken=de31ebe4ad15742b’.
Steps to reproduce the bug
var polygon = new Microsoft.UI.Xaml.Shapes.Polygon();
polygon.Points.Add(new Point(10, 110));
var collection = new Microsoft.UI.Xaml.Media.PointCollection();
Steps to reproduce the behavior:
- Create new Blank App, Packaged with WAP (WinUI 3 in Desktop).
- Open MainWindow.xaml.cs.
- Create polygon with points.
- Run code
Expected behavior
The code should work like xaml
<Polygon Points="10,110 60,10 110,110" Fill="Blue" />
Screenshots
Version Info
NuGet package version: Microsoft.WindowsAppSDK.WinUI 1.0.0-experimental1
Windows app type:
UWP | Win32 |
---|---|
Yes |
Windows version | Saw the problem? |
---|---|
Insider Build (xxxxx) | |
May 2021 Update (19043) | Yes |
October 2020 Update (19042) | |
May 2020 Update (19041) | |
November 2019 Update (18363) | |
May 2019 Update (18362) | |
October 2018 Update (17763) | |
April 2018 Update (17134) | |
Fall Creators Update (16299) | |
Creators Update (15063) |
Device form factor | Saw the problem? |
---|---|
Desktop | <Yes |
Xbox | |
Surface Hub | |
IoT |
Additional context
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:6 (4 by maintainers)
Top Results From Across the Web
PointCollection Class (Windows.UI.Xaml.Media)
Represents a collection of Point values that can be individually accessed by index.
Read more >TypeLoadException Class (System)
TypeLoadException is thrown when the common language runtime cannot find the assembly, the type within the assembly, or cannot load the type.
Read more >PointCollection Class (Microsoft.UI.Xaml.Media)
Represents a collection of Point values that can be individually accessed by index.
Read more >SystemBackdrop Class (Microsoft.UI.Xaml.Media)
Base class for custom system backdrops used to render materials like Mica and Acrylic.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This issue seems fixed in WinUI 0.8.5
As I said: CsWinRT has fixed this, but no update has been released yet. Feel free to upvote that discussion I linked.