-
Notifications
You must be signed in to change notification settings - Fork 90
/
InfoTextBoxPage.xaml
37 lines (30 loc) · 1.85 KB
/
InfoTextBoxPage.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:lib="http://schemas.thinkpixellab.com/2011/xaml/presentation"
xmlns:core="clr-namespace:PixelLab.Core"
core:DemoMetadataProperties.DemoName="Info TextBox"
core:DemoMetadataProperties.DemoDescription="When should I build a custom control? This is a question I get a lot. I think InfoTextBox is a great example of a where a custom control adds a lot of value. You'll notice that I didn't start from scratch. I simply added a couple of properties to the existing TextBox. The properties I add are pretty boring, actually, just HasText (bool) and TextBoxInfo (string). The magic comes when I leverage these new properties in a new ControlTemplate for InfoTextBox. I think you'll agree that the results are pretty cool.">
<Viewbox>
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0">First Name</Label>
<lib:InfoTextBox TextBoxInfo="Put your first name here"
Grid.Row="0" Grid.Column="1"/>
<Label Grid.Row="1" Grid.Column="0">Last Name</Label>
<lib:InfoTextBox TextBoxInfo="Put your last name here"
Grid.Row="1" Grid.Column="1"/>
<Label Grid.Row="2" Grid.Column="0">City and State</Label>
<lib:InfoTextBox TextBoxInfo="Put your city and state here, separated by a comma."
Grid.Row="2" Grid.Column="2"/>
</Grid>
</Viewbox>
</Page>