<UserControl x:Class="OPlanner.CoursesPanel" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:CustomControl="clr-namespace:OPlanner">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="TemplatesAndStyles.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <Style TargetType="Label">
                <Setter Property="Foreground" Value="#FFFFFF"/>
            </Style>
            <Style TargetType="CheckBox">
                <Setter Property="Foreground" Value="#FFFFFF"/>
            </Style>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid Style="{StaticResource VerticalPanel}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <Label Style="{StaticResource PanelHeader}" Grid.Row="0">Courses</Label>
        <StackPanel Grid.Row="1">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,2,0,1">
                <ComboBox Name="coursesCombo" Width="100" Margin="0,0,2,0" SelectionChanged="coursesCombo_SelectionChanged">
                </ComboBox>
                <Button Name="newButton" Click="newButton_Click">New Course</Button>
            </StackPanel>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,1,0,1">
                <Button Margin="1,0,1,0" Name="propertiesButton" Click="propertiesButton_Click">Properties</Button>
                <Button Margin="1,0,1,0" Name="deleteCourseButton" Click="deleteCourseButton_Click">Delete</Button>
				<Button Margin="1,0,1,0" Name="duplicateCourseButton" Click="duplicateCourseButton_Click">Duplicate</Button>
            </StackPanel>
			<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,1,0,1">
				<CheckBox Name="previewCheckBox" Margin="1,4,1,4" Padding="2,0,0,0" Checked="previewCheckBox_Checked" Unchecked="previewCheckBox_Unchecked">Preview</CheckBox>
			</StackPanel>
			<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,1,0,1">
                <Label Margin="1,0,1,0" Name="lengthLabel">Length: 0 km</Label>
                <Label Margin="1,0,1,0" Name="climbLabel">Climb: 0 m</Label>
            </StackPanel>
        </StackPanel>
        <Grid Margin="10,1,10,5" Grid.Row="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="2*"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>
            <Label Grid.Row="0">Ordered Objects</Label>
            <CustomControl:DragListBox x:Name="orderedObjectsBox" Grid.Row="1" MinHeight="50" Margin="0,0,0,1" SelectionMode="Extended" SelectionChanged="objectsBox_SelectionChanged" KeyDown="orderedObjectsBox_KeyDown" AllowDrop="True" CustomDropPreview="orderedObjectsBox_CustomDropPreview" CustomDrop="orderedObjectsBox_CustomDrop" CopyOutgoing="False" AllowDropCheck="orderedObjectsBox_AllowDropCheck" />
            <StackPanel Orientation="Horizontal" Grid.Row="2">
                <Button ToolTip="Up" Name="orderedUpButton" Click="orderedUpButton_Click">
                    <Image Stretch="None" Source="Icons\Up.png"></Image>
                </Button>
                <Button ToolTip="Down" Name="orderedDownButton" Click="orderedDownButton_Click">
                    <Image Stretch="None" Source="Icons\Down.png"></Image>
                </Button>
                <Button Name="removeOrderedButton" Click="removeOrderedButton_Click" ToolTip="Delete">
                    <Image Stretch="None" Source="Icons\Delete.png"></Image>
                </Button>
                <Button ToolTip="New Item" Name="orderedNewButton" Click="orderedNewButton_Click">
                    <Image Stretch="None" Source="Icons\Add.png"></Image>
                </Button>
            </StackPanel>
            <Label Grid.Row="3">Fixed Objects</Label>
            <CustomControl:DragListBox x:Name="fixedObjectsBox" Grid.Row="4" MinHeight="50" Margin="0,0,0,1" SelectionMode="Extended" SelectionChanged="objectsBox_SelectionChanged" KeyDown="fixedObjectsBox_KeyDown" AllowDrop="True" CustomDropPreview="fixedObjectsBox_CustomDropPreview" CustomDrop="fixedObjectsBox_CustomDrop" CopyOutgoing="False" AllowReorder="False" AllowDropCheck="fixedObjectsBox_AllowDropCheck"/>
            <StackPanel Orientation="Horizontal" Grid.Row="5">
                <Button Name="removeFixedButton" Click="removeFixedButton_Click" ToolTip="Delete">
                    <Image Stretch="None" Source="Icons\Delete.png"></Image>
                </Button>
            </StackPanel>
        </Grid>
    </Grid>
</UserControl>
