unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
8.87k stars 716 forks source link

`UIElementExtensions.Elevation` breaks VS designer #5513

Closed artemious7 closed 1 year ago

artemious7 commented 3 years ago

Current behavior

When setting UIElementExtensions.Elevation attached property for an element, the Visual Studio designer shows an error, but it compiles fine and works fine in a running app.

image

Expected behavior

The VS designer must show the rendered XAML.

How to reproduce it (as minimally and precisely as possible)

App4.zip

Set Elevation, build the UWP project, see the error in the VS designer.

Workaround

Set UIElementExtensions.Elevation via code-behind or don't use it at all.

Environment

Nuget Package:

Nuget Package Version(s):

Affected platform(s):

IDE:

Relevant plugins:

Anything else we need to know?

To fix this, just remove this in this UIElement element. VS doesn't like these are extension methods.

https://github.com/unoplatform/uno/blob/a6bb7ecaceb1908172a896733c74871ca261a799/src/Uno.UI.Toolkit/UIElementExtensions.cs#L30

https://github.com/unoplatform/uno/blob/a6bb7ecaceb1908172a896733c74871ca261a799/src/Uno.UI.Toolkit/UIElementExtensions.cs#L35

Youssef1313 commented 3 years ago

Instead of introducing a breaking change, why this is not considered a bug in VS designer?

Youssef1313 commented 1 year ago

The designer isn't working at all for me in a plain new UWP project:

image

Also it looks like WinUI doesn't even support a designer yet? https://github.com/microsoft/microsoft-ui-xaml/issues/5917

It's worth noting that the code doesn't give IntelliSense warnings:

image

In the issue, it used to have a squiggly warning, so something might have already been fixed in Visual Studio.

MartinZikmund commented 1 year ago

So maybe this can be closed now? The designer is not even planned for WinUI so far...

jeromelaban commented 1 year ago

Yes, let's close for now.