Visual Studio refactor-rename causes an inexplicable global attribute replacement in a XAML file

It seems to me that I should go crazy, but I just changed the name of the property in the view model (C # file) from Width to Size using the Visual Studio rename refactoring function. When I finished, this error appeared in the "Error" window:

Error 2: The "Size" property does not exist in the XML namespace "http://schemas.microsoft.com/winfx/2006/xaml/presentation".

The error is related to the XAML UserControl file. When I checked the file to find out what happened, I realized that each attribute named Width was changed to Size .

Example:

 <UserControl x:Class="ApbSymbolGenerator.Views.Symbol" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" Size="{Binding Size}" Height="{Binding Size}"> 

This is the first time I've ever had a refactoring rename that caused a change in the XAML file (except for the x:class value). (Note: I didn’t do a global find / replace, I redid the refactoring. I unzipped everything and did the renaming again, and he did the same.)

Strange, this only affected one of the few XAML files in my application that has the Width property.

Any explanation of what could happen here?

+6
source share
1 answer

It seems like this is a bug (this will not be fixed) - Refactor Rename Bug

+5
source

Source: https://habr.com/ru/post/899836/


All Articles