Open Anton-V-K opened 7 years ago
Hi, I cannot reproduce the exception. Here is the sample I used : <Window x:Class="WpfApplication198.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:WpfApplication198" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" mc:Ignorable="d" Title="MainWindow" Height="350" Width="525">
namespace WpfApplication198
{
///
public double ImageWidth
{
get;
set;
}
public double ImageHeight
{
get;
set;
}
} }
I am getting the same error after updating to Release 3.2. I downloaded the source code and traced it. private void UpdateViewFinderDisplayContentBounds() { ..... // ensure the display panel has a size Size contentSize = _content.RenderSize; Size viewFinderSize = _viewFinderDisplay.AvailableSize; ===== AvailableSize is EMPTY .... _viewFinderDisplay.Scale = scale; scale is -Infinity
This function will raise an exception With and Height cannot be negative
public object Convert( object value, Type targetType, object parameter, CultureInfo culture ) { ..... double scale = _zoombox._viewFinderDisplay.Scale _zoombox._viewboxFactor; Rect result = new Rect( viewport.Left scale, viewport.Top scale, viewport.Width scale, viewport.Height * scale );
I fixed the exception by adding the following code to Scale. It checks if the scale is negative it returns 1 ZoomboxViewFinderDisplay internal double Scale { get { if (_scale < 0) return _scale = 1; return _scale; } }
Hi, I understand the error, but can you submit a sample and the steps to reproduce it so I can test the problem ? Thanks.
Hi,
I am using the Zoombox in a user control that is placed on the main window
<UserControl x:Class="Digitizer.View.DTBoardView"
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:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:DTBoardView="clr-namespace:Digitizer.BoardView;assembly=Digitizer.BoardView"
xmlns:DTUtilitiesConverter="clr-namespace:Digitizer.Utilities.Converter;assembly=Digitizer.Utilities"
xmlns:DTGraphics="clr-namespace:Digitizer.Graphics;assembly=Digitizer.Graphics"
xmlns:Digitizer="clr-namespace:Digitizer"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
AllowDrop="True"
DragEnter="UserControl_DragEnter"
Drop="UserControl_Drop">
Hi, I don't get the exception, but I can see the reason why. It will be fixed in v3.6. Thanks.
Thank you
I've been using Zoombox with 3.1.0 without any issues. After upgrading to 3.2.0 the exception occurs saying about some negative values used for rect initialization. After manual downgrade to 3.1.0 the issue is gone...
The XAML fragment:
Probably something goes wrong when Canvas size is updated based on the bindings...