Exemple #1
0
 /// <summary>
 /// Adds bindings for the children collection
 /// </summary>
 /// <typeparam name="T">Type of elements in the ovservable collection</typeparam>
 /// <param name="collection">Observable collection</param>
 /// <param name="creator">Handler to create elements</param>
 /// <returns>This instance</returns>
 public LaraBuilder BindChildren <T>(ObservableCollection <T> collection, Func <Element> creator)
 {
     BindingExtensions.BindChildren(_stack.Peek(), collection, _ => creator());
     return(this);
 }
Exemple #2
0
 /// <summary>
 /// Executes code whenever the element triggers the PropertyChanged event
 /// </summary>
 /// <param name="onChange"></param>
 /// <returns></returns>
 public LaraBuilder BindBack(Action <Element> onChange)
 {
     BindingExtensions.BindBack(_stack.Peek(), onChange);
     return(this);
 }
Exemple #3
0
 /// <summary>
 /// Updates the element's children collection based on an observable collection
 /// </summary>
 /// <typeparam name="TValue"></typeparam>
 /// <param name="source"></param>
 /// <param name="childFactory"></param>
 /// <returns></returns>
 public LaraBuilder BindChildren <TValue>(ObservableCollection <TValue> source, Func <TValue, Element> childFactory)
 {
     BindingExtensions.BindChildren(_stack.Peek(), source, childFactory);
     return(this);
 }
Exemple #4
0
 /// <summary>
 /// Executes code whenever a source object triggers the PropertyChanged event
 /// </summary>
 /// <param name="source"></param>
 /// <param name="onSourceChange"></param>
 /// <returns></returns>
 public LaraBuilder Bind(INotifyPropertyChanged source, Action <Element> onSourceChange)
 {
     BindingExtensions.Bind(_stack.Peek(), source, onSourceChange);
     return(this);
 }