Skip to content

UIElementExtensions.Elevation breaks VS designer #5513

Closed

Description

@artemious7

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:

  • Uno.UI
  • Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia
  • Uno.SourceGenerationTasks
  • Uno.UI.RemoteControl / Uno.WinUI.RemoteControl
  • Other:

Nuget Package Version(s):

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Skia
    • WPF
    • GTK (Linux)
    • Tizen
  • Windows
  • Build tasks
  • Solution Templates

IDE:

  • Visual Studio 2017 (version: )
  • Visual Studio 2019 (version: 16.9.2), Version 16.10.0 Preview 1.0
  • Visual Studio for Mac (version: )
  • Rider Windows (version: )
  • Rider macOS (version: )
  • Visual Studio Code (version: )

Relevant plugins:

  • Resharper (version: )

Anything else we need to know?

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

public static void SetElevation(this UIElement element, double elevation)

public static double GetElevation(this UIElement element)

Activity

  1. added
    difficulty/tbd
    kind/bug
    triage/untriaged
    on Mar 18, 2021
  2. added
    difficulty/starter 🚀
    and removed
    difficulty/tbd
    triage/untriaged
    on Jun 10, 2021
  3. Youssef1313 commented on Sep 16, 2021

    @Youssef1313
    Member

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

  4. Youssef1313 commented on May 3, 2023

    @Youssef1313
    Member

    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? microsoft/microsoft-ui-xaml#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.

  5. changed the title [-]UIElementExtensions.Elevation breaks VS designer[/-] [+]`UIElementExtensions.Elevation` breaks VS designer[/+] on Jul 10, 2023
  6. MartinZikmund commented on Jul 10, 2023

    @MartinZikmund
    Member

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

  7. added
    triage/potentially-fixed
    on Jul 10, 2023
  8. jeromelaban commented on Jul 11, 2023

    @jeromelaban
    Member

    Yes, let's close for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty/starter 🚀kind/bugtriage/potentially-fixed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions