|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--Address DataTemplates-->
<DataTemplate x:Key="AddressComboCollapsed" >
<StackPanel Width="150" HorizontalAlignment="Stretch" >
<DockPanel HorizontalAlignment="Stretch">
<TextBlock Text="{Binding Path=AddressName}"
DockPanel.Dock="Left"
/>
<TextBlock Text="{Binding Path=AddressType}"
DockPanel.Dock="Right"
HorizontalAlignment="Right"
/>
</DockPanel>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="AddressComboExpanded" >
<GroupBox BorderThickness = "1"
Margin = "0,0,0,3"
Width = "Auto "
HorizontalAlignment = "Stretch"
Header = "{Binding Path=AddressType}">
<StackPanel Margin="3"
HorizontalAlignment="Stretch"
MinWidth="250">
<TextBlock Text = "{Binding Path=AddressName}"/>
<TextBlock Text = "{Binding Path=AddressLine1}"
Name = "tbAddr1"
/>
<TextBlock Text = "{Binding Path=AddressLine2}"
Name = "tbAddr2"
/>
<!-- City, State, and ZIP display -->
<StackPanel Orientation = "Horizontal">
<TextBlock Text = "{Binding Path=City}" />
<TextBlock Text="," Padding="0,0,5,0"/> <!-- Put a comma between city and state -->
<TextBlock Text = "{Binding Path=State}" Padding="0,0,5,0" />
<TextBlock Text = "{Binding Path=PostalCode}" />
</StackPanel>
</StackPanel>
</GroupBox>
<DataTemplate.Triggers>
<!--If the "AddressLine2" portion of the address is blank, then
HIDE it (no need to display an extra blank line)
This only works is AddressLine2 = "", not if it's null
-->
<DataTrigger Binding = "{Binding Path=AddressLine2}" Value = "">
<Setter TargetName = "tbAddr2"
Property = "Visibility"
Value = "Collapsed"
/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
<!--End Address DataTemplates-->
</ResourceDictionary>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.