示例#1
0
        private void RenderLabel([NotNull] Grid grid, [NotNull] Field field, int count)
        {
            Assert.ArgumentNotNull(grid, nameof(grid));
            Assert.ArgumentNotNull(field, nameof(field));

            var label = new Default.Label
            {
                ContentEditor = ContentEditor,
                Field         = field,
                Margin        = new Thickness(8, 12, 8, 2)
            };

            grid.Children.Add(label);

            var row    = count / 2 * 2;
            var column = count % 2;

            label.SetValue(Grid.RowProperty, row);
            label.SetValue(Grid.ColumnProperty, column);

            if (column == 0)
            {
                grid.RowDefinitions.Add(new RowDefinition());
            }
        }
示例#2
0
        private void RenderLabel([NotNull] Grid grid, [NotNull] Field field)
        {
            Debug.ArgumentNotNull(grid, nameof(grid));
            Assert.ArgumentNotNull(field, nameof(field));

            var label = new Default.Label
            {
                ContentEditor = ContentEditor,
                Field = field,
                HorizontalAlignment = HorizontalAlignment.Right,
                VerticalAlignment = VerticalAlignment.Top,
                Margin = new Thickness(0, 14, 0, 12)
            };

            grid.Children.Add(label);

            label.SetValue(Grid.ColumnProperty, 0);
            label.SetValue(Grid.RowProperty, grid.RowDefinitions.Count - 1);
        }
        private void RenderLabel([NotNull] Section section, [NotNull] Field field)
        {
            Assert.ArgumentNotNull(section, nameof(section));
            Assert.ArgumentNotNull(field, nameof(field));

            var label = new Default.Label
            {
                ContentEditor = ContentEditor,
                Field         = field,
                HorizontalContentAlignment = HorizontalAlignment.Right,
                VerticalContentAlignment   = VerticalAlignment.Top,
                Padding         = new Thickness(0, 4, 8, 0),
                BorderThickness = new Thickness(0, 0, 0, 1),
                BorderBrush     = SystemColors.ControlDarkBrush,
            };

            label.HelpTextBlock.Visibility = Visibility.Collapsed;

            Editor.Children.Add(label);

            label.SetValue(Grid.RowProperty, RowIndex);
        }