<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:vm="clr-namespace:OrderEntrySystem">

    <DataTemplate DataType="{x:Type vm:ProductViewModel}">
        <vm:ProductView></vm:ProductView>
    </DataTemplate>
    <DataTemplate DataType="{x:Type vm:MultiProductViewModel}">
        <vm:MultiProductView></vm:MultiProductView>
    </DataTemplate>

    <DataTemplate DataType="{x:Type vm:OrderViewModel}">
        <vm:OrderView></vm:OrderView>
    </DataTemplate>
    <DataTemplate DataType="{x:Type vm:MultiOrderViewModel}">
        <vm:MultiOrderView></vm:MultiOrderView>
    </DataTemplate>

    <DataTemplate DataType="{x:Type vm:CustomerViewModel}">
        <vm:CustomerView></vm:CustomerView>
    </DataTemplate>
    <DataTemplate DataType="{x:Type vm:MultiCustomerViewModel}">
        <vm:MultiCustomerView></vm:MultiCustomerView>
    </DataTemplate>

    <DataTemplate DataType="{x:Type vm:LocationViewModel}">
        <vm:LocationView></vm:LocationView>
    </DataTemplate>
    <DataTemplate DataType="{x:Type vm:MultiLocationViewModel}">
        <vm:MultiLocationView></vm:MultiLocationView>
    </DataTemplate>

    <DataTemplate DataType="{x:Type vm:CategoryViewModel}">
        <vm:CategoryView></vm:CategoryView>
    </DataTemplate>
    <DataTemplate DataType="{x:Type vm:MultiCategoryViewModel}">
        <vm:MultiCategoryView></vm:MultiCategoryView>
    </DataTemplate>

    <Style x:Key="ListViewStyle" TargetType="{x:Type ListViewItem}">
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="IsSelected" Value="{Binding Path=IsSelected, Mode=TwoWay}" />
        <Style.Triggers>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="ItemsControl.AlternationIndex" Value="1" />
                    <Condition Property="IsSelected" Value="False" />
                    <Condition Property="IsMouseOver" Value="False" />
                </MultiTrigger.Conditions>
                <Setter Property="Background" Value="#EEEEEEEE" />
            </MultiTrigger>
        </Style.Triggers>
    </Style>

    <DataTemplate x:Key="WorkspacesTemplate">
        <TabControl IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding}" Margin="4">
            <TabControl.ItemTemplate>
                <DataTemplate>
                    <DockPanel>
                        <Button Content="X" DockPanel.Dock="Right" Cursor="Hand"
                                Margin="4,0,0,0" FontWeight="Bold" Height="16" Width="16"
                                FontFamily="Courier" FontSize="9" Command="{Binding Path=CloseCommand}" />
                        <ContentPresenter Content="{Binding Path=DisplayName}" VerticalAlignment="Center"/>
                    </DockPanel>
                </DataTemplate>
            </TabControl.ItemTemplate>
        </TabControl>
    </DataTemplate>

    <DataTemplate x:Key="NestedCommandTemplate">
        <ItemsControl ItemsSource="{Binding}" HorizontalAlignment="Right">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Horizontal"/>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Button Command="{Binding Path=Command}" Content="{Binding Path=DisplayName}" Height="23" Width="75" Margin="4,4,0,0"/>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </DataTemplate>

    <DataTemplate x:Key="CommandsTemplate">
        <ItemsControl ItemsSource="{Binding}">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Button Command="{Binding Path=Command}" Content="{Binding Path=DisplayName}" />
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </DataTemplate>

    <Style x:Key="MainHeaderStyle" TargetType="{x:Type HeaderedContentControl}">
        <Setter Property="HeaderTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Border Background="{StaticResource Brush_HeaderBackground}" BorderBrush="LightGray" BorderThickness="1" 
                            CornerRadius="5" Margin="4" Padding="4" SnapsToDevicePixels="True">
                        <TextBlock FontSize="14" FontWeight="Bold" Foreground="White" HorizontalAlignment="Center" Text="{TemplateBinding Content}" />
                    </Border>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <!-- This template ensures that content of a HeaderedContentControl fills the available vertical space. -->
                <ControlTemplate TargetType="{x:Type HeaderedContentControl}">
                    <DockPanel>
                        <ContentPresenter DockPanel.Dock="Top" ContentSource="Header" ContentTemplate="{TemplateBinding HeaderTemplate}" />
                        <ContentPresenter ContentSource="Content" ContentTemplate="{TemplateBinding ContentTemplate}" />
                    </DockPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>