Beispiel #1
0
        public void BindToggleClass <T>(BindToggleClassOptions <T> options)
            where T : class, INotifyPropertyChanged
        {
            var key = "class~" + options.ClassName;

            StoreBinding(key, options);
        }
Beispiel #2
0
        public static void BindToggleClass <T>(this Element self, BindToggleClassOptions <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 className = options.ClassName;

            if (string.IsNullOrWhiteSpace(className))
            {
                throw new ArgumentException("ClassName cannot be empty");
            }
            self.Bind(source, x => x.ToggleClass(className, property(source)));
        }
Beispiel #3
0
 /// <summary>
 /// Adds bindings for toggling classes
 /// </summary>
 /// <typeparam name="T">Data type for data source instance</typeparam>
 /// <param name="options">Binding options</param>
 /// <returns>This instance</returns>
 public LaraBuilder BindToggleClass <T>(BindToggleClassOptions <T> options)
     where T : class, INotifyPropertyChanged
 {
     _stack.Peek().BindToggleClass(options);
     return(this);
 }