zoukankan      html  css  js  c++  java
  • win8中的参数传递

    列表页面:

    xaml:

    Gridview中的数据源是实体的集合:

     <i:EventToCommand Command="{Binding GridViewItemClick_Command}" Event="ItemClick" ></i:EventToCommand>

    所以每次点击每个项时,其事件参数为实体,可以通过实体来得到主键。

    列表页面的vm:

    GridViewItemClick_Command = new RelayCommand<object>(callback =>
                {
                    ExCommandParameter para = callback as ExCommandParameter;
                    if (null != para)
                    {
                        SFModelBase item = (para.EventArgs as ItemClickEventArgs).ClickedItem as SFModelBase;
                        NavigationUtil.GoToPage(this, ApplicationPages.BOOKINFO_VIEW, item.ContentId);
                    }
                });

    详情页面对应的VM:

    public void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
            {
                if (e.NavigationMode == Windows.UI.Xaml.Navigation.NavigationMode.New)
                {
                    string _mContentId = e.Parameter as string;
                }
               
            }

    通过页面导航事件来传递参数。

  • 相关阅读:
    pe文件结构
    dll
    术语
    创建内存映射文件
    函数的调用约定
    串口
    linux 之 tcpdump
    linux 之程序管理
    perl 之eval
    2020-10-27_组合快捷键
  • 原文地址:https://www.cnblogs.com/lzhp/p/3471915.html
Copyright © 2011-2022 走看看