I am having a strange problem with my implementation of prism. I am doing the following:
(1) Load a View in a Region (using EventAggregator to send message to a class that manages loading/clearing Views in Region)
(2) Load data in to the created View (again using EventAggregator to send and populate the data in the newly created View)
(3) I have a base class for my Views. In this base class, I am trying to access the parent of the View (using VisualTreeHelper.GetParent). This I am doing in an EventHandler (method) that is called when the datacontext of the View is changed
The problem is VisualTreeHelper.GetParent gives me 'null' sometimes, and the proper container on other times. Again, this is quite random.
While debugging, I found that the View is correctly getting loaded in the intended Region even when VisualTreeHelper.GetParent returns null.
Any help will be a blessing to me.
Thanks in advance,