gpt4 book ai didi

c# - Win 8 RT路由参数

转载 作者:行者123 更新时间:2023-11-30 17:08:59 25 4
gpt4 key购买 nike

我必须通过不同的页面进行路由并在它们之间传递路由参数。我做到了这一点,我正在传递参数,但我无权访问对象属性。

void itemClick(object sender, ItemClickEventArgs e)
{

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

在另一个页面上,我将参数对象作为导航参数接收。

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

}

我无权访问对象的属性。非常感谢您的帮助。

最佳答案

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

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

如果类型不可为空:

var param = (MyType)navigationParameter;

关于c# - Win 8 RT路由参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13375845/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com