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

            self.Bind(source, x => x.SetFlagAttributeLower(attribute, property(source)));
        }
示例#2
0
 public static void BindFlagAttribute <T>(this Element self, BindFlagAttributeOptions <T> options)
     where T : class, INotifyPropertyChanged
 {
     self.BindToggleAttribute(options);
 }
示例#3
0
 /// <summary>
 /// Adds bindings for a flag attribute
 /// </summary>
 /// <typeparam name="T">Data type for data source instance</typeparam>
 /// <param name="options">Binding options</param>
 /// <returns>This instance</returns>
 public LaraBuilder BindToggleAttribute <T>(BindFlagAttributeOptions <T> options)
     where T : class, INotifyPropertyChanged
 {
     _stack.Peek().BindToggleAttribute(options);
     return(this);
 }
示例#4
0
 public void BindFlagAttribute <T>(BindFlagAttributeOptions <T> options)
     where T : class, INotifyPropertyChanged
 {
     StoreBinding(options.Attribute, options);
 }
示例#5
0
 public LaraBuilder BindFlagAttribute <T>(BindFlagAttributeOptions <T> options)
     where T : class, INotifyPropertyChanged
 {
     return(BindToggleAttribute(options));
 }