I suggest you ...

XAML refactoring, especially for Rename of properties for Databinding

Currently renaming a property that is databound does NOT rename the binding in the XAML, or the string in the notify property change.

Ex: Currently, When you change MyInt to be something else

Backing ViewModel.cs:

int _myInt;

public int MyInt // Changes
{
get { return _myInt; }
set
{
if (_myInt != value)
{
_myInt = value;
if(PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs("MyInt")); /this String does not change
}
}
}
}

SomeXaml.xaml:
<TextBlock Text={Binding MyInt}/> <!-- This MyInt also does not currently update -->

<!-- Other references in Xaml to MyInt also do not change -->

92 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Jim wallaceJim wallace shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    2 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Julien NJulien N commented  ·   ·  Flag as inappropriate

        I guess this is worse : the code I got had a property named "Width" in the ViewModel, which I renamed to a more appropriate name.
        But it renamed ALL the unrelated Width properties of ALL the XAML files of the project to the new name (except in the databinding, in short it renamed everything that shouldn't be and didn't the only one that should...).

      • Jim wallaceJim wallace commented  ·   ·  Flag as inappropriate

        None of my Xaml showed up, I expect because it looks like HTML tags.

        TextBlock Text={Binding MyInt} // this does not change in XAML, nor does any other reference to MyInt

      Feedback and Knowledge Base