SubscriptionExtensionsSubscribeT Method |
Subscribes an action to a specific property that will be called
during that property's OnPropertyChanged event.
Namespace:
Xcalibur.Extensions.MVVM.Extensions
Assembly:
Xcalibur.Extensions.MVVM (in Xcalibur.Extensions.MVVM.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax public static void Subscribe<T>(
this T model,
Expression<Func<T, Object>> property,
Action<Object> onChanged,
Nullable<Guid> ownerId = null
)
where T : ISubscribe
<ExtensionAttribute>
Public Shared Sub Subscribe(Of T As ISubscribe) (
model As T,
property As Expression(Of Func(Of T, Object)),
onChanged As Action(Of Object),
Optional ownerId As Nullable(Of Guid) = Nothing
)
public:
[ExtensionAttribute]
generic<typename T>
where T : ISubscribe
static void Subscribe(
T model,
Expression<Func<T, Object^>^>^ property,
Action<Object^>^ onChanged,
Nullable<Guid> ownerId = nullptr
)
[<ExtensionAttribute>]
static member Subscribe :
model : 'T *
property : Expression<Func<'T, Object>> *
onChanged : Action<Object> *
?ownerId : Nullable<Guid>
(* Defaults:
let _ownerId = defaultArg ownerId null
*)
-> unit when 'T : ISubscribe
Parameters
- model
- Type: T
The model. - property
- Type: System.Linq.ExpressionsExpressionFuncT, Object
The property. - onChanged
- Type: SystemActionObject
The on changed. - ownerId (Optional)
- Type: SystemNullableGuid
The owner identifier.
Type Parameters
- T
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also