【问题标题】:How pass value in ContentDialog from any page in uwp?如何从 uwp 中的任何页面传递 ContentDialog 中的值?
【发布时间】:2016-05-31 05:29:05
【问题描述】:

我必须需要将值从页面传递到 Contentdialog。请帮帮我

如何从任何页面传递 ContentDialog 中的值

【问题讨论】:

    标签: xaml uwp windows-10-universal uwp-xaml


    【解决方案1】:

    你可以重载构造函数。
    例如,如果您有没有参数的标准构造函数

       public ContentDialog1()
        {
         this.InitializeComponent();
        }
    

    只需添加一个新的:

       public ContentDialog1(string param)
        {
          this.InitializeComponent();
        }
    

    当你调用对话框时你可以传入参数:

         ContentDialog1 cd = new ContentDialog1("some info");
         await cd.ShowAsync();
    

    【讨论】:

      猜你喜欢
      • 2020-12-22
      • 2020-08-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-19
      • 2019-03-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多