The code
public SomeListViewModel SearchSomeModel {get;} = new ShowSomeViewModel{...};
gets translated to the equivalent of
private SomeListViewModel _searchSomeModel = new ShowSomeViewModel{...};
public SomeListViewModel SearchSomeModel
{
get
{
return _searchSomeModel;
}
}
the code
public SomeListViewModel SearchSomeModel => new ShowSomeViewModel{...};
gets translated to the equivlant of
public SomeListViewModel SearchSomeModel
{
get
{
return new ShowSomeViewModel{...};
}
}
When using the 2nd form every time you call the property you are getting a new instance of ShowSomeViewModel
, when using the first form you get the same object back each call.
The reason the 2nd form did not work was you where updating the value on the old instance but when you called the property a 2nd time to check the value you where getting a new instance of the view model that did not have your changes.