Exemple #1
0
 public void BindHandler <T>(BindHandlerOptions <T> options)
     where T : class, INotifyPropertyChanged
 {
     UnbindHandler();
     BindOptions(options);
     _genericHandler = options;
 }
Exemple #2
0
        public static void Bind <T>(this Element self, BindHandlerOptions <T> options)
            where T : class, INotifyPropertyChanged
        {
            options = options ?? throw new ArgumentNullException(nameof(options));
            var handler = options.ModifiedHandler ?? throw new ArgumentNullException(nameof(options.ModifiedHandler));
            var source  = options.BindObject ?? throw new ArgumentNullException(nameof(options.BindObject));

            self.Bind(source, _ => handler(source, self));
        }
Exemple #3
0
 /// <summary>
 /// Associates the current element with a data source and an action to update the element whenever the source is modified
 /// </summary>
 /// <typeparam name="T">Type of the data source</typeparam>
 /// <param name="options">Binding options</param>
 /// <returns>This instance</returns>
 public LaraBuilder Bind <T>(BindHandlerOptions <T> options)
     where T : class, INotifyPropertyChanged
 {
     _stack.Peek().Bind(options);
     return(this);
 }