AdvancedTextBlock Captures binding is invalid

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 24 days ago by jun.Yang
Version: 22.1.2
Platform: .NET 6.0
Environment: Windows 11 (64-bit)

After the AdvancedTextBlock Captures property is bound, and then modify the Captures property data, the UI will not highlight the corresponding characters。

Comments (3)

Posted 23 days ago by Actipro Software Support - Cleveland, OH, USA


The Captures property is not currently watching for any changes to the collection itself, only to changes to the Captures property value.  What kind of collection are you passing into the Captures property?

Actipro Software Support

Posted 21 days ago by jun.Yang

Similar to Visual Studio Solution search match highlighting, how would I achieve this?

Answer - Posted 21 days ago by Actipro Software Support - Cleveland, OH, USA


The AdvancedTextBlock.Captures property needs an enumerable of StringFilterCapture objects.  Each StringFilterCapture is an index/length set specifying the character range of the "captured" (highlighted) text in the AdvancedTextBlock.Text string value.

For my previous question, I meant what kind of collection Type are you binding to the AdvancedTextBlock.Captures property?  Is the Type something that implements INotifyCollectionChanged, such as an ObservableCollection<StringFilterCapture>?  Or is it another Type?

Our previous reply was indicating that we don't currently watch for INotifyCollectionChanged events on the collection bound to AdvancedTextBlock.Captures.  But we do update the captures if the property value of the AdvancedTextBlock.Captures property changes.

Actipro Software Support

The latest build of this product (v22.1.3) was released 20 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.