public void SetLayout(IObjectLayout layout) { if (!(layout is LinearLayout)) { return; } if (linearLayout == layout as ObjectLinearLayout) { return; } linearLayout = layout as ObjectLinearLayout; // CellPadding cellPaddingW.Text = linearLayout.CellPadding.Width.ToString(); cellPaddingH.Text = linearLayout.CellPadding.Height.ToString(); linearLayout.CellPaddingChanged += (object sender, CellPaddingChangedEventArgs args) => { cellPaddingW.Text = args.CellPadding.Width.ToString(); cellPaddingH.Text = args.CellPadding.Height.ToString(); linearLayout.RequestLayout(); }; linearLayout.RequestLayout(); }
private void VAlignTopSelectedChanged(object sender, SelectedChangedEventArgs args) { if (args.IsSelected) { if (linearLayout != null) { linearLayout.VerticalAlignment = VerticalAlignment.Top; linearLayout.RequestLayout(); } } }
private void LinearOrientHSelectedChanged(object sender, SelectedChangedEventArgs args) { if (args.IsSelected) { if (linearLayout != null) { linearLayout.LinearOrientation = LinearLayout.Orientation.Horizontal; linearLayout.RequestLayout(); } } }
private void HAlignBeginSelectedChanged(object sender, SelectedChangedEventArgs args) { if (args.IsSelected) { if (linearLayout != null) { linearLayout.HorizontalAlignment = HorizontalAlignment.Begin; linearLayout.RequestLayout(); } } }
private void CellPaddingWTextChanged(object sender, TextField.TextChangedEventArgs args) { if (linearLayout != null) { int changedValue; if (int.TryParse(args.TextField.Text, out changedValue)) { linearLayout.CellPadding = new Size2D(changedValue, linearLayout.CellPadding.Height); linearLayout.RequestLayout(); } } }
public void SetLayout(IObjectLayout layout) { if (!(layout is LinearLayout)) { return; } if (linearLayout == layout as ObjectLinearLayout) { return; } linearLayout = layout as ObjectLinearLayout; // VerticalAlignment if (linearLayout.VerticalAlignment == VerticalAlignment.Top) { vAlignTop.IsSelected = true; } else if (linearLayout.VerticalAlignment == VerticalAlignment.Center) { vAlignCenter.IsSelected = true; } else { vAlignBottom.IsSelected = true; } linearLayout.VerticalAlignmentChanged += (object sender, VerticalAlignmentChangedEventArgs args) => { if (args.VerticalAlignment == VerticalAlignment.Top) { vAlignTop.IsSelected = true; } else if (args.VerticalAlignment == VerticalAlignment.Center) { vAlignCenter.IsSelected = true; } else { vAlignBottom.IsSelected = true; } linearLayout.RequestLayout(); }; linearLayout.RequestLayout(); }
public void SetLayout(IObjectLayout layout) { if (!(layout is LinearLayout)) { return; } if (linearLayout == layout as ObjectLinearLayout) { return; } linearLayout = layout as ObjectLinearLayout; // HorizontalAlignment if (linearLayout.HorizontalAlignment == HorizontalAlignment.Begin) { hAlignBegin.IsSelected = true; } else if (linearLayout.HorizontalAlignment == HorizontalAlignment.Center) { hAlignCenter.IsSelected = true; } else { hAlignEnd.IsSelected = true; } linearLayout.HorizontalAlignmentChanged += (object sender, HorizontalAlignmentChangedEventArgs args) => { if (args.HorizontalAlignment == HorizontalAlignment.Begin) { hAlignBegin.IsSelected = true; } else if (args.HorizontalAlignment == HorizontalAlignment.Center) { hAlignCenter.IsSelected = true; } else { hAlignEnd.IsSelected = true; } linearLayout.RequestLayout(); }; linearLayout.RequestLayout(); }
public void SetLayout(IObjectLayout layout) { if (!(layout is LinearLayout)) { return; } if (linearLayout == layout as ObjectLinearLayout) { return; } linearLayout = layout as ObjectLinearLayout; // LinearOrientation if (linearLayout.LinearOrientation == LinearLayout.Orientation.Horizontal) { linearOrientH.IsSelected = true; } else { linearOrientV.IsSelected = true; } linearLayout.LinearOrientationChanged += (object sender, LinearOrientationChangedEventArgs args) => { if (args.LinearOrientation == LinearLayout.Orientation.Horizontal) { linearOrientH.IsSelected = true; } else { linearOrientV.IsSelected = true; } linearLayout.RequestLayout(); }; linearLayout.RequestLayout(); }