3 namespace Tizen.NUI.Binding
5 [TypeConverter(typeof(LayoutOptionsConverter))]
6 internal struct LayoutOptions
10 public static readonly LayoutOptions Start = new LayoutOptions(LayoutAlignment.Start, false);
11 public static readonly LayoutOptions Center = new LayoutOptions(LayoutAlignment.Center, false);
12 public static readonly LayoutOptions End = new LayoutOptions(LayoutAlignment.End, false);
13 public static readonly LayoutOptions Fill = new LayoutOptions(LayoutAlignment.Fill, false);
14 public static readonly LayoutOptions StartAndExpand = new LayoutOptions(LayoutAlignment.Start, true);
15 public static readonly LayoutOptions CenterAndExpand = new LayoutOptions(LayoutAlignment.Center, true);
16 public static readonly LayoutOptions EndAndExpand = new LayoutOptions(LayoutAlignment.End, true);
17 public static readonly LayoutOptions FillAndExpand = new LayoutOptions(LayoutAlignment.Fill, true);
19 public LayoutOptions(LayoutAlignment alignment, bool expands)
21 var a = (int)alignment;
23 throw new ArgumentOutOfRangeException();
24 _flags = (int)alignment | (expands ? (int)LayoutExpandFlag.Expand : 0);
27 public LayoutAlignment Alignment
29 get { return (LayoutAlignment)(_flags & 3); }
30 set { _flags = (_flags & ~3) | (int)value; }
35 get { return (_flags & (int)LayoutExpandFlag.Expand) != 0; }
36 set { _flags = (_flags & 3) | (value ? (int)LayoutExpandFlag.Expand : 0); }