2
Vote

Zoombox.Scale throws NullReferenceException

description

Setting Zoombox.Scale through XAML throws a NullReferenceException, whether thru a binding or literal value, and will crash the Visual Studio 2010 designer.

comments

cwatford wrote Sep 27, 2012 at 3:46 PM

1.7.0 release, can't even scroll to the XAML in question without Visual Studio crashing (no exception given).

cwatford wrote Sep 27, 2012 at 3:48 PM

Bare bones XAML:
<tk:Zoombox Scale="2"
                    ViewStackIndex="0"
                    ViewStackMode="Auto"
                    ZoomOn="View">
                        <tk:Zoombox.ViewStack>
                            <tk:ZoomboxView>Fit</tk:ZoomboxView>
                        </tk:Zoombox.ViewStack>
                        <local:SomeUserControl />
</tk:Zoombox>

cwatford wrote Sep 27, 2012 at 4:03 PM

Rebuilding my own copy of fixes some of the crashes, however, adding a Binding to Zoombox.Scale causes VS to crash as well.

BoucherS wrote Dec 17, 2012 at 2:16 PM

Can not reproduce in v1.9. I get no crash in VS and no crash in VS 2010 Designer.
Here's the code I used in XAML :

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="20" />
        <RowDefinition Height="*" />
    </Grid.RowDefinitions>        
    <xctk:DoubleUpDown x:Name="_doubleUpDown" Grid.Row="0" Value="2" Increment="0.5"/>
    <xctk:Zoombox Scale="{Binding Value, ElementName=_doubleUpDown, Mode=TwoWay}"
                  Grid.Row="1"
                  ViewStackIndex="0"
                  ViewStackMode="Auto"
                  ZoomOn="View">
                 <xctk:Zoombox.ViewStack>
                    <xctk:ZoomboxView>Fit</xctk:ZoomboxView>
                  </xctk:Zoombox.ViewStack>
              <Image Source="Default.jpg" />
    </xctk:Zoombox>         
</Grid>

hillin wrote May 12, 2013 at 2:40 PM

I can reproduce with version 1.9, with VS2010.

emartin wrote May 13, 2013 at 3:04 PM

Can anyone attach a zipped sample that reproduce the crash ?

cube45 wrote Jul 24 at 4:07 PM

Hi, I have the same problem that causes a crash in VS2012.
Here is a sample code I made to be sure the issue was in Zoombox and not in my code.
<Window x:Class="ZoomboxBug.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <xctk:Zoombox x:Name="Zoom">
            <TextBlock Foreground="Black">Hello World</TextBlock>
        </xctk:Zoombox>
    </Grid>
</Window>
using System.Windows;

namespace ZoomboxBug {
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window {
        public MainWindow() {
            InitializeComponent();
            this.Zoom.Scale = 1;
        }
    }
}
Extended.Wpf.Toolkit v 2.2.1 installed via NuGet

Regards,
cube45

BoucherS wrote Aug 5 at 6:53 PM

Hi,

This issue will be fixed in v2.4.