9using System.Collections.Generic;
22 private readonly Activity _activity;
37 public List<Binding>
Bindings {
get;
private set; }
46 public void Add(
int viewId,
string targetProperty,
object source,
string sourceProperty)
48 var target = _activity.FindViewById(viewId);
49 Add(target, targetProperty, source, sourceProperty);
59 public void Add(View target,
string targetProperty,
object source,
string sourceProperty)
61 Add(
new Binding(target, targetProperty, source, sourceProperty));
81 public void Remove(View target,
string targetProperty,
object source,
string sourceProperty)
83 var binding =
Bindings.FirstOrDefault(r => ReferenceEquals(r.Target, target) &&
84 r.TargetProperty.Name == targetProperty &&
85 ReferenceEquals(r.Source, source) &&
86 r.SourceProperty.Name == sourceProperty);
106 for (var i =
Bindings.Count - 1; i >= 0; i--)
119 return Bindings.Where(r => ReferenceEquals(r.Target, view));
137 var view = _activity.CurrentFocus;
Contains an individual binding to tie a property on an Axml view to the property on a supplied object...
object Source
The object that the view is bound to.
System.Reflection.PropertyInfo SourceProperty
The PropertyInfo for the property on the source object that is being bound to.
View Target
The Axml view that is used by the binding.
void Dispose()
Clears the bindings, references and event handlers.
System.Reflection.PropertyInfo TargetProperty
The PropertyInfo for the property on the target view that is being bound to.
Provides the ability to bing properties on Axml controls to properties on CSLA objects.
void Remove(View target, string targetProperty, object source, string sourceProperty)
Removes the binding matching the supplied parameters from the binding manager.
void Add(int viewId, string targetProperty, object source, string sourceProperty)
Adds a new binding to be managed.
void Remove(Binding binding)
Removes the supplied binding from the binding manager.
void UpdateSourceForView(View view)
Updates bindings with the current values in the supplied view.
void Add(Binding binding)
Adds a new binding to be managed.
void Add(View target, string targetProperty, object source, string sourceProperty)
Adds a new binding to be managed.
IEnumerable< Binding > GetBindingsForView(View view)
Returns all bindings for the supplied view.
void UpdateSourceForLastView()
Updates bindings on the view that is in current focus on the activity supplied to the BindingManager.
List< Binding > Bindings
A list of bindings that have been added to the manager.
void RemoveAll()
Removes all bindings from the binding manager.
BindingManager(Activity activity)
Creates a new instance of the binding manager.
string Name
Gets the property name value.