开发者

OwnsJournal breaks UriMapper

If I use the OwnsJournal option for JournalOwnership, the UriMapping stops working, as in only /Views/Main.xaml will be shown even if the uri matches the id/{guid} format. Anyone run into this?

<Grid x:Name="root" Background="White">
    <navigation:Frame JournalOwnership="OwnsJournal">
        <navigation:Frame.UriMapper>
            <uriMapper:UriMapper>
                <uriMapper:UriMapping Uri="id/{guid}" MappedUri="/Views/Redirector.xaml?id={guid}" />
                <uriMapper:UriMapping Uri="" MappedUri="/Views/Main.xaml" />
            </uriMapper:UriMapper>
        </navigation:Frame.UriMapper>
    &l开发者_StackOverflow中文版t;/navigation:Frame>
</Grid>


Setting Frame.JournalOwnership to OwnsJournal basicly disables frame responding to UriMapping rules, it can be used when you have multiple frames in single application, you choose a main frame that will be responding to uri mapping rules, and the rest should maintain their own journal, so you set OwnsJournal for them.

Otherwise all frames would be responding to URL and if you had 3 frames in single application displayed, each would navigate independently to same view, which is not desired behaviour.

Once frame has OwnsJournal property , only way to navigate it is from code by calling Navigate method.

If you want Frame to respond to URL changes, you need to leave its JournalOwnership at Automatic

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜