Browse Source

Added a dev tools prompt.

pull/4/head
Steven Kirk 12 years ago
parent
commit
58bab17a4e
  1. 5
      Perspex.Controls/RowDefinition.cs
  2. 182
      TestApplication/Program.cs

5
Perspex.Controls/RowDefinition.cs

@ -21,6 +21,11 @@ namespace Perspex.Controls
{ {
} }
public RowDefinition(double value, GridUnitType type)
{
this.Height = new GridLength(value, type);
}
public RowDefinition(GridLength height) public RowDefinition(GridLength height)
{ {
this.Height = height; this.Height = height;

182
TestApplication/Program.cs

@ -99,105 +99,123 @@ namespace TestApplication
Window window = new Window Window window = new Window
{ {
Content = new TabControl Content = new Grid
{ {
Items = new[] RowDefinitions = new RowDefinitions
{ {
new TabItem new RowDefinition(1, GridUnitType.Star),
new RowDefinition(GridLength.Auto),
},
Children = new Controls
{
new TabControl
{ {
Header = "Buttons", Items = new[]
Content = new StackPanel
{ {
Orientation = Orientation.Vertical, new TabItem
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Gap = 8,
MinWidth = 120,
Children = new Controls
{ {
new Button Header = "Buttons",
{ Content = new StackPanel
Content = "Button",
},
new Button
{ {
Content = "Button", Orientation = Orientation.Vertical,
Background = new SolidColorBrush(0xcc119eda), HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Gap = 8,
MinWidth = 120,
Children = new Controls
{
new Button
{
Content = "Button",
},
new Button
{
Content = "Button",
Background = new SolidColorBrush(0xcc119eda),
},
new CheckBox
{
Content = "Checkbox",
},
}
}, },
new CheckBox },
{ new TabItem
Content = "Checkbox",
},
}
},
},
new TabItem
{
Header = "Text",
Content = new StackPanel
{
Orientation = Orientation.Vertical,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Gap = 8,
Width = 120,
Children = new Controls
{ {
new TextBlock Header = "Text",
Content = new StackPanel
{ {
Text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin venenatis dui quis libero suscipit tincidunt.", Orientation = Orientation.Vertical,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Gap = 8,
Width = 120,
Children = new Controls
{
new TextBlock
{
Text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin venenatis dui quis libero suscipit tincidunt.",
},
new TextBlock
{
Text = "Italic text.",
FontStyle = FontStyle.Italic,
},
new TextBox
{
Text = "Text Box",
},
}
}, },
new TextBlock },
{ new TabItem
Text = "Italic text.",
FontStyle = FontStyle.Italic,
},
new TextBox
{
Text = "Text Box",
},
}
},
},
new TabItem
{
Header = "Images",
Content = new StackPanel
{
Orientation = Orientation.Vertical,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Gap = 8,
Width = 120,
Children = new Controls
{ {
new Image Header = "Images",
Content = new StackPanel
{ {
Source = new Bitmap("github_icon.png"), Orientation = Orientation.Vertical,
Width = 200, HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Gap = 8,
Width = 120,
Children = new Controls
{
new Image
{
Source = new Bitmap("github_icon.png"),
Width = 200,
},
}
}, },
} },
}, new TabItem
},
new TabItem
{
Header = "Lists",
Content = new StackPanel
{
Orientation = Orientation.Horizontal,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Gap = 8,
Children = new Controls
{ {
new TreeView Header = "Lists",
Content = new StackPanel
{ {
Id = "treeView", Orientation = Orientation.Horizontal,
Items = treeData, HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Gap = 8,
Children = new Controls
{
new TreeView
{
Id = "treeView",
Items = treeData,
},
}
}, },
} },
}, }
}, },
new TextBlock
{
Text = "Press F12 for Dev Tools",
HorizontalAlignment = HorizontalAlignment.Right,
Margin = new Thickness(2),
[Grid.RowProperty] = 1,
}
} }
} }
}; };

Loading…
Cancel
Save