HELP ! - with syntax and lines etc.
Posted: Tue Feb 14, 2017 1:32 pm
Hi Frank, hi Phil,
really my ViewModel properties look different:
because I have a base class with the following code from which all ViewModel classes inherit:
Wolfgang
really my ViewModel properties look different:
Code: Select all
property Value1 as string
get
return super:_Get<string>()
end get
set
super:_Set<string>( value )
end set
end property
because I have a base class with the following code from which all ViewModel classes inherit:
Code: Select all
public abstract class BindableBase implements INotifyPropertyChanged
protect _properties := Dictionary<string, object>{} as Dictionary<string, object>
public event PropertyChanged as PropertyChangedEventHandler
protected method _Get<T>( [CallerMemberName] name := null as string ) as T
local value := null as object
if _properties.TryGetValue( name, out value )
if value == null
return Default(T)
else
return (T) value
endif
endif
return Default(T)
protected method _Set<T>( value as T, [CallerMemberName] name := null as string ) as void
if ( Equals( value, _Get<T>(name) ) )
return
endif
_properties[name] := value
OnPropertyChanged( name )
return
protected virtual method OnPropertyChanged([CallerMemberName] propertyName := null as string ) as void
local handler as PropertyChangedEventHandler
handler := self:PropertyChanged
if handler != null
handler( self, PropertyChangedEventArgs{ propertyName } )
endif
return
end class