I have the following code:
public interface IMyInterface
{
DataGrid ItemsInGrid { get; set; }
}
partial public class MyClass: Window, IMyInterface
{
public DataGrid ItemsInGrid
{
get { return grdItemsInGrid}
set { grdItemsInGrid= value; }
}
}
In a Different file:
partial public class MyClass: Window
{
private System.Windows.Forms.DataGrid grdItemsInGrid;
// Reference to private variable here
// This is the designer portion that actually sets up the
// private variable to be shown on the form.
}
Now resharper wants me to convert ItemsInGrid
to an autoproperty (public DataGrid ItemsInGrid{ get; set; }
)
How can this be an equal transformation? An autoproperty would create a hidden backing variable that would not match up to the private grdItemsInGrid
right?
Is resharper broken? or is there something in C#.NET that I am not aware of?
EDIT: I am sensing a common miss-communication here. grdItemsInGrid is a grid that is displayed on a form (MyClass actually implements Window). The idea is to grant access to grdItemsInGrid to scenarios where MyClass is passed as an IMyInterface to a method.