Completed
Last Updated: 18 Sep 2020 04:47 by ADMIN
Release LIB 2020.3.921 (09/21/2020)
Stefan
Created on: 31 Jul 2020 18:42
Category: DataPager
Type: Bug Report
2
DataPager Office2016Touch Theme Style Binding Errors

When using the Office2016Touch theme and the default control template, the following binding errors can be observed in Visual Studio output:

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ContentPresenter', AncestorLevel='1''. BindingExpression:Path=(TextElement.Foreground); DataItem=null; target element is 'TextBlock' (Name=''); target property is 'Foreground' (type 'Brush')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ContentPresenter', AncestorLevel='1''. BindingExpression:Path=(TextElement.Foreground); DataItem=null; target element is 'TextBlock' (Name=''); target property is 'Foreground' (type 'Brush')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ContentPresenter', AncestorLevel='1''. BindingExpression:Path=(TextElement.Foreground); DataItem=null; target element is 'TextBlock' (Name=''); target property is 'Foreground' (type 'Brush')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ContentPresenter', AncestorLevel='1''. BindingExpression:Path=(TextElement.Foreground); DataItem=null; target element is 'TextBlock' (Name=''); target property is 'Foreground' (type 'Brush')

Setup

  • 2020 R2 SP1 NoXaml Assemblies (.NET Framework)
  • Office2016Touch Theme
  • Style with the default extracted ControlTemplate (no custom changed required).

 

For your convenience, a reproducible project is attached.

1 comment
ADMIN
Martin Ivanov
Posted on: 07 Aug 2020 14:22

Hello Stefan,

Thank you for the project. I was able to reproduce the errors. It looks like this happens because few parts of the DataPager's XAML evaluates before the control gets loaded. Once the control is ready, the same bindings are re-evaluated and they work properly. This said, you can safely ignore the errors. 

Regards,
Martin Ivanov
Progress Telerik