public override object Construct() { var textBlock = new Label().BuildStyledLabel(Owner, PropertyName); var label = new Label(); label.Content = PropertyName.SplitCamelCase(); label.HorizontalAlignment = HorizontalAlignment.Center; label.Target = textBlock; return(Constructor.Construct(BuildOrientation.Vertical, label, textBlock)); }
public override object Construct() { var comboBox = new ComboBox(); comboBox.DataContext = Owner; comboBox.SetBinding(ComboBox.ItemsSourceProperty, new Binding(PropertyName)); comboBox.SetBinding(ComboBox.SelectedItemProperty, new Binding(SelectedItemPropertyName)); comboBox.DisplayMemberPath = DisplayPath; var label = new Label(); label.Target = comboBox; label.HorizontalAlignment = HorizontalAlignment.Center; label.Content = PropertyName.SplitCamelCase(); return(Constructor.Construct(BuildOrientation.Vertical, label, comboBox)); }
public override object Construct() { var textBox = new TextBox(); textBox.DataContext = Owner; textBox.SetBinding(TextBox.TextProperty, new Binding(PropertyName)); textBox.SetValue(Grid.ColumnProperty, 1); textBox.HorizontalAlignment = HorizontalAlignment.Stretch; var label = new Label(); label.Target = textBox; label.HorizontalAlignment = HorizontalAlignment.Right; label.Content = PropertyName.SplitCamelCase() + ":"; label.SetValue(Grid.ColumnProperty, 0); var textBoxContainer = new Grid().BuildTwoColumnGrid(); textBoxContainer.Children.Add(textBox); textBoxContainer.Children.Add(label); return(Constructor.Construct(BuildOrientation.Vertical, textBoxContainer)); }
public override object Construct() { var slider = new Slider(); slider.Minimum = Min; slider.Maximum = Max; slider.Background = Colors.Transparent.ToBrush(); slider.DataContext = Owner; slider.SetBinding(Slider.ValueProperty, new Binding(PropertyName)); slider.Margin = new Thickness(0, 0, 0, 2); var label = new Label(); label.Target = slider; label.HorizontalAlignment = HorizontalAlignment.Left; label.Content = PropertyName.SplitCamelCase(); label.SetValue(Grid.ColumnProperty, 0); var labelBinding = new Binding("Value"); labelBinding.Converter = new DoubleToIntConverter(); var valueLabel = new Label(); valueLabel.DataContext = slider; valueLabel.HorizontalAlignment = HorizontalAlignment.Right; valueLabel.SetBinding(Label.ContentProperty, labelBinding); valueLabel.SetValue(Grid.ColumnProperty, 1); var grid = new Grid().BuildTwoColumnGrid(); grid.Children.Add(label); grid.Children.Add(valueLabel); return(Constructor.Construct(BuildOrientation.Vertical, grid, slider)); }