I would like to wire the left click of all Pivot Grid cells to perform something using a Behavior<RadPivotGrid>. So basically what I have here:
var textblocks = AssociatedObject.ChildrenOfType<TextBlock>();
var tbsWithCellData = textblocks.Where(tb => tb.DataContext
t.MouseLeftButtonDown -= OnCellMouseLeftButtonDown;
t.MouseLeftButtonDown += OnCellMouseLeftButtonDown;
So far, the only place I have been able to find that will perform the call so it works is using the Layout
AssociatedObject.LayoutUpdated += AssociatedObject_OnLayoutUpdated;
Again, this is via a Behavior. But the above is fired almost constantly since that event is fired any time, for example, the mouse moves over the control.
I tried using the DataProvider.StatusChanged event and waiting for it to be Ready but the cells are not yet rendered there either. What event could I wire that guarantees the TextBlocks are all rendered and ready to be wired?