<Window x:Class="HeatMapDemo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:oxy="http://oxyplot.org/wpf"
        Title="HeatMapDemo" Height="480" Width="640">
    <TabControl>
        <TabItem Header="HeatMap">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Slider Maximum="1.0" Minimum="0" x:Name="Slider" Value="0.5"/>
                <oxy:Plot Grid.Row="1">
                    <oxy:Plot.Axes>
                        <oxy:LinearAxis Key="x" Position="Bottom"/>
                        <oxy:LinearAxis Key="y" Position="Left" />
                        <oxy:LinearColorAxis Key="z" Position="Top" LowColor="White" HighColor="Red" PaletteSize="100">
                            <GradientStop Color="Aqua" Offset="0" />
                            <GradientStop Color="Red" Offset="{Binding ElementName=Slider, Path=Value}" />
                            <GradientStop Color="Black" Offset="1.0" />
                        </oxy:LinearColorAxis>
                    </oxy:Plot.Axes>
                    <oxy:Plot.Series>
                        <oxy:HeatMapSeries ColorAxisKey="Z" Data="{Binding Data}" X0="-1" X1="1" Y0="-1" Y1="1"/>
                    </oxy:Plot.Series>
                </oxy:Plot>
            </Grid>
        </TabItem>
        <TabItem Header="HeatMap With NaN Values">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <StackPanel Orientation="Horizontal">
                <Label Content="Invalid Number Color: "/>
                    <ComboBox  x:Name="Colors" Width="100">
                        <ComboBoxItem Content="Blue"/>
                        <ComboBoxItem Content="Gray"/>
                        <ComboBoxItem Content="Green"/>
                        <ComboBoxItem Content="Red"/>
                        <ComboBoxItem Content="Transparent"/>
                        <ComboBoxItem Content="Yellow"/>
                    </ComboBox>
                </StackPanel>
                <oxy:Plot Grid.Row="1">
                    <oxy:Plot.Axes>
                        <oxy:LinearAxis Key="x" Position="Bottom"/>
                        <oxy:LinearAxis Key="y" Position="Left" />
                        <oxy:LinearColorAxis Key="z" Position="Top" LowColor="White" HighColor="Red" PaletteSize="100" InvalidNumberColor="{Binding ElementName=Colors, Path=SelectedItem.Content}">
                            <GradientStop Color="Aqua" Offset="0" />
                            <GradientStop Color="Red" Offset="0.5" />
                            <GradientStop Color="Black" Offset="1.0" />
                        </oxy:LinearColorAxis>
                    </oxy:Plot.Axes>
                    <oxy:Plot.Series>
                        <oxy:HeatMapSeries ColorAxisKey="Z" Data="{Binding DataNaNValues}" X0="-1" X1="1" Y0="-1" Y1="1"/>
                    </oxy:Plot.Series>
                </oxy:Plot>
            </Grid>
        </TabItem>
    </TabControl>
</Window>
