Convert to Property with Backing Store

Converts an unimplemented property to a property with a backing store.

Availability

From the context menus or via shortcuts:

  • when the edit cursor or caret is on an unimplemented property declaration. The property should have a getter and a setter declared, but not implemented.

Notes

This code provider is the opposite of Convert to Auto-implemented Property (C#).

Example

public int TestProperty
{
    get
    {

    }
    set
    {

    }
}
Public Property TestProperty() As Integer
    Get

    End Get
    Set(ByVal value As Integer)

    End Set
End Property

Result:

private int _TestProperty;
public int TestProperty
{
    get
    {
        return _TestProperty;
    }
    set
    {
        _TestProperty = value;
    }
}
Private _testProperty As Integer
Public Property TestProperty() As Integer
    Get
        Return _testProperty
    End Get
    Set(ByVal value As Integer)
        _testProperty = value
    End Set
End Property