Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <Window x:Class="WpfTest.MainWindow"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:WpfTest"
- mc:Ignorable="d" WindowStartupLocation="CenterScreen"
- Title="MainWindow" Width="400" Height="300"
- Name="mainWindow">
- <Window.Resources>
- <local:IsPlaysToImageSourceConverter x:Key="ImageSourceConv"/>
- </Window.Resources>
- <Grid>
- <ScrollViewer>
- <ItemsControl ItemsSource="{Binding Tracks}"
- HorizontalContentAlignment="Stretch"
- Background="#ffffff" BorderBrush="#ffffff">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Grid Height="40" Background="#f5f5f5">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="40"/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
- <Button Width="30" Height="30" Cursor="Hand"
- Command="{Binding DataContext.PlayCommand, ElementName=mainWindow}"
- CommandParameter="{Binding}">
- <Image Source="{Binding IsPlays, Converter={StaticResource ImageSourceConv}}"/>
- </Button>
- <TextBlock Grid.Column="1" Text="{Binding Name}"
- VerticalAlignment="Center"/>
- </Grid>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </ScrollViewer>
- </Grid>
- </Window>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement