Hello,
I'm trying to add an event handler onto a xamGrid that is in an OutlookBarGroup. I'm trying to do this from the loaded event, but everytime I call this.FindName("grid") - it returns nothing. At what point does the grid become instantiated?
Thanks.
Hi,
Actually you are right, in order to be able to get the reference, you should call the code from LayoutUpdated event handler.
Could you try if that will work for you? See this thread for more info.
HTH,
Thanks Stoimen,
I tried it off the main control (this.FindName) and I also tried it off the Outlookbar.
So from my control's Loaded event, if I call:
this.FindName("tv") it returns nothing
and if I call it from the OutlookBar:
this.ob.FindName("tv") it returns nothing
What's strange is that I can get to all child controls from the Loaded event if for example I do:
this.ob.Groups(0).Content();
Thanks
What is the object off which you are calling the FindName() ?
You could also try to do it by using the XamOutlookBar object, e.g.:
Button b1 = this.XamWebOutlookBar.FindName("btnItemsSource") as Button;