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 38 39 40 41 42 43 44 45 46 47 48 49
|
<ListBox Name="List" Grid.Row="0" Grid.Column="0" ItemsSource="{Binding Source={StaticResource Data}}" Background="{x:Null}" BorderBrush="{x:Null}" Utils:CommandBehavior.Event="SelectionChanged" Utils:CommandBehavior.Command="{Binding AccountChangedCommand}" Utils:CommandBehavior.CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=SelectedItem}">
<ListBox.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Orange" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Orange" />
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Style>
</ListBox.Resources>
<ListBox.GroupStyle>
<GroupStyle HidesIfEmpty="True">
<GroupStyle.ContainerStyle>
<Style TargetType="GroupItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="GroupItem">
<Expander IsExpanded="True" >
<Expander.Header>
<TextBlock Grid.Column="0" Text="{Binding Name}" Foreground="White" FontWeight="Bold" />
</Expander.Header>
<ItemsPresenter/>
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</ListBox.GroupStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="70" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="20" />
<RowDefinition Height="20" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Image Source="{Binding Logo, Converter={StaticResource BinariesToImageSourceConverter}}" Grid.Column="0" Grid.Row="0" Grid.RowSpan="3" Margin="5" />
<TextBlock Text="{Binding Name}" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" FontWeight="Bold" FontSize="14" Foreground="White" />
<TextBlock Text="{Binding Number}" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" Foreground="White" />
<TextBlock Text="{Binding Ammount, Converter={StaticResource AmmountToTextConverter}}" Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" Foreground="White" FontWeight="Bold" HorizontalAlignment="Right" Margin="0,0,10,0" />
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox> |
Partager