<UserControl x:Class="GeekDesk.Control.UserControls.Config.MotionControl"
             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:cvt="clr-namespace:GeekDesk.Converts"
             xmlns:hc="https://handyorg.github.io/handycontrol"
             mc:Ignorable="d" 
             Background="Transparent"
             d:DesignHeight="300" d:DesignWidth="450">

    <UserControl.Resources>
        <cvt:HideTypeConvert x:Key="HideTypeConvert"/>
    </UserControl.Resources>
    <Grid Background="Transparent" MouseDown="DragMove" 
          >
        <StackPanel Panel.ZIndex="1" hc:Growl.GrowlParent="True" hc:Growl.Token="HotKeyGrowl"></StackPanel>

        <StackPanel Margin="10">
            <hc:UniformSpacingPanel Spacing="10"  Grid.ColumnSpan="4">
                <TextBlock Text="面板动作设置" VerticalAlignment="Center"/>
            </hc:UniformSpacingPanel>
            <hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0"  Grid.ColumnSpan="4">
                <CheckBox x:Name="IconIsAdmin" Content="启动时显示主面板" IsChecked="{Binding StartedShowPanel}">
                    <CheckBox.Background>
                        <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
                            <GradientStop Color="#FF9EA3A6"/>
                        </LinearGradientBrush>
                    </CheckBox.Background>
                </CheckBox>
            </hc:UniformSpacingPanel>

            <hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
                <CheckBox  Content="显示时追随鼠标位置" IsChecked="{Binding FollowMouse}">
                    <CheckBox.Background>
                        <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
                            <GradientStop Color="#FF9EA3A6"/>
                        </LinearGradientBrush>
                    </CheckBox.Background>
                </CheckBox>
            </hc:UniformSpacingPanel>

            <hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
                <CheckBox  Content="鼠标中键呼出" Click="MouseMiddle_Changed" IsChecked="{Binding MouseMiddleShow}">
                    <CheckBox.Background>
                        <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
                            <GradientStop Color="#FF9EA3A6"/>
                        </LinearGradientBrush>
                    </CheckBox.Background>
                </CheckBox>
            </hc:UniformSpacingPanel>

            <hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0"  Grid.ColumnSpan="4">
                <CheckBox  Content="双击启动" IsChecked="{Binding DoubleOpen}">
                    <CheckBox.Background>
                        <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
                            <GradientStop Color="#FF9EA3A6"/>
                        </LinearGradientBrush>
                    </CheckBox.Background>
                </CheckBox>
            </hc:UniformSpacingPanel>

            <hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0"  Grid.ColumnSpan="4">
                <CheckBox  Content="悬停切换菜单" IsChecked="{Binding HoverMenu}">
                    <CheckBox.Background>
                        <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
                            <GradientStop Color="#FF9EA3A6"/>
                        </LinearGradientBrush>
                    </CheckBox.Background>
                </CheckBox>
            </hc:UniformSpacingPanel>

            <hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
                <CheckBox  Content="贴边隐藏" IsChecked="{Binding MarginHide}" Click="MarginHide_Changed">
                    <CheckBox.Background>
                        <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
                            <GradientStop Color="#FF9EA3A6"/>
                        </LinearGradientBrush>
                    </CheckBox.Background>
                </CheckBox>
            </hc:UniformSpacingPanel>

            <hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
                <CheckBox  Content="主窗口动画效果" IsChecked="{Binding AppAnimation}" Click="Animation_Checked">
                    <CheckBox.Background>
                        <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
                            <GradientStop Color="#FF9EA3A6"/>
                        </LinearGradientBrush>
                    </CheckBox.Background>
                </CheckBox>
            </hc:UniformSpacingPanel>

            <hc:UniformSpacingPanel Spacing="10" Margin="0,10,0,0" Grid.ColumnSpan="4">
                <TextBlock Text="面板关闭方式" VerticalAlignment="Center"/>
            </hc:UniformSpacingPanel>
            <hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
                <RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}" 
                         Style="{StaticResource RadioButtonIcon}" Content="失去焦点后"
                         IsChecked="{Binding AppHideType, Mode=TwoWay, Converter={StaticResource HideTypeConvert}, ConverterParameter=1}"/>
                <RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
                         Style="{StaticResource RadioButtonIcon}" Content="运行项目后" 
                         IsChecked="{Binding AppHideType, Mode=TwoWay, Converter={StaticResource HideTypeConvert}, ConverterParameter=2}"/>
                <RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}" 
                         Style="{StaticResource RadioButtonIcon}" Content="手动关闭"
                         IsChecked="{Binding AppHideType, Mode=TwoWay, Converter={StaticResource HideTypeConvert}, ConverterParameter=3}"/>
            </hc:UniformSpacingPanel>

            <hc:UniformSpacingPanel Spacing="10"  Margin="0,10,0,0" Grid.ColumnSpan="4">
                <TextBlock Text="热键设置" VerticalAlignment="Center"/>
            </hc:UniformSpacingPanel>
            <hc:UniformSpacingPanel Spacing="10"  Margin="10,5,0,0" Grid.ColumnSpan="4">
                <TextBlock Text="主面板:" VerticalAlignment="Center" Width="55"/>
                <hc:TextBox HorizontalAlignment="Left" 
                        Tag="Main"
                        VerticalAlignment="Top" 
                        IsReadOnly="True" 
                        IsReadOnlyCaretVisible="True" 
                        Width="200"
                        Text="{Binding HotkeyStr}" 
                        KeyDown="HotKeyDown"
                        KeyUp="HotKeyUp"
                        />
            </hc:UniformSpacingPanel>
            <hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
                <TextBlock Text="新建待办:"  Width="55"/>
                <hc:TextBox HorizontalAlignment="Left" 
                        Tag="ToDo"
                        VerticalAlignment="Top" 
                        IsReadOnly="True" 
                        IsReadOnlyCaretVisible="True" 
                        Width="200"
                        Text="{Binding ToDoHotkeyStr}" 
                        KeyDown="HotKeyDown"
                        KeyUp="HotKeyUp"
                        />
            </hc:UniformSpacingPanel>
        </StackPanel>
    </Grid>


</UserControl>
