Custom Control edit template cause compilation failure in Visual Studio 2019 (version 16.7 Preview 2)

Magesh Sankar 31 Reputation points
2020-06-11T03:03:40.413+00:00

In Visual Studio 2019 version 16.7 Preview 2, while try to edit the template of my custom control using Edit Template option in designer which causes compilation failure due to empty properties fields generated. Please find the code genereate details.

Code in our source side

<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="HorizontalContentAlignment" Value="{x:Static HorizontalAlignment.Center}" />

Code generated while edit template

<Setter Property="FocusVisualStyle">
<Setter.Value>
<Null/>
</Setter.Value>
</Setter>

<Setter Property="HorizontalContentAlignment">
<Setter.Value>
<Static/>
</Setter.Value>
</Setter>

The issue reproduce only in Preview version and it working fine previous version.

Project Framework : 4.6v

Error : Severity Code Description Project File Line Suppression State
Error The tag 'Static' does not exist in XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation'. Line 85 Position 22. ControlTesting MainWindow.xaml 85

Please suggest any solution to fix this.

Thanks

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,710 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Leon Laude 85,721 Reputation points
    2020-06-11T08:29:22.113+00:00

    Hi,

    Visual Studio is currently not supported in the Q&A forums, the supported products are listed over here https://learn.microsoft.com/en-us/answers/products (more to be added later on).

    You can ask the experts in the dedicated Visual Studio forum over here:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=visualstudio

    (Please don't forget to accept helpful replies as answer)

    Best regards,
    Leon

    0 comments No comments