<UserControl x:Class="WpfApp1.CharttoImage.ScanGraph"
             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:WpfApp1.CharttoImage" xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800" Background="White">
    <UserControl.Resources>
        <local:ScanGraphVm x:Key="viewModel"/>
    </UserControl.Resources>
    <Grid x:Name="grid_root" d:DataContext="{StaticResource  viewModel}">
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        
        <StackPanel Orientation="Horizontal">
            <TextBlock Margin="5">
                X = [<Run Text="{Binding XMin}"/> ~ <Run Text="{Binding XMax}"/>]
            </TextBlock>
            <TextBlock Margin="5">
                Y = [<Run Text="{Binding YMin}"/> ~ <Run Text="{Binding YMax}"/>]
            </TextBlock>
        </StackPanel>
        <lvc:CartesianChart x:Name="chart" x:FieldModifier="public" Grid.Row="1" 
                                 Hoverable="False" DisableAnimations="True" DataTooltip="{x:Null}" Margin="5">
            <!--<lvc:CartesianChart.AxisX>
                <lvc:Axis x:Name="axisX_0" MaxValue="{Binding XMax}" MinValue="{Binding XMin}"/>
            </lvc:CartesianChart.AxisX>
            <lvc:CartesianChart.AxisY>
                <lvc:Axis x:Name="axisY_0" MaxValue="{Binding YMax}" MinValue="{Binding YMin}" />
            </lvc:CartesianChart.AxisY>
            <lvc:CartesianChart.Series>
                <lvc:LineSeries x:Name="series_0" Values="{Binding Values}"/>
            </lvc:CartesianChart.Series>-->
            <lvc:CartesianChart.AxisX>
                <lvc:Axis x:Name="axisX_0" x:FieldModifier="public" MaxValue="{Binding XMax}" MinValue="{Binding XMin}" />
            </lvc:CartesianChart.AxisX>
            <lvc:CartesianChart.AxisY>
                <lvc:Axis x:Name="axisY_0" x:FieldModifier="public" MaxValue="{Binding YMax}" MinValue="{Binding YMin}" />
            </lvc:CartesianChart.AxisY>
            <lvc:CartesianChart.Series>
                <lvc:LineSeries x:Name="series_0" x:FieldModifier="public" Values="{Binding Values}" />
            </lvc:CartesianChart.Series>
        </lvc:CartesianChart>
    </Grid>
</UserControl>
