赢8 RT路由参数 [英] Win 8 RT routing parameters

查看:131
本文介绍了赢8 RT路由参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须通过不同的页面的路线和传递路由它们之间的参数。我做了这种情况发生,我传递的参数,但我没有访问对象的属性。

I have to route through different pages and pass routing parameters between them. I have made that happen and I am passing the parameters but I do not have access to the object property.

void itemClick(object sender, ItemClickEventArgs e)
        {

            this.Frame.Navigate(typeof(Views.SongPicker) , e.ClickedItem );
        }

和其他的页面上我recive参数对象作为导航参数。

and on the other page I recive the parameter object as a navigation parameter.

 protected override void LoadState(Object navigationParameter, Dictionary<String, Object> pageState)
        {

        }

我有对象的属性不能访问。
我会很感激的帮助

I have no access to the object's properties. I would really appreciate the help.

推荐答案

尝试将对象转换为你的类型,如:

Try to cast the object to your type, like:

protected override void LoadState(Object navigationParameter, Dictionary<String, Object> pageState)
    {
        var param = navigationParameter as MyType;
    }

和如果该类型不能为空:

And if the type is not nullable:

var param = (MyType)navigationParameter;

这篇关于赢8 RT路由参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆