Hello,
I have a ListBox like object in my diagram:
<local:InertListBox Margin="5,0,0,0" BorderThickness="0" VerticalAlignment="Top" ItemsSource="{Binding Path=Data.Items}" ItemTemplate="{StaticResource AttributeItem}"/>
The attribute item template is defined this way:
<DataTemplate x:Key="AttributeItem" >
<StackPanel Orientation="Horizontal" >
<span style="font-size: 12px; line-height: 1.4;"> <TextBlock Margin="10,0,0,0" HorizontalAlignment="Left" Text="{Binding Path=Name, Mode=TwoWay}" go:Part.TextEditable="True"/></span>
<TextBlock HorizontalAlignment="Left" Text=" : " />
<TextBlock HorizontalAlignment="Left" Text="{Binding Path=Type, Mode=TwoWay}" go:Part.TextEditable="True"/>
</StackPanel>
</DataTemplate>
InertListBox inherits from ListBox, and is its implementation is exactly the same as in the DynamicPorts Demo example. This allows me to edit the TextBlock within the ListBox items.
public class InertListBox : ListBox
{
protected override DependencyObject GetContainerForItemOverride()
{
return new InertListBoxItem();
}
}
public class InertListBoxItem : ListBoxItem
{
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
{
base.OnMouseLeftButtonDown(e);
e.Handled = false;
}
}
My problem is that I when I Zoom in or out of my diagram using the Ctrl-MouseWheel combination, I cannot do so while the Mouse pointer is over a InertListBoxItem (in fact this is common to the ListBoxItem implementation). The zooming behaviour works once again as soon as I move the pointer out of the ListBoxItem.