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
|
<Grid
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:System;assembly=mscorlib"
>
<Grid.Resources>
<x:Array Type="{x:Type s:String}" x:Key="items">
<s:String>Foo</s:String>
<s:String>Bar</s:String>
<s:String>Spong</s:String>
</x:Array>
</Grid.Resources>
<!--*******************************************************************************************-->
<ListView ItemsSource="{StaticResource items}" Height="115" VerticalAlignment="Top">
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
</Style>
</ListView.ItemContainerStyle>
<ListView.View>
<GridView>
<GridViewColumn Header="Data" Width="80">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding .}" Width="80" Margin="0,0,0,0"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="Length" DisplayMemberBinding="{Binding Length}" Width="50"/>
</GridView>
</ListView.View>
</ListView>
</Grid> |
Partager