Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio refactor-rename causes inexplicable global replace of attributes in XAML file

I feel like I must be going crazy, but I just changed the name of a property in a view model (a C# file) from Width to Size using Visual Studio's refactor-rename feature. When I was done, this error appeared in the Error window:

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

The error was referring to a XAML UserControl file. When I checked the file to see what was up, I realized that every attribute named Width had been 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 refactor-rename cause a change to a XAML file (besides the x:class value). (Note: I did not do a global find/replace, I did refactor-rename. I undid everything and performed the rename again, and it did the same thing.)

Strangely, it only affected one of several XAML files in my app that has a Width property.

Any explanation what could be going on here?

like image 321
devuxer Avatar asked Oct 21 '11 23:10

devuxer


1 Answers

Looks like this is a bug (that won't be fixed) - Refactor Rename Bug

like image 142
Phil Sandler Avatar answered Nov 04 '22 04:11

Phil Sandler