Class BindingSession<TViewModel>
Definition
- Assembly:
- Tizen.NUI.dll
BindingSession class provides a mechanism for binding properties of a view model to a view.
public class BindingSession<TViewModel> : INotifyPropertyChanged, IDisposable
- Inheritance
-
objectBindingSession<TViewModel>
- Implements
-
IDisposable
Properties
View SourceViewModel
Gets or sets the view model.
Declaration
public TViewModel ViewModel { get; set; }
Property Value
| Type | Description |
|---|---|
| TViewModel |
Methods
View SourceAddBinding(Action<TViewModel>, string)
Adds a binding between a property of the view model and a property of the view.
Declaration
public void AddBinding(Action<TViewModel> setter, string path)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<><TViewModel> | setter | The setter method of the view. |
| string | path | The path of the property to bind. |
AddTwoWayBinding<T>(Action<Action>, Action<Action>, Action<TViewModel>, Func<T>, string)
Adds a two-way binding between a property of the view model and a property of the view.
Declaration
public void AddTwoWayBinding<T>(Action<Action> register, Action<Action> unregister, Action<TViewModel> setter, Func<T> getter, string path)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<><Action> | register | The registration method of the observer. |
| Action<><Action> | unregister | The unregistration method of the observer. |
| Action<><TViewModel> | setter | The setter method of the view. |
| Func<><T> | getter | The getter method of the view. |
| string | path | The path of the property to bind. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the property to bind. |
ClearBinding()
Clears all bindings.
Declaration
public void ClearBinding()
Dispose()
Releases all resources used by the current instance of the BindingSession class.
Declaration
public void Dispose()
Dispose(bool)
Provides a mechanism for releasing unmanaged resources used by the BindingSession class.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing | True if the method is called from Dispose, false if it is called from the finalizer. |
GetValue(string)
Gets the value of a property of the view model.
Declaration
public object GetValue(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the property. |
Returns
| Type | Description |
|---|---|
| object | The value of the property. |
SetValue(object, string)
Sets the value of a property of the view model.
Declaration
public void SetValue(object obj, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The value to set. |
| string | name | The name of the property. |
UpdateViewModel()
Updates the view model.
Declaration
public void UpdateViewModel()
UpdateViewModel(TViewModel)
Updates the view model.
Declaration
public void UpdateViewModel(TViewModel vm)
Parameters
| Type | Name | Description |
|---|---|---|
| TViewModel | vm | The view model to update. |
Events
View SourcePropertyChanged
Represents an event that is raised when a property value changes.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
| Type | Description |
|---|---|
| PropertyChangedEventHandler |