界面1内设定点击事件,生成Path用事件传出
public partial class TemplateWindow : Window

    {
        internal delegate void ConfirmButtonClick(string  Path);
        /// <summary>
        /// 点击确定按钮事件
        /// </summary>
        internal event ConfirmButtonClick OnConfirmButtonClick;  
        
        private void ConfirmButton_Click(object sender, RoutedEventArgs e)

        {
                        string Path = “C://User//Path”;
                        if (null != this.OnConfirmButtonClick)
                        {
                            this.OnConfirmButtonClick(Path);
                        }                          
                        this.Close();
         }

}

界面二通过事件获取界面1的Path

public partial class  User : UserControl
    {
         private void ShowWindow_Click(object sender, RoutedEventArgs e)

        {
                TemplateWindow  window = new TemplateWindow ();              
                window.Show();
                window.OnConfirmButtonClick += (Path) =>
                    {
                       Console.Writeline(Path);
                    };
                             
        } 

}

最新文章

  1. iOS-常用的辅助工具软件
  2. Ext4.0 获取选中行及遍历
  3. Gym 100507A About Grisha N. (水题)
  4. 【错误总结之(一)】error LNK2038: 检測到“_ITERATOR_DEBUG_LEVEL”的不匹配项: 值“0”不匹配值“2”
  5. html5test
  6. iphone与安卓的兼容性问题汇总
  7. 【菜鸟入门】安装配置eclipse 并编写运行第一个Java程序
  8. HDU 4372 Count the Buildings:第一类Stirling数
  9. Atcoder R84 D Small Multiple
  10. 前端 jQuery
  11. session会话管理
  12. eclipse 搭建maven项目
  13. 数据分析之Numpy库入门
  14. css display属性
  15. 有标号的DAG计数
  16. python全栈开发笔记-----------概要
  17. poj_3168 平面扫描
  18. google搜索 site:pku.edu.cn inurl:aspx 即可查找所有动态网页 =====html(静态网页) asp(动态) jsp(动态) php(动态) cgi(网络程序) aspx(动态)
  19. windows下手动安装pyinstaller(python2.7)
  20. Linux --centos7 开机启动设置

热门文章

  1. lower_bound 和 upper_bound 功能和用法
  2. 记一次linux通过jstack定位CPU使用过高问题或排查线上死锁问题
  3. 100天搞定机器学习|Day7 K-NN
  4. sql锁的类型介绍:悲观锁,乐观锁,行锁,表锁,页锁,共享锁,排他锁,意向锁
  5. ZooKeeper入门(一)
  6. HDU 6011:Lotus and Characters(贪心)
  7. MyBatis 基础搭建及架构概述
  8. Drools规则引擎-判断集合(List)是否包含集合
  9. Android调试移动端webview
  10. python之unittest框架实现接口测试实例