Retain content on Page1 after navigating to Page2 and back to Page1 in WPF
On Page1 I have a TextBox
, ComboBox
and Hyperlink
control. The TextBox
has a value "ABC" and the ComboBox
has a value "123".
When I click on the Hyperlink
on Page1 I navigate to Page2.
On Page2 I click on a back Button
which takes me back to Page1.
I can actually see my values. However I cannot see the values when the controls on Page1 are bound to a data source.
If I have XAML like this:
<TextBox: x:Name="txtName" Text="{Binding Path = uName}" />
then in the Page1 navigation to Page2 and back it is not retaining the values in the TextBox
and ComboBox
.
Is this some kind of intended behavio开发者_如何学JAVAur or a bug?
Have you remembered to set KeepAlive="True"
in Page1 XAML?
精彩评论