Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enum DependencyProperties fail in Hot Reload #9887

Open
HEIC-to-JPEG-Dev opened this issue Aug 13, 2024 · 0 comments
Open

Enum DependencyProperties fail in Hot Reload #9887

HEIC-to-JPEG-Dev opened this issue Aug 13, 2024 · 0 comments
Labels
area-HotReload bug Something isn't working team-Markup Issue for the Markup team

Comments

@HEIC-to-JPEG-Dev
Copy link

Describe the bug

When a dependency property is an enum and bound to the UI - during live running of the app, any change made to the enum is accepted correctly, but the UI fails (control assumes that property is now null) and the IDE says it cannot convert the enum to a valid entry.

Error message in logs:
Exception thrown at 0x7598A942 in Heic Viewer.exe: Microsoft C++ exception: Microsoft::VisualStudio::DesignTools::UwpTap::LiveMarkup::LiveMarkupError at memory location 0x0077E4DC

Steps to reproduce the bug

public enum MyEnum
{
OptionOne,
OptionTwo,
OptionThree
}

public class MyCustomControl : Control
{
public static readonly DependencyProperty MyEnumProperty =
DependencyProperty.Register(
nameof(MyEnum),
typeof(MyEnum),
typeof(MyCustomControl),
new PropertyMetadata(MyEnum.OptionOne)
);

public MyEnum MyEnum
{
    get { return (MyEnum)GetValue(MyEnumProperty); }
    set { SetValue(MyEnumProperty, value); }
}

public MyCustomControl()
{
    this.DefaultStyleKey = typeof(MyCustomControl);
}

}

Expected behavior

As we don't have a visual designer, the expected behavour is that the live hot reload works, allowing changes to the code/xaml to not require a "close app", recompile, deploy, and run, to test changes.

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.5.5: 1.5.240627000

Windows version

Windows 11 (22H2): Build 22621

Additional context

No response

@HEIC-to-JPEG-Dev HEIC-to-JPEG-Dev added the bug Something isn't working label Aug 13, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Aug 13, 2024
@codendone codendone added team-Markup Issue for the Markup team area-HotReload and removed needs-triage Issue needs to be triaged by the area owners labels Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-HotReload bug Something isn't working team-Markup Issue for the Markup team
Projects
None yet
Development

No branches or pull requests

2 participants