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. LeetCode191 Number of 1 Bits. LeetCode231 Power of Two. LeetCode342 Power of Four

    位运算相关 三道题 231. Power of Two Given an integer, write a function to determine if it is a power of two. ...

  2. JAVA高级特性--自动拆箱-装箱,枚举类型

    基本数据类型转换为引用类型对象 一个自动装箱的例子 Integer i=10; 相当于 Integer i=new Integer(10); 一个自动拆箱的例子 Integer m=10; int n ...

  3. 【JZOJ4824】【NOIP2016提高A组集训第1场10.29】配对游戏

    题目描述 流行的跳棋游戏是在一个有m*n个方格的长方形棋盘上玩的.棋盘起初全部被动物或障碍物占满了.在一个方格中,'X'表示一个障碍物,一个'0'-'9'的个位数字表示一个不同种类的动物,相同的个位数 ...

  4. hdu 2844 混合背包【背包dp】

    http://acm.hdu.edu.cn/showproblem.php?pid=2844 题意:有n种纸币面额(a1,a2,...an),每种面额对应有(c1,c2,...cn)张.问这些钱能拼成 ...

  5. hdu1403 后缀数组

    比较简单的应用. #include <stdio.h> #include <string.h> #define maxn 200002 int wa[maxn],wb[maxn ...

  6. @NOIP2018 - D1T2@ 货币系统

    目录 @题目描述@ @题解@ @代码@ @题目描述@ 在网友的国度中共有 n 种不同面额的货币,第 i 种货币的面额为 a[i],你可以假设每一种货币都有无穷多张.为了方便,我们把货币种数为 n.面额 ...

  7. js日期拓展方法

    最近项目中使用了大量关于日期的操作遂将其整理如下: /** * 格式化日期 * @param {String} fmt [日期类型 默认为年月日(yyyy-MM-dd)] */ Date.protot ...

  8. python实现以立春为起点n为周期任意日期所在的日期区间

    python实现以立春为起点n为周期任意日期所在的日期区间 需求 话不多说,直接上具体需求. ''' 以每年的立春作为起始点,每N天为一个单元,任给一个日期,返回该日期所在单元的起始和结束日期.例如: ...

  9. @noi.ac - 508@ 01背包

    目录 @description@ @solution@ @accepted code@ @details@ @description@ 有一天你学了一个能解决01背包问题的算法,你决定将这个算法应用到 ...

  10. C# Brush Color String 互相转换

    using System.Windows.Media; //String转换成Color Color color = (Color)ColorConverter.ConvertFromString(s ...