I am using the ZoomPanel inside of a WPF UserControl. Following is my code:
The issue I am having is with the GroupBox that has the ZoomPanel in it. As the code is above, when I open my application, the displayed image in the GroupBox has a lot of space between the top of the image and the GroupBox line. When I maximize the application the space goes away and the top of the image bumps up against the GroupBox line as desired. If I take the ZoomPanel out and leave the Image control and reopen the application, the top of the image bumps up against the GroupBox line when in a minimized and maximized mode. Any ideas what may be happening?
Code:
<UserControl x:Class="Views.ZoomPanelViewer"
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:ab2d="clr-namespace:Ab2d.Controls;assembly=Ab2d.Controls.ZoomPanel"
xmlns:local="clr-namespace:Base.Converters"
mc:Ignorable="d"
Height="auto" Width="auto">
<UserControl.Resources>
<local:ByteArrayToBitmapConverter x:Key="ByteArrayToBitmapConverter"/>
</UserControl.Resources>
<Grid>
<DockPanel LastChildFill="True" Width="auto" Margin="2">
<GroupBox Header="Crash Report Pages" DockPanel.Dock="Top" >
<DockPanel>
<ListView ItemsSource="{Binding Path=ListOfPages}" SelectedItem="{Binding Path=SelectedPage}">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Horizontal">
</VirtualizingStackPanel>
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.ItemTemplate>
<DataTemplate>
<Border BorderThickness="1" CornerRadius="10" BorderBrush="Black">
<Image Source="{Binding Path=ThumbnailPage}" Margin="2"></Image>
</Border>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</DockPanel>
</GroupBox>
<GroupBox Header="Image Control" DockPanel.Dock="Top">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right">
<StackPanel Margin="10,0,0,0" VerticalAlignment="Top">
<Label Content="Rotation" />
<Slider Name="RotationSlider" Minimum="-180" Maximum="180" Width="200"
TickPlacement="BottomRight"
Ticks="-180, -90, 0, 90, 180"
Orientation="Horizontal"
IsSnapToTickEnabled="True" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<ab2d:ZoomController Name="ZoomController1" TargetZoomPanel="{Binding ElementName=ZoomPanel1}"/>
<TextBlock Name="testtb"/>
</StackPanel>
</StackPanel>
</Grid>
</GroupBox>
<GroupBox Header="Selected Page" DataContext="{Binding Path=SelectedPage}" Width="auto" DockPanel.Dock="Left" Name="gbImage">
<ab2d:ZoomPanel Name="ZoomPanel1"
IsMouseWheelZoomEnabled="True"
IsAnimated="True" IsPanningAnimated="False" VerticalAlignment="Top">
<Image x:Name="myImage" Source="{Binding Path=Page}" VerticalAlignment="Top"
HorizontalAlignment="Center"
RenderOptions.BitmapScalingMode="HighQuality">
<Image.LayoutTransform>
<RotateTransform Angle="{Binding ElementName=RotationSlider, Path=Value}"></RotateTransform>
</Image.LayoutTransform>
</Image>
</ab2d:ZoomPanel>
</GroupBox>
</DockPanel>
</Grid>
</UserControl>The issue I am having is with the GroupBox that has the ZoomPanel in it. As the code is above, when I open my application, the displayed image in the GroupBox has a lot of space between the top of the image and the GroupBox line. When I maximize the application the space goes away and the top of the image bumps up against the GroupBox line as desired. If I take the ZoomPanel out and leave the Image control and reopen the application, the top of the image bumps up against the GroupBox line when in a minimized and maximized mode. Any ideas what may be happening?

