<Window x:Class="WpfNodeEdittorDemo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfNodeEdittorDemo"
        xmlns:st ="clr-namespace:ST.Library.UI.NodeEditor;assembly=ST.Library.UI"
        mc:Ignorable="d"
        PreviewKeyDown="UserControl_PreviewKeyDown"
        Title="MainWindow" Height="720" Width="1280" Initialized="Window_Initialized">
    <Grid x:Name="Grid1">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid Margin="5" Grid.Row="0" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto"/>
                <ColumnDefinition Width="auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <StackPanel Orientation="Horizontal">
                <Button x:Name="ButtonOpen"  Content="加载" Click="Button_Click_Open" Width="70" />
                <Button x:Name="ButtonNew"  Content="打开" Click="Button_Click_New"  Width="70" />
                <Button x:Name="ButtonClear"  Content="清除" Click="Button_Click_Clear"  Width="70"/>
                <Button x:Name="ButtonSave"  Content="保存" Click="Button_Click_Save" Width="70"  Margin="0,0,10,0"/>
                <Button  Content="自动对齐" Click="AutoAlignment_Click" Width="70"/>
            </StackPanel>
            <Grid Grid.Column="2">
                <Slider x:Name="ZoomSlider"  Width="200" Value="{Binding STNodeEditorHelper.CanvasScale}" Maximum="3" Minimum="0.45" HorizontalAlignment="Right"/>
            </Grid>
        </Grid>


        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions >
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="300"/>
            </Grid.ColumnDefinitions>
            <Grid >
                <Grid.RowDefinitions>
                    <RowDefinition Height="300"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>

            </Grid>
            <WindowsFormsHost Grid.Column="0" >
                <st:STNodeEditor  x:Name="STNodeEditorMain"  MouseDown="STNodeEditorMain_MouseDown" MouseUp="STNodeEditorMain_MouseUp" MouseMove="STNodeEditorMain_MouseMove" MouseWheel="STNodeEditorMain_MouseWheel"/>
            </WindowsFormsHost>

            <Grid  Grid.Column="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="250"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <ScrollViewer Grid.Row="0"  HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                    <WindowsFormsHost Grid.Row="0">
                        <st:STNodeTreeView x:Name="STNodeTreeView1"  />
                    </WindowsFormsHost>
                </ScrollViewer>
                <WindowsFormsHost Grid.Row="2">
                    <st:STNodePropertyGrid x:Name="STNodePropertyGrid1" />
                </WindowsFormsHost>
            </Grid>
        </Grid>
    </Grid>
</Window>
