This question is locked. New answers and comments are not allowed.
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:
So far, the only place I have been able to find that will perform the call so it works is using the Layout
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?
Thanks
Ernie
01.
private
void
WireCells()
02.
{
03.
var textblocks = AssociatedObject.ChildrenOfType<TextBlock>();
04.
05.
if
(textblocks ==
null
|| !textblocks.Any())
06.
return
;
07.
08.
var tbsWithCellData = textblocks.Where(tb => tb.DataContext
is
CellData);
09.
tbsWithCellData.ForEach(t =>
10.
{
11.
t.MouseLeftButtonDown -= OnCellMouseLeftButtonDown;
12.
t.MouseLeftButtonDown += OnCellMouseLeftButtonDown;
13.
});
14.
}
So far, the only place I have been able to find that will perform the call so it works is using the Layout
1.
protected
override
void
OnAttached()
2.
{
3.
base
.OnAttached();
4.
AssociatedObject.LayoutUpdated += AssociatedObject_OnLayoutUpdated;
5.
}
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?
Thanks
Ernie