<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:local="clr-namespace:SimpleCRM" 
    xmlns:cm="http://www.caliburnproject.org"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    x:Class="SimpleCRM.ViewModels.AppMainShellView" Title="食品有限公司订单管理系统">
    <Window.Resources>
        <SolidColorBrush x:Key="ControlBackground_Normal" Color="#F9F9F9" />
        <Style x:Key="MainMenuButton" TargetType="{x:Type telerik:RadButton}">
            <Setter Property="Margin" Value="5" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="FontFamily" Value="Microsoft YaHei"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="Width" Value="100"/>
            <Setter Property="Height" Value="100"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Border BorderBrush="{TemplateBinding Control.BorderBrush}" BorderThickness="0" CornerRadius="16" Name="PART_Background">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                    <GradientStop Color="White" Offset="0.0" />
                                    <GradientStop Color="#CC766C" Offset="0.5" />
                                    <GradientStop Color="White" Offset="0.0" />
                                </LinearGradientBrush>
                            </Border.Background>
                            <ContentPresenter Content="{TemplateBinding ContentControl.Content}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="UIElement.IsMouseOver" Value="True">
                                <Setter Property="Border.Background" TargetName="PART_Background">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                            <GradientStop Color="White" Offset="0.0" />
                                            <GradientStop Color="#235699" Offset="0.5" />
                                            <GradientStop Color="White" Offset="0.0" />
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="ButtonBase.IsPressed" Value="True">
                                <Setter Property="UIElement.Effect"  TargetName="PART_Background">
                                    <Setter.Value>
                                        <DropShadowEffect BlurRadius="10" Color="Black" Direction="0" Opacity="0.6" RenderingBias="Performance" ShadowDepth="0" />
                                    </Setter.Value>
                                </Setter>
                            </Trigger>

                            <Trigger Property="IsFocused" Value="True">
                                <Setter Property="Background" Value="#235699"  TargetName="PART_Background"/>
                                <Setter Property="BorderBrush"  Value="#CCCCCC" TargetName="PART_Background"/>
                            </Trigger>

                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="MainMenuText" TargetType="TextBlock">
            <Setter Property="Margin" Value="0" />
            <Setter Property="Padding" Value="10,0,0,0" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="FontFamily" Value="Microsoft YaHei"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="Foreground" Value="White"/>
        </Style>

        <Style x:Key="ToolbarButton" TargetType="{x:Type telerik:RadButton}">
            <Setter Property="Visibility" Value="Collapsed" />
            <Setter Property="Margin" Value="2" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="FontFamily" Value="Microsoft YaHei"/>
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="Foreground" Value="Black"/>
            <Setter Property="Width" Value="100"/>
            <Setter Property="Height" Value="32"/>
        </Style>


        <Style x:Key="MainImage" TargetType="{x:Type Image}">
            <Setter Property="Width" Value="48"/>
            <Setter Property="Height" Value="48"/>
        </Style>

        <Style x:Key="ToolbarImage" TargetType="{x:Type Image}">
            <Setter Property="Width" Value="16"/>
            <Setter Property="Height" Value="16"/>
        </Style>

        <Style x:Key="ToolbarTextBlock" TargetType="{x:Type TextBlock}">
            <Setter Property="Margin" Value="0" />
            <Setter Property="Padding" Value="10,0,0,0" />
        </Style>

        <Style x:Key="MainMessageText" TargetType="{x:Type TextBlock}">
            <Setter Property="FontFamily" Value="Microsoft YaHei"/>
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="FontWeight" Value="Bold"/>
        </Style>

    </Window.Resources>


    <DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch" LastChildFill="True">

        <Grid DockPanel.Dock="Top" Margin="0,0,0,0" Background="#BFDBFF">
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <StackPanel Grid.Row="0" Orientation="Horizontal">
                <telerik:RadButton Style="{StaticResource MainMenuButton}" x:Name="Order" cm:Message.Attach="[Event Click] = [Action MainButton_Click($source)]">
                    <StackPanel Orientation="Vertical">
                        <Image Style="{StaticResource MainImage}" Source="pack://siteoforigin:,,,/im/order.png"/>
                        <TextBlock Style="{StaticResource MainMenuText}" Text="出货单管理" />
                    </StackPanel>
                </telerik:RadButton>

                <telerik:RadButton Style="{StaticResource MainMenuButton}"  x:Name="Customer" cm:Message.Attach="[Event Click] = [Action MainButton_Click($source)]">
                    <StackPanel Orientation="Vertical">
                        <Image Style="{StaticResource MainImage}" Source="pack://siteoforigin:,,,/im/customer.png"/>
                        <TextBlock Style="{StaticResource MainMenuText}" Text="客户管理"  />
                    </StackPanel>
                </telerik:RadButton>

                <telerik:RadButton Style="{StaticResource MainMenuButton}"  x:Name="Saler" cm:Message.Attach="[Event Click] = [Action MainButton_Click($source)]">
                    <StackPanel Orientation="Vertical">
                        <Image Style="{StaticResource MainImage}" Source="pack://siteoforigin:,,,/im/saler.png"/>
                        <TextBlock Style="{StaticResource MainMenuText}" Text="销售员管理" />
                    </StackPanel>
                </telerik:RadButton>

                <telerik:RadButton Style="{StaticResource MainMenuButton}"  x:Name="Report" cm:Message.Attach="[Event Click] = [Action MainButton_Click($source)]">
                    <StackPanel Orientation="Vertical">
                        <Image Style="{StaticResource MainImage}" Source="pack://siteoforigin:,,,/im/report.png"/>
                        <TextBlock Style="{StaticResource MainMenuText}" Text="月 报 表"  />
                    </StackPanel>
                </telerik:RadButton>

            </StackPanel>
            <Border Grid.Row="1" BorderBrush="#BBBBBB" BorderThickness="1">

                <StackPanel Name="ToolBar" Orientation="Horizontal" Background="#F9F9F9" Height="40">

                    <TextBlock Style="{StaticResource MainMessageText}" Text=" " Margin="0,12,10,0"/>

                    <TextBlock Style="{StaticResource MainMessageText}" Text="当前位置---" Margin="0,12,0,0"/>

                    <TextBlock Style="{StaticResource MainMessageText}" Name="LocaltionMessage" Text="出货单管理:" Width="80" Margin="0,12,20,0" Foreground="Blue"/>

                    <telerik:RadButton Style="{StaticResource ToolbarButton}"  Name="Order_Add" cm:Message.Attach="[Event Click] = [Action ToolBarButton_Click($source)]" Visibility="Visible">
                        <StackPanel Orientation="Horizontal">
                            <Image Style="{StaticResource ToolbarImage}" Source="pack://siteoforigin:,,,/im/order.png"/>
                            <TextBlock Style="{StaticResource ToolbarTextBlock}" Text="添加出货单" />
                        </StackPanel>
                    </telerik:RadButton>

                    <telerik:RadButton Style="{StaticResource ToolbarButton}" Margin="20,0,0,0" Width="140" Name="Order_Print" cm:Message.Attach="[Event Click] = [Action ToolBarButton_Click($source)]" Visibility="Visible">
                        <StackPanel Orientation="Horizontal">
                            <Image Style="{StaticResource ToolbarImage}" Source="pack://siteoforigin:,,,/im/order.png"/>
                            <TextBlock Style="{StaticResource ToolbarTextBlock}" Text="所选生成打印单" />
                        </StackPanel>
                    </telerik:RadButton>

                    <Label Name="Order_Condition_Show"  Content="选择要浏览的订单日期" Margin="10,8,10,0" Foreground="Green" />
                    <telerik:RadDateTimePicker  Height="24"  Width="100" x:Name="Order_DateCondition" SelectedValue="{Binding CurrentDate, Mode=TwoWay}" InputMode="DatePicker" DateSelectionMode="{Binding DateSelectionMode, Mode=TwoWay}" cm:Message.Attach="[Event SelectionChanged] = [Action  Order_DateCondition_SelectionChanged($source,$eventArgs)]"/>
                    <telerik:RadButton Height="24" Margin="20,1,0,0" Content="按月浏览"  Name="Order_Condition_Month" cm:Message.Attach="[Event Click] = [Action ToolBarButton_Click($source)]" />
                    <telerik:RadButton Height="24" Margin="20,1,0,0" Content="按日浏览"  Name="Order_Condition_Day" cm:Message.Attach="[Event Click] = [Action ToolBarButton_Click($source)]" />

                    <telerik:RadButton Style="{StaticResource ToolbarButton}"  Name="Customer_Add" cm:Message.Attach="[Event Click] = [Action ToolBarButton_Click($source)]">
                        <StackPanel Orientation="Horizontal">
                            <Image Style="{StaticResource ToolbarImage}" Source="pack://siteoforigin:,,,/im/order.png"/>
                            <TextBlock Style="{StaticResource ToolbarTextBlock}" Text="添加客户" />
                        </StackPanel>
                    </telerik:RadButton>

                    <telerik:RadButton Style="{StaticResource ToolbarButton}"  Name="Saler_Add" cm:Message.Attach="[Event Click] = [Action ToolBarButton_Click($source)]">
                        <StackPanel Orientation="Horizontal">
                            <Image Style="{StaticResource ToolbarImage}" Source="pack://siteoforigin:,,,/im/order.png"/>
                            <TextBlock Style="{StaticResource ToolbarTextBlock}" Text="添加销售员" />
                        </StackPanel>
                    </telerik:RadButton>

                    <telerik:RadButton Style="{StaticResource ToolbarButton}"  Name="Report_Print" cm:Message.Attach="[Event Click] = [Action ToolBarButton_Click($source)]">
                        <StackPanel Orientation="Horizontal">
                            <Image Style="{StaticResource ToolbarImage}" Source="pack://siteoforigin:,,,/im/order.png"/>
                            <TextBlock Style="{StaticResource ToolbarTextBlock}" Text="打印报表" />
                        </StackPanel>
                    </telerik:RadButton>


                    <telerik:RadButton Style="{StaticResource ToolbarButton}"  Name="Report_Customer" cm:Message.Attach="[Event Click] = [Action ToolBarButton_Click($source)]">
                        <StackPanel Orientation="Horizontal">
                            <Image Style="{StaticResource ToolbarImage}" Source="pack://siteoforigin:,,,/im/order.png"/>
                            <TextBlock Style="{StaticResource ToolbarTextBlock}" Text="客户报表" />
                        </StackPanel>
                    </telerik:RadButton>

                    <telerik:RadButton Style="{StaticResource ToolbarButton}"  Name="Report_Saler" cm:Message.Attach="[Event Click] = [Action ToolBarButton_Click($source)]">
                        <StackPanel Orientation="Horizontal">
                            <Image Style="{StaticResource ToolbarImage}" Source="pack://siteoforigin:,,,/im/order.png"/>
                            <TextBlock Style="{StaticResource ToolbarTextBlock}" Text="销售报表" />
                        </StackPanel>
                    </telerik:RadButton>

                    <telerik:RadButton Style="{StaticResource ToolbarButton}"  Name="Report_PerMonth" cm:Message.Attach="[Event Click] = [Action ToolBarButton_Click($source)]">
                        <StackPanel Orientation="Horizontal">
                            <Image Style="{StaticResource ToolbarImage}" Source="pack://siteoforigin:,,,/im/order.png"/>
                            <TextBlock Style="{StaticResource ToolbarTextBlock}" Text="年度报表" />
                        </StackPanel>
                    </telerik:RadButton>

                </StackPanel>
            </Border>
        </Grid>

        <Grid DockPanel.Dock="Bottom" Margin="0,0,0,20">
            <ScrollViewer x:Name="scrollViewer1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                <ContentControl x:Name="ContentControl" Margin="0" cm:View.Model="{Binding SettingsPage}" Grid.Row="0" Grid.Column="1">
                </ContentControl>
            </ScrollViewer>
        </Grid>
    </DockPanel>
</Window>
