I have created a wpf program that allows you to move controls on a ItemsControl
Panel to replicate a zebra printer label, which then can be printed. I have created a zoom in feature binded to the sliders below the itemscontrol
. Image below:
sliders binded to rendertransform
This works flawlessly. However, if you move the properties panel closer to the itemscontrol and zoom in this happens: Weird behaivor
I don't want the blue background to hide the itemscontrol
. I want the properties panel simply to slide over the itemscontrol
without affecting how the itemscontrol
displays.
Here is the xaml code for the rendertransform
and itemscontrol
<Grid x:Name="BackGroundGrid" ClipToBounds="True">
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF257DA6" Offset="1" />
<GradientStop Color="White" Offset="0.233" />
</LinearGradientBrush>
</Grid.Background>
<ItemsControl x:Name="Canvas" Height="230" Margin="79,115,0,0" VerticalAlignment="Top" Background="#FFE4E4E4" HorizontalAlignment="Left" Width="800" ClipToBounds="False" Panel.ZIndex="-2" ItemsSource="{Binding Children}" DataContext="{Binding Source={StaticResource MainWindowViewModel}}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Grid/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseMove">
<i:InvokeCommandAction Command="{Binding CanvasMouseMoveCommand}" CommandParameter="{Binding ElementName=Canvas}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<ItemsControl.Effect>
<DropShadowEffect BlurRadius="10" Opacity="0.5" />
</ItemsControl.Effect>
<ItemsControl.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="{Binding Value, ElementName=slider}" ScaleY="{Binding Value, ElementName=slider}" CenterX="{Binding Value, ElementName=slider1}" CenterY="{Binding Value, ElementName=slider2}" />
<SkewTransform />
<RotateTransform />
<TranslateTransform />
</TransformGroup>
</ItemsControl.RenderTransform>
</ItemsControl>
For the most part, I've ignored this issue, but it's a bigger problem when dealing with smaller monitors. My question is is there any obvious reason for this behavior? And if so, how can I fix it?