<Window x:Class="YoseenPTZ.ViewDef.PresetView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:YoseenPTZ.ViewDef"
        
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
        xmlns:mdix="http://materialdesigninxaml.net/winfx/xaml/themes"
        xmlns:mvvm="clr-namespace:MVVM;assembly=MVVM"
        xmlns:mvvmhelpers="clr-namespace:MVVM.Helpers;assembly=MVVM"
        
        xmlns:resdef="clr-namespace:YoseenPTZ.ResourceDef"
        xmlns:coredef="clr-namespace:YoseenPTZ.CoreDef"

        WindowStartupLocation="CenterOwner"
        
        Background="{StaticResource MaterialDesignPaper}"
        TextElement.Foreground="{StaticResource MaterialDesignBody}"
        Style="{StaticResource MaterialDesignWindow}"
        mvvmhelpers:WindowHelper.ShowMinimizeButton="False"
        mvvmhelpers:WindowHelper.ShowMaximizeButton="False"
        
        Title="预置位-后端" Height="600" Width="600">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="120"></RowDefinition>
        </Grid.RowDefinitions>

        <DataGrid x:Name="dgPreset" AutoGenerateColumns="False" CanUserSortColumns="False" CanUserAddRows="False"
              mdix:DataGridAssist.CellPadding="4,1,4,1"
              mdix:DataGridAssist.ColumnHeaderPadding="4,1,4,1" >

            <DataGrid.Resources>
                <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
                    <Setter Property="HorizontalAlignment" Value="Center"></Setter>
                    <Setter Property="VerticalAlignment" Value="Center"></Setter>
                    <Setter Property="FontWeight" Value="Bold"></Setter>
                    <Setter Property="FontSize" Value="18"></Setter>
                </Style>
                <Style TargetType="{x:Type TextBox}">
                    <Setter Property="HorizontalAlignment" Value="Left"></Setter>
                    <Setter Property="VerticalAlignment" Value="Center"></Setter>
                    <Setter Property="FontWeight" Value="Bold"></Setter>
                    <Setter Property="Width" Value="100"></Setter>
                    <Setter Property="Background" Value="LightBlue"></Setter>
                </Style>
            </DataGrid.Resources>

            <DataGrid.Columns>
                <DataGridTemplateColumn Width="50">
                    <DataGridTemplateColumn.Header>
                        <TextBlock Text="索引"></TextBlock>
                    </DataGridTemplateColumn.Header>
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=ext_index}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>

                <DataGridTemplateColumn Width="*">
                    <DataGridTemplateColumn.Header>
                        <TextBlock Text="名称"></TextBlock>
                    </DataGridTemplateColumn.Header>
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBox Text="{Binding Path=name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="200"></TextBox>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>

                <DataGridTemplateColumn Width="100">
                    <DataGridTemplateColumn.Header>
                        <TextBlock Text="水平-0.01"></TextBlock>
                    </DataGridTemplateColumn.Header>
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBox Text="{Binding Path=pan,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" ></TextBox>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>

                <DataGridTemplateColumn Width="100">
                    <DataGridTemplateColumn.Header>
                        <TextBlock Text="垂直-0.01"></TextBlock>
                    </DataGridTemplateColumn.Header>
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBox Text="{Binding Path=tilt,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" ></TextBox>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>

                <DataGridTemplateColumn Width="100">
                    <DataGridTemplateColumn.Header>
                        <TextBlock Text="可见光焦距-0.1" FontSize="10"></TextBlock>
                    </DataGridTemplateColumn.Header>
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBox Text="{Binding Path=zoom,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" ></TextBox>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>

                <DataGridTemplateColumn Width="80">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button Width="50" Height="25" VerticalAlignment="Center" Style="{StaticResource MaterialDesignIconButton}" x:Name="btnPresetGoto" Click="btnPresetGoto_Click">
                                <mdix:PackIcon Kind="Redo"></mdix:PackIcon>
                            </Button>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn Width="80">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button Width="50" Height="25" VerticalAlignment="Center" Style="{StaticResource MaterialDesignIconButton}" x:Name="btnPresetSave" Click="btnPresetSave_Click">
                                <mdix:PackIcon Kind="Cog"></mdix:PackIcon>
                            </Button>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
            </DataGrid.Columns>
        </DataGrid>

        <Grid Grid.Row="1" Margin="4" Background="#202020">
            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <xctk:PropertyGrid Grid.Column="0" x:Name="pgTest"
                        ShowTitle="False"
                        ShowSearchBox="False" ShowSortOptions="False" ShowSummary="True" Foreground="Black"
                        AutoGenerateProperties="True">
                <xctk:PropertyGrid.Resources>
                    <Style TargetType="TextBlock" BasedOn="{StaticResource {x:Type TextBlock}}">
                        <Setter Property="Foreground" Value="Black"></Setter>
                    </Style>
                </xctk:PropertyGrid.Resources>
            </xctk:PropertyGrid>
            <Button Grid.Column="1" x:Name="btnTest" Content="测试-开始" Click="btnTest_Click" Style="{StaticResource button_w100h30}"></Button>
        </Grid>
    </Grid>
    
</Window>
