|
<UserControl x:Class="Demo.WpfApp.CustomerList"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Demo.WpfApp">
<UserControl.Resources>
<ObjectDataProvider x:Key="controller" ObjectType="{x:Type local:CustomerPresentationModel}" MethodName="get_Instance" />
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<DockPanel Grid.Row="0" LastChildFill="False">
<TextBlock VerticalAlignment="Center" DockPanel.Dock="Right" Margin="5,0,10,0" Text="{Binding Source={StaticResource controller}, Path=ItemCount}"/>
<TextBlock VerticalAlignment="Center" DockPanel.Dock="Right" Margin="5,0,0,0" Text="Number of items found:"/>
<TextBlock VerticalAlignment="Center" DockPanel.Dock="Left" Margin="5,0,0,0" Text="Search:"/>
<TextBox VerticalAlignment="Center" DockPanel.Dock="Left" Margin="5,0,0,0" Width="200" Name="txtSearch" TextChanged="TextBox_TextChanged" />
</DockPanel>
<ListView
Grid.Row="1" Grid.Column="0"
x:Name="ListView"
ItemsSource="{Binding Source={StaticResource controller},Path=Items}"
ScrollViewer.CanContentScroll="True"
SelectionMode="Single" SelectionChanged="ListView_SelectionChanged">
<ListView.View>
<GridView>
<GridViewColumn Header="Name" Width="180"
DisplayMemberBinding="{Binding Path=Name}"/>
<GridViewColumn Header="Address" Width="320"
DisplayMemberBinding="{Binding Path=Address}"/>
<GridViewColumn Header="Comments" Width="180"
DisplayMemberBinding="{Binding Path=Comments}"/>
</GridView>
</ListView.View>
</ListView>
</Grid>
</UserControl>
|
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.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.