示例#1
0
        public static void BindAttribute <T>(this Element self, BindAttributeOptions <T> options)
            where T : class, INotifyPropertyChanged
        {
            var source    = options.BindObject ?? throw new ArgumentNullException(nameof(options.BindObject));
            var property  = options.Property ?? throw new ArgumentNullException(nameof(options.Property));
            var attribute = options.Attribute;

            self.Bind(source, x => x.SetAttribute(attribute, property(source)));
        }
示例#2
0
 public void BindAttribute <T>(BindAttributeOptions <T> options)
     where T : class, INotifyPropertyChanged
 {
     StoreBinding(options.Attribute, options);
 }
示例#3
0
 /// <summary>
 /// Adds bindings for an attribute
 /// </summary>
 /// <typeparam name="T">Data type for data source instance</typeparam>
 /// <param name="options">Binding options</param>
 /// <returns>This instance</returns>
 public LaraBuilder BindAttribute <T>(BindAttributeOptions <T> options)
     where T : class, INotifyPropertyChanged
 {
     _stack.Peek().BindAttribute(options);
     return(this);
 }