Advertisement
Guest User

Untitled

a guest
Aug 28th, 2017
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.93 KB | None | 0 0
  1. <Window x:Class="WpfTest.MainWindow"
  2.        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3.        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4.        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5.        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6.        xmlns:local="clr-namespace:WpfTest"
  7.        mc:Ignorable="d" WindowStartupLocation="CenterScreen"
  8.        Title="MainWindow" Width="400" Height="300"
  9.        Name="mainWindow">
  10.     <Window.Resources>
  11.         <local:IsPlaysToImageSourceConverter x:Key="ImageSourceConv"/>
  12.     </Window.Resources>
  13.  
  14.     <Grid>
  15.         <ScrollViewer>
  16.             <ItemsControl ItemsSource="{Binding Tracks}"
  17.                          HorizontalContentAlignment="Stretch"
  18.                          Background="#ffffff" BorderBrush="#ffffff">
  19.                 <ItemsControl.ItemTemplate>
  20.                     <DataTemplate>
  21.                         <Grid Height="40" Background="#f5f5f5">
  22.                             <Grid.ColumnDefinitions>
  23.                                 <ColumnDefinition Width="40"/>
  24.                                 <ColumnDefinition/>
  25.                             </Grid.ColumnDefinitions>
  26.  
  27.                             <Button Width="30" Height="30" Cursor="Hand"
  28.                                    Command="{Binding DataContext.PlayCommand, ElementName=mainWindow}"
  29.                                    CommandParameter="{Binding}">
  30.                                 <Image Source="{Binding IsPlays, Converter={StaticResource ImageSourceConv}}"/>
  31.                             </Button>
  32.  
  33.                             <TextBlock Grid.Column="1" Text="{Binding Name}"
  34.                                       VerticalAlignment="Center"/>
  35.                         </Grid>
  36.                     </DataTemplate>
  37.                 </ItemsControl.ItemTemplate>
  38.             </ItemsControl>
  39.         </ScrollViewer>
  40.     </Grid>
  41. </Window>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement