コード例 #1
0
        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();
        }
コード例 #2
0
 private void VAlignTopSelectedChanged(object sender, SelectedChangedEventArgs args)
 {
     if (args.IsSelected)
     {
         if (linearLayout != null)
         {
             linearLayout.VerticalAlignment = VerticalAlignment.Top;
             linearLayout.RequestLayout();
         }
     }
 }
コード例 #3
0
 private void LinearOrientHSelectedChanged(object sender, SelectedChangedEventArgs args)
 {
     if (args.IsSelected)
     {
         if (linearLayout != null)
         {
             linearLayout.LinearOrientation = LinearLayout.Orientation.Horizontal;
             linearLayout.RequestLayout();
         }
     }
 }
コード例 #4
0
 private void HAlignBeginSelectedChanged(object sender, SelectedChangedEventArgs args)
 {
     if (args.IsSelected)
     {
         if (linearLayout != null)
         {
             linearLayout.HorizontalAlignment = HorizontalAlignment.Begin;
             linearLayout.RequestLayout();
         }
     }
 }
コード例 #5
0
 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();
         }
     }
 }
コード例 #6
0
        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();
        }
コード例 #7
0
        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();
        }
コード例 #8
0
        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();
        }