Permalink
Fetching contributors…
Cannot retrieve contributors at this time
95 lines (84 sloc) 3.66 KB
<Window x:Class="DataBindingLab.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:src="clr-namespace:DataBindingLab"
Title="List of Products"
SizeToContent="WidthAndHeight"
ResizeMode="NoResize"
>
<!--<SnippetWindowResources1>-->
<Window.Resources>
<!--</SnippetWindowResources1>-->
<Style TargetType="{x:Type ListBoxItem}">
<Style.Triggers>
<Trigger Property="Selector.IsSelected" Value="True">
<Setter Property="Background" Value="Moccasin" />
</Trigger>
</Style.Triggers>
</Style>
<!--<SnippetHeaderTemplate>-->
<DataTemplate x:Key="groupingHeaderTemplate">
<TextBlock Text="{Binding Path=Name}"
Foreground="Navy" FontWeight="Bold" FontSize="12"/>
</DataTemplate>
<!--</SnippetHeaderTemplate>-->
<Style x:Key="checkBoxStyle" TargetType="{x:Type CheckBox}">
<Setter Property="Foreground" Value="#333333" />
<Setter Property="FontWeight" Value="Bold"/>
</Style>
<!--<SnippetCollectionViewSource>-->
<CollectionViewSource
Source="{Binding Source={x:Static Application.Current}, Path=AuctionItems}"
x:Key="listingDataView" />
<!--</SnippetCollectionViewSource>-->
<!--<SnippetWindowResources2>-->
</Window.Resources>
<!--</SnippetWindowResources2>-->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="300"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Grid.ColumnSpan="3"
Style="{StaticResource titleStyle}" Margin="8,20,8,8">List of items for sale:</TextBlock>
<CheckBox Name="Grouping" Grid.Row="1" Grid.Column="0"
Checked="AddGrouping" Unchecked="RemoveGrouping"
Margin="8" Style="{StaticResource checkBoxStyle}">Group by category</CheckBox>
<CheckBox Name="Filtering" Grid.Row="1" Grid.Column="1"
Checked="AddFiltering" Unchecked="RemoveFiltering"
Margin="8" Style="{StaticResource checkBoxStyle}">Show only bargains</CheckBox>
<CheckBox Name="Sorting" Grid.Row="1" Grid.Column="3"
Checked="AddSorting" Unchecked="RemoveSorting"
Margin="8" Style="{StaticResource checkBoxStyle}">Sort by category and date</CheckBox>
<!--<SnippetGroupStyle>-->
<!--<SnippetMaster1>-->
<ListBox Name="Master" Grid.Row="2" Grid.ColumnSpan="3" Margin="8"
ItemsSource="{Binding Source={StaticResource listingDataView}}">
<!--</SnippetMaster1>-->
<ListBox.GroupStyle>
<GroupStyle
HeaderTemplate="{StaticResource groupingHeaderTemplate}"
/>
</ListBox.GroupStyle>
<!--<SnippetMaster2>-->
</ListBox>
<!--</SnippetMaster2>-->
<!--</SnippetGroupStyle>-->
<!--<SnippetDetail>-->
<ContentControl Name="Detail" Grid.Row="3" Grid.ColumnSpan="3"
Content="{Binding Source={StaticResource listingDataView}}"
ContentTemplate="{StaticResource detailsProductListingTemplate}"
Margin="9,0,0,0"/>
<!--</SnippetDetail>-->
<Button Name="OpenAddProduct" Grid.Row="4" Grid.Column="1" Content="Add Product" HorizontalAlignment="Center" Margin="8"
Click="OpenAddProductWindow" />
</Grid>
</Window>