【发布时间】:2019-09-24 18:28:56
【问题描述】:
我在将数据从类传输到xaml 页面时遇到问题,在我的控制台数据中显示在类中,但它没有传递到UWP 中的xaml 页面
var commonCheckValues = new CommonCheckValues();
if (!Common.GetCommonCheckVars(commonCheckValues))
return;
var data = new PrintableReceiptData
{
TerminalName = commonCheckValues.Session.TerminalName,
TableNumber = commonCheckValues.Order.Model.TableName,
};
Frame frame = new Frame();
frame.Navigate(typeof(demoProject.Scenario1Basic), data);
Window.Current.Content = frame;
Window.Current.Activate();
因此,它将数据显示到数据变量中,但是当我尝试作为参数传递时,它不会在 Scenario1Basic 页面上接收值。
任何建议表示赞赏。
【问题讨论】:
-
OnNavigatedTo覆盖方法中的数据你拿到了吗? -
我没有在 OnNavigatedTo 方法中获得任何数据。
-
protected override void OnNavigatedTo(NavigationEventArgs e) { // 我这里需要数据,但我拿不到 }
-
NavigationEventArgs 参数字段中是否有数据?
-
不,但我需要这种方法的数据??