public Vector3Control() { UiGrid grid = new UiGrid(); grid.SetCols(6); grid.ColumnDefinitions[0].Width = GridLength.Auto; grid.ColumnDefinitions[2].Width = GridLength.Auto; grid.ColumnDefinitions[4].Width = GridLength.Auto; TextBlock xLabel = grid.AddUiElement(new TextBlock { Text = "x:" }, 0, 0); xLabel.Margin = new Thickness(3, 3, 5, 3); _x = grid.AddUiElement(new SingleUpDown(), 0, 1); _x.Value = 0; _x.Increment = 0.5f; _x.FormatString = "F3"; _x.ValueChanged += XChanged; _x.Margin = new Thickness(3); TextBlock yLabel = grid.AddUiElement(new TextBlock { Text = "y:" }, 0, 2); yLabel.Margin = new Thickness(10, 3, 5, 3); _y = grid.AddUiElement(new SingleUpDown(), 0, 3); _y.Value = 0; _y.Increment = 0.5f; _y.FormatString = "F3"; _y.ValueChanged += YChanged; _y.Margin = new Thickness(3); TextBlock zLabel = grid.AddUiElement(new TextBlock { Text = "z:" }, 0, 4); zLabel.Margin = new Thickness(10, 3, 5, 3); _z = grid.AddUiElement(new SingleUpDown(), 0, 5); _z.Value = 0; _z.Increment = 0.5f; _z.FormatString = "F3"; _z.ValueChanged += ZChanged; _z.Margin = new Thickness(3); this.Content = grid; }
public UiRectPositionControl() { UiGrid grid = new UiGrid(); grid.SetCols(4); grid.ColumnDefinitions[0].Width = GridLength.Auto; grid.ColumnDefinitions[2].Width = GridLength.Auto; TextBlock xLabel = grid.AddUiElement(new TextBlock { Text = "x:" }, 0, 0); xLabel.Margin = new Thickness(3, 3, 5, 3); _relative = grid.AddUiElement(new SingleUpDown(), 0, 1); _relative.Value = 0; _relative.Increment = 0.1f; _relative.FormatString = "F3"; _relative.ValueChanged += RelativeChanged; _relative.Margin = new Thickness(3); TextBlock yLabel = grid.AddUiElement(new TextBlock { Text = "y:" }, 0, 2); yLabel.Margin = new Thickness(10, 3, 5, 3); _absolute = grid.AddUiElement(new IntegerUpDown(), 0, 3); _absolute.Value = 0; _absolute.Increment = 1; _absolute.FormatString = "F3"; _absolute.ValueChanged += AbsoluteChanged; _absolute.Margin = new Thickness(3); this.Content = grid; }
public RectControl() { UiGrid grid = new UiGrid(); grid.SetCols(8); grid.ColumnDefinitions[0].Width = GridLength.Auto; grid.ColumnDefinitions[2].Width = GridLength.Auto; grid.ColumnDefinitions[4].Width = GridLength.Auto; grid.ColumnDefinitions[6].Width = GridLength.Auto; TextBlock xLabel = grid.AddUiElement(new TextBlock { Text = "x:" }, 0, 0); xLabel.Margin = new Thickness(3, 3, 5, 3); _x = grid.AddUiElement(new SingleUpDown(), 0, 1); _x.Value = 0; _x.Increment = 0.5f; _x.FormatString = "F3"; _x.ValueChanged += XChanged; _x.Margin = new Thickness(3); TextBlock yLabel = grid.AddUiElement(new TextBlock { Text = "y:" }, 0, 2); yLabel.Margin = new Thickness(10, 3, 5, 3); _y = grid.AddUiElement(new SingleUpDown(), 0, 3); _y.Value = 0; _y.Increment = 0.5f; _y.FormatString = "F3"; _y.ValueChanged += YChanged; _y.Margin = new Thickness(3); TextBlock wLabel = grid.AddUiElement(new TextBlock { Text = "width:" }, 0, 6); wLabel.Margin = new Thickness(10, 3, 5, 3); _w = grid.AddUiElement(new SingleUpDown(), 0, 7); _w.Value = 0; _w.Increment = 0.5f; _w.FormatString = "F3"; _w.ValueChanged += WChanged; _w.Margin = new Thickness(3); TextBlock hLabel = grid.AddUiElement(new TextBlock { Text = "height:" }, 0, 4); hLabel.Margin = new Thickness(10, 3, 5, 3); _h = grid.AddUiElement(new SingleUpDown(), 0, 5); _h.Value = 0; _h.Increment = 0.5f; _h.FormatString = "F3"; _h.ValueChanged += HChanged; _h.Margin = new Thickness(3); this.Content = grid; }