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

            StoreBinding(key, options);
        }
Ejemplo n.º 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)));
        }
Ejemplo n.º 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);
 }