新式 UI 中页面导航中的接收参数

本文关键字:参数 UI 新式 导航 | 更新日期: 2023-09-27 18:34:02

我使用现代UI框架,我使用页面导航功能

    var bs = new BBCodeBlock();
    try
    {
        bs.LinkNavigator.Navigate(new Uri("../SomePage.xaml", UriKind.Relative), this);
    }
    catch (Exception error)
    {
        ModernDialog.ShowMessage(error.Message, FirstFloor.ModernUI.Resources.NavigationFailed, MessageBoxButton.OK);
    }

我想传递某个参数,说"A"到导航页面并在那里接收它。

新式 UI 中页面导航中的接收参数

如果使用 IoC 容器,则可以获取对 ViewModel for SomePage.xaml 的引用,并在导航之前在此处设置参数。