AnimatedWrapPanel with adorned controls working very weird - displaced

Views for WPF Forum

Posted 3 months ago by Procam
Version: 24.1.3
Platform: .NET 6.0
Environment: Windows 11 (64-bit)
Avatar

Hello Actipro,

I want to use the AnimatedWrapPanel but found that when using adorned elements, these are displaced. I managed to reproduce it within your sample app.

Please find the code

\Actipro Software\WPF-Controls\v24.1.1\SampleBrowser\ProductSamples\ViewsSamples\QuickStart\Common\ProductListBoxItem.xaml

and modify in this way, replace the Border named 'border' with the following:

                <TextBox x:Name="ttt" Height="30" Width="50">
                    <TextBox.Text>
                        <Binding ElementName="ttt" Path="Text" NotifyOnSourceUpdated="True" NotifyOnTargetUpdated="True" NotifyOnValidationError="True">
                            <Binding.ValidationRules>
                                <validators:ValueIsNotNull ValidatesOnTargetUpdated="True"/>
                            </Binding.ValidationRules>
                        </Binding>
                    </TextBox.Text>
                    <TextBox.Style>
                        <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Static themes:SharedResourceKeys.TextBoxBaseStyleKey}}">
                            <Setter Property="Validation.ErrorTemplate">
                                <Setter.Value>
                                    <ControlTemplate>
                                        <Grid>
                                            <Border BorderBrush="Red" BorderThickness="1" HorizontalAlignment="Left">
                                                <AdornedElementPlaceholder Name="ErrorTextAdorner"/>
                                            </Border>
                                        </Grid>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </TextBox.Style>
                </TextBox>

and define also this:

    public class ValueIsNotNull : ValidationRule
    {
        public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo)
        {
            return new ValidationResult(false, "Value must not be null");
        }
    }

This validator forces the adorner to be displayed.

Now, restore/maximize the window repeatedly and you will see that the red adorners are displaced. Please do not move the mouse when restoring/maximizing. Moving the mouse or clicking to another place forces the rendering of the adorners and they are placed in to correct places. In my case, I have a splitter between the wrappanel and another container, and it happens when moving the splitter.

This behavior is very disappointing. Please fix.

Comments (3)

Answer - Posted 3 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Thank you for reporting this.  I believe we found a way to trigger the WPF adornments to update their locations.  This update will be in the next maintenance release v24.1.4.


Actipro Software Support

Posted 2 months ago by Procam
Avatar

Thanks! I will wait for that release.

The latest build of this product (v24.1.4) was released 1 month ago, which was before the next post in this thread.
Posted 17 days ago by Procam
Avatar

Tested with version v24.1.4. Even though sometimes it's a little off by one or two pixels, I hope this will be acceptable for our customers. Thanks, anyway!

Add Comment

Please log in to a validated account to post comments.