My view model is bound to an object from a WCF service. When using the ObservableObject.Set<>
. I get the following error:
// Error: A property or indexer may not be passed as an out or ref parameter.
public string SomeProperty
{
get { return _wcfObject.SomeProperty; }
set { Set(nameof(SomeProperty), ref _wcfObject.SomeProperty, value); }
}
Now obviously I can't do this, and these attempted workarounds don't work.
// Error: } expected
public string SomeProperty
{
get { return _wcfObject.SomeProperty; }
set {
ref string v = _wcfObject.SomeProperty;
Set(nameof(SomeProperty), ref v, value);
}
}
// Compiles, but property not updated.
public string SomeProperty
{
get { return _wcfObject.SomeProperty; }
set {
var v = _wcfObject.SomeProperty;
Set(nameof(SomeProperty), ref v, value);
}
}
How do I make this work with MVVMLight without having to wrap the object from the WCF service?