protected override void OnStartup(StartupEventArgs e)
{
Window w = new Window();
w.ShowDialog();
base.OnStartup(e);
}

  当w窗口关闭的时候会结束整个进程。

原因:https://docs.microsoft.com/en-us/dotnet/api/system.windows.application.mainwindow?view=netframework-4.8

The reference to the first Window object to be instantiated is also added as the first item to the Windows collection. If MainWindow is subsequently set with a reference to a different Window, the position of the item with the reference to the main window will change, while the order of items in Windows remains the same. Consequently, always use MainWindow to refer to the main window instead of the first item in Windows.

源码:

解决方案:

Popup a window before the MainWindow的更多相关文章

  1. A Popup Progress Window

    一个包含bar和取消而且不需要资源弹出窗口 1.构造函数 CProgressWnd(); CProgressWnd(CWnd* pParent, LPCTSTR strTitle, BOOL bSmo ...

  2. Pass value from child popup window to parent page window using JavaScript--reference

    Here Mudassar Ahmed Khan has explained how to pass value from child popup window to parent page wind ...

  3. WPF Popup全屏 弹出方法。解决只显示75%的问题。

    WPF Popup全屏 弹出方法.解决只显示75%的问题.   WPF 中 Popup 有一个特点.当Popup的高度超过屏幕的75%的时候,只显示75%的高度. 如下代码: <Window x ...

  4. BOM 浏览器对象模型_window 对象的常见 window.属性_window.方法

    1. 常用属性 window.devicePixelRatio        像素比 = css / 物理像素 window.scrollX,window.scrollY    滚动条 卷曲距离 if ...

  5. popup的简单应用举例(具体在增删改查组件中用到)以及补充的知识点

    一.首先说一下自执行函数 1. 立即执行函数是什么?也就是匿名函数 立即执行函数就是 声明一个匿名函数 马上调用这个匿名函数 2.popup的举例 点击,弹出一个新的窗口.保存完事,页面不刷新数据就返 ...

  6. python 全栈开发,Day117(popup,Model类的继承,crm业务开发)

    昨日内容回顾 第一部分:权限相关 1. 权限基本流程 用户登录成功后获取权限信息,将[权限和菜单]信息写入到session. 以后用户在来访问,在中间件中进行权限校验. 为了提升用户体验友好度,在后台 ...

  7. window.open() & iframe

    window.open() & iframe https://www.w3schools.com/jsref/met_win_open.asp window.open(URL, name, s ...

  8. popup的简单应用举例

    一.首先说一下自执行函数 1. 立即执行函数是什么?也就是匿名函数 立即执行函数就是 声明一个匿名函数 马上调用这个匿名函数 2.popup的举例 点击,弹出一个新的窗口.保存完事,页面不刷新数据就返 ...

  9. WPF popup控件的使用

    <Window x:Class="WPFPopup.RuntimePopup"     xmlns="http://schemas.microsoft.com/wi ...

随机推荐

  1. hdu1536 sg打表

    标记数组用bool型防止超时.输入的f[ ]要排序. #include<stdio.h> #include<string.h> #include<algorithm> ...

  2. Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第九章:贴图

    原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第九章:贴图 代码工程地址: https://github.com/j ...

  3. Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第七章:在Direct3D中绘制(二)

    原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第七章:在Direct3D中绘制(二) 代码工程地址: https:/ ...

  4. python 异常处理技巧

  5. 轻松学习之 IMP指针的作用

    http://www.cocoachina.com/ios/20150717/12623.html 可能大家一直看到有许多朋友在Runtime相关文章中介绍IMP指针的概念,那么IMP究竟有什么实际作 ...

  6. 02docker简单使用和配置(网络、存储和Hub)

    四:网络 1:命名容器 在各种docker命令中,可以通过名字中找到对应的容器.之前创建的容器都是由docker自动命名的,可以在docker  run中,通过--name参数指定容器的名字.比如: ...

  7. android学习——Android Layout标签之-viewStub,requestFocus,merge,include

    定义Android Layout(XML)时,有四个比较特别的标签是非常重要的,其中有三个是与资源复用有关,分别是<viewStub/>, <requestFocus />, ...

  8. visual studio 2013 修改mvc5的视图模板

    C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Web\Mvc\Scaffol ...

  9. hdu 1434 幸福列车 (Leftist Tree)

    Problem - 1434 网上题解是普通的堆合并,都是用优先队列直接做的.可是正解的堆合并应该是用左偏堆或者斐波那契堆的吧,不然O(X * N ^ 2)的复杂度应该是过不了的.斐波那契堆的实现相对 ...

  10. centos6 名字服务dnsmasq配置

    1 主机名配置 主机hd1配置(后面配置为名字服务器) [grid_hd@hd1 Desktop]$ cat /etc/sysconfig/network NETWORKING=yes HOSTNAM ...