Beispiel #1
0
 private static T Element <T, TValue>(this ValuesInitializer @this) where T : BindableObject
 {
     if (@this.Object == null)
     {
         throw new ArgumentNullException(nameof(@this));
     }
     else if (@this.Object is T element)
     {
         return(element);
     }
     else
     {
         throw new ArgumentException($"Cannot assign {typeof(TValue)} value to {@this.Object.GetType()}. {typeof(T)} element is required.", nameof(@this));
     }
 }
Beispiel #2
0
 public static void Add(this ValuesInitializer @this, Visibility value) =>
 @this.Element <Element, Visibility>().Visibility = value;
Beispiel #3
0
 public static void Add(this ValuesInitializer @this, TextWrap value) =>
 @this.Element <BlockElement, TextWrap>().TextWrap = value;
Beispiel #4
0
 public static void Add(this ValuesInitializer @this, VerticalAlign value) =>
 @this.Element <BlockElement, VerticalAlign>().VerticalAlign = value;
Beispiel #5
0
 public static void Add(this ValuesInitializer @this, TextAlign value) =>
 @this.Element <BlockElement, TextAlign>().TextAlign = value;
Beispiel #6
0
 public static void Add(this ValuesInitializer @this, GridLength value) =>
 @this.Element <Column, GridLength>().Width = value;
Beispiel #7
0
 public static void Add(this ValuesInitializer @this, DockTo value) =>
 @this.Element <BlockElement, DockTo>().SetValue(Dock.ToProperty, value);
Beispiel #8
0
 public static void Add(this ValuesInitializer @this, ConsoleColorExts.ConsoleColorOnBackground value)
 {
     @this.Element <Element, ConsoleColorExts.ConsoleColorOnBackground>().Color      = value.Color;
     @this.Element <Element, ConsoleColorExts.ConsoleColorOnBackground>().Background = value.Background;
 }
Beispiel #9
0
 public static void Add(this ValuesInitializer @this, ConsoleColor value) =>
 @this.Element <Element, Align>().Color = value;