wpfspark
wpfspark copied to clipboard
clipborder over parentelement
Hi!
Do you still support 4.7.2?
I got the following glitch:
(ignore the news thing)
When I resize the parent control it jumps to normal and scales properly. Same when I change BackgroundBorder.BorderThickness. It just seems when loading, it does not refresh.
The xaml could be reduced to the following: (its grid{basic border, clipborder{canvas}} canvas' background is the gray image, the purple is the first borders background)
<local:ItemBorder x:Name="mainborder" Visibility="{Binding ElementName=thiscontrol,Path=ItemLayout.BackgroundVisibility}"
Background="{Binding ElementName=thiscontrol,
Path=BackgroundBorder.Background}"
BorderThickness="{Binding ElementName=thiscontrol,
Path=BackgroundBorder.BorderThickness.AsString}"
CornerRadius="{Binding ElementName=thiscontrol,
Path=BackgroundBorder.CornerRadius.AsString}"
BorderBrush="{Binding ElementName=thiscontrol,
Path=BackgroundBorder.BorderBrush}" Canvas.Top="10"
Grid.Row="1" Grid.Column="1"
>
</local:ItemBorder>
<local:ClipBorder x:Name="clipborder" Grid.Row="1" Grid.Column="1"
BorderThickness="{Binding ElementName=thiscontrol,
Path=BackgroundBorder.BorderThickness.AsString}"
CornerRadius="{Binding ElementName=thiscontrol,
Path=BackgroundBorder.CornerRadius.AsString}"
>
<Canvas x:Name="img" Background="{Binding ElementName=thiscontrol,Path=IconBrush, FallbackValue=blue}" MinHeight="30"
Visibility="{Binding ItemLayout.ImageVisibility, ElementName=thiscontrol}" DataContext="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType=local:uc_item}}" MinWidth="30"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
>
</Canvas>
</local:ClipBorder>
Hi @lturek, I am not sure if I fully understand your question here... do you have a sample project which can replicate this issue?
Another thing... have you considered overriding the MeasureOverride
/ ArrangeOverride
methods to ensure that the rendering is done properly during load?