WPF Frame Source Refreshing The Loaded Page
I've come across a strange scenario where a frame refuses to refresh its content.
I can kinda understand what's happening but the solution is not coming to me.
I have a page that has a frame (Frame1) and several buttons. When I click on a button a page is loaded into the frame. This works perfectly in most situations.
Private Sub btnIncidents_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnIncidents.Click Frame1.Source = New System.Uri("/Incident/Incidents.xaml", UriKind.Relative) End Sub
However, I have a situation where I need to select the button that was previously clicked to effectively do a Refresh on the Uri. The problem is it simply does nothing because the Uri hasn't changed. That makes sense but it's not what I want, I need to call it again.
My first solution was to introduce Frame1.Refresh which initially did the trick. But once a page was Refreshed, none of the Buttons could load a different page.
It was as if by calling Frame1.Refresh I'd broken the Frames ability to navigate to other pages.
My second idea was to set the Frame source to Nothing (Null) and then set the source to the URI but that didn't work either. ie Frame1.Source = Nothing
Has anyone else come across this or maybe have some suggestions? I just need to Refresh/Reload the Frames page without breaking the Frame!
I had the similar problem - with html though. Resolved it with
apparently will clear navigation history, but in my case I do not really care.
- → Change background of some holiday dates in Calendar control
- → Hiding inherited members
- → How to access a child control's property when it is declared in a ControlTemplate?
- → how to access a child element dynamically in WPF
- → A simpel WPS using MVVM and EF
- → WPF problems refreshing textblock bound to console.stdout
- → View lost when refreshing ObjectDataProvider
- → Refreshing a wpf databinding after object has been updated
- → WPF Frame Source Refreshing the Loaded Page
- → What causes Visual Studio 2008 SP1 to crash when switch to Design View of a WPF application
- → How to display placeholder value in WPF Visual Studio Designer until real value can be loaded
- → Watermark / hint / placeholder text in TextBox?