2

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?

awh112
  • 1,466
  • 4
  • 22
  • 34
Chris
  • 826
  • 10
  • 26
  • It would be nice if you narrow screenshots (you only want to show us sliders, right?) and add some explanation of *weird behavior*. Is it shifted or what? What's value slider has? – Sinatr Mar 13 '17 at 15:36
  • In the first picture I was showing that the sliders are binded to the scaletransform. The issue that occurs is when the properties panel is slid to the left while the scaletransform is increased. In the first picture you can see that the itemscontrol has a drop shadow. In the second picture, the dropshadow disappears and the blue background covers part of the itemscontrol – Chris Mar 13 '17 at 15:41
  • 1
    Try to create [mcve](http://stackoverflow.com/help/mcve) next time, I believe demonstrating issue with [animated gif](http://www.screentogif.com/) (as e.g. in [this question](http://stackoverflow.com/q/42676198/1997232)) really helps to make it clear (I thought the problem with slider). As for problem with shadow, have you looked for something already (here is [something](http://stackoverflow.com/q/2314957/1997232), again poor question, it's not clear what is the issue, try to set ItemsTemplate or specify in datatemplate fixed element height)? – Sinatr Mar 13 '17 at 15:53

0 Answers0