public void Initialize (TContentStyle.Mode styleMode) { Populate (styleMode); Select (TStyleInfo.CreateDefault, false); StyleSelectedIndex = StyleItemsSource.IsNull () ? -1 : StyleItemsSource.Count.Equals (0) ? -1 : 0; }
TStyleSelectorModel (TContentStyle.Mode styleMode) : base ( TStyleModelItem.CreateMini (styleMode), TStyleModelItem.CreateSmall (styleMode), TStyleModelItem.CreateLarge (styleMode), TStyleModelItem.CreateBig (styleMode), TStyleModelItem.CreateNone (styleMode) ) { }
void Populate (TContentStyle.Mode styleMode) { StyleItemsSource = new Collection<TStylePropertyItem> { new TStylePropertyItem (styleMode, TContentStyle.Style.mini), new TStylePropertyItem (styleMode, TContentStyle.Style.small), new TStylePropertyItem (styleMode, TContentStyle.Style.large), new TStylePropertyItem (styleMode, TContentStyle.Style.big) }; m_SelectedIndex = -1; }
public void Select (TContentStyle.Mode styleMode, string styleString) { switch (styleMode) { case TContentStyle.Mode.Horizontal: StyleHorizontal.Select (styleString); break; case TContentStyle.Mode.Vertical: StyleVertical.Select (styleString); break; } Size.SelectColumns (TContentStyle.RequestBoardStyleSize (StyleHorizontal.Style)); Size.SelectRows (TContentStyle.RequestBoardStyleSize (StyleVertical.Style)); }
public static int RequestStyleSize(TContentStyle.Mode mode, TContentStyle.Style style) { int size = 0; switch (mode) { case Mode.Horizontal: size = m_HorizontalSizeStyles [style]; break; case Mode.Vertical: size = m_VerticalSizeStyles [style]; break; } return(size); }
public TStylePropertyItem (TContentStyle.Mode styleMode, TContentStyle.Style style) : this () { StyleInfo = TStyleInfo.Create (styleMode); StyleInfo.Select (style); var size = TContentStyle.RequestStyleSize (styleMode, style); switch (styleMode) { case TContentStyle.Mode.Horizontal: Size.Width = size; break; case TContentStyle.Mode.Vertical: Size.Height = size; break; } }
TStyleInfo(TContentStyle.Mode styleMode) : this() { StyleMode = styleMode; Style = TContentStyle.Style.mini; }
public static TStyleInfo Create(TContentStyle.Mode styleMode) => new TStyleInfo(styleMode);
public static TStyleModelItem CreateMini (TContentStyle.Mode styleMode) => new TStyleModelItem (styleMode, TContentStyle.MINI);
public static TStyleSelectorModel Create (TContentStyle.Mode styleMode) => new TStyleSelectorModel (styleMode);
public static TStyleModelItem CreateNone (TContentStyle.Mode styleMode) => new TStyleModelItem (styleMode, TContentStyle.NONE);
public static TStyleModelItem CreateBig (TContentStyle.Mode styleMode) => new TStyleModelItem (styleMode, TContentStyle.BIG);
public static TStyleModelItem CreateLarge (TContentStyle.Mode styleMode) => new TStyleModelItem (styleMode, TContentStyle.LARGE);
public static TStyleModelItem CreateSmall (TContentStyle.Mode styleMode) => new TStyleModelItem (styleMode, TContentStyle.SMALL);
public static string RequestStyleSizeString(TContentStyle.Mode mode, TContentStyle.Style style) { return(RequestStyleSize(mode, style).ToString(CultureInfo.InvariantCulture)); }
protected TStyleItem(TContentStyle.Mode styleMode, string style) : this() { StyleInfo = TStyleInfo.Create(styleMode); StyleInfo.Select(style); }
public TStyleModelItem (TContentStyle.Mode styleMode, string style) : base (styleMode, style) { }