Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

What event would I use that's analogous to the old VB6 Activate event?

$
0
0

We've got a new WPF application recently released. We've got to refresh some data on 2 user controls whenever those controls come back into focus.

Right now we have the user controls placed onto a headered content control. Then as the user navigates through our application, selecting new areas to go to, other user controls are replaced and displayed to the user. As the user goes through the application the user controls are put into a dictionary where they reside in memory. When a user wants to return to an area to view the data they were previously looking at, then code is done to show the user that data in the user control associated with that data.

This all works fine. However, there's some textblocks which display data only the first time that user control is instantiated. This proving to be a bit confusing to the users because as they move through the app they're making changes to data, but those user controls don't reflect the changed data. Now, we could handle this in two ways: one would be to have a button next to those textblocks to refresh the data. But we'd rather do it using an event that fires when the user controls gets displayed again. Back in the old VB6 days we could use the Activate event of a window/form to update data. But I've looked and there's no Activate or Activated event for user controls. I tried using the GotFocus event, but that doesn't work. So, how do we accomplish what we're trying to do?


Rod


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>