Skip to content

Latest commit

 

History

History
90 lines (70 loc) · 1.8 KB

File metadata and controls

90 lines (70 loc) · 1.8 KB

Overview

I need some refractors as used at [Original]https://github.com/NeVeSpl/CodeRefactoringsForVisualStudio However, these should full fill the following points:

  1. work with SetProperty from Prism
  2. shorten the property text
  3. keep the DataAnnotations
  4. use the notation stored in Visual Studio for the private variables

1. Convert To full prism property

From

      public string SomeProperty { get; set; }  

To

 private string _someProperty;

 public string SomeProperty
        {
            get
            {
                return _someProperty;
            }

            set
            {
                SetProperty(ref _someProperty, value);
            }
        }

It works.

2. shorten the property text

I want to bring the Code from:

 private string _someProperty;

 public string SomeProperty
        {
            get
            {
                return _someProperty;
            }

            set
            {
                SetProperty(ref _someProperty, value);
            }
        }

To

   private string _someProperty;

   public string SomeProperty
        {
            get{return _someProperty;}
            set{SetProperty(ref _someProperty, value);}
        }

But at now, it does't work

2. keep the data annotations

From

      [Required]
      public string SomeProperty { get; set; }  

To

   private string _someProperty;
   
   [Required]
   public string SomeProperty
        {
            get{return _someProperty;}
            set{SetProperty(ref _someProperty, value);}
        }

But at now, it does't work