dan gibson
dan gibson

Reputation: 3665

Setting Frame.Content doesn't always work

I have a Frame control and I'm setting the Content property. If I set it twice, first to one control then to another, it shows the first control instead of the second. If I display a message box after setting it the first time then it works fine (ie it displays the second control).

It's like I can only set Content once until the screen has been repainted. Calling Frame.UpdateLayout also doesn't help.

What should I call after setting Content so that I can be sure that Content is actually set to what I specify?

Upvotes: 1

Views: 458

Answers (1)

dan gibson
dan gibson

Reputation: 3665

Use Frame.Navigate(obj) instead of Frame.Content = obj.

Upvotes: 2

Related Questions