wpf dual monitor
<Window x:Class="DualMonitors.Views.WinLeft"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:DualMonitors.Views"
mc:Ignorable="d" WindowState="Maximized" WindowStartupLocation="CenterScreen"
Title="WinLeft" Height="300" Width="300">
<Grid Background="Blue">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Text="Left" FontSize="50" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Button Grid.Row="2" Command="{Binding LeftCmd}" Content="Click Left" FontSize="50"/>
</Grid> </Grid>
</Window>
<Window x:Class="DualMonitors.Views.WinRight"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:DualMonitors.Views"
mc:Ignorable="d" WindowState="Maximized" WindowStartupLocation="CenterScreen"
Title="WinRight">
<Grid Background="Yellow">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Text="Right" FontSize="50" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Button Grid.Row="2" Command="{Binding RightCmd}" Content="Click Right" FontSize="50"/>
</Grid>
</Grid>
</Window>
using DualMonitors.ViewModel;
using System.Windows; namespace DualMonitors.Views
{
/// <summary>
/// Interaction logic for WinRight.xaml
/// </summary>
public partial class WinRight : Window
{
public WinRight()
{
InitializeComponent();
DualVM BDualVM = DualVM.GetDualVM();
this.DataContext = BDualVM;
}
}
}
using Prism.Commands;
using System.Windows; namespace DualMonitors.ViewModel
{
public class DualVM
{
private static DualVM DualVMInstance; public static DualVM GetDualVM()
{
object objLock = new object();
lock(objLock)
{
if(DualVMInstance==null)
{
DualVMInstance = new DualVM();
}
}
return DualVMInstance;
} private DualVM()
{
//MessageBox.Show("Dual Monitor");
} private DelegateCommand leftCmdValue;
public DelegateCommand LeftCmd
{
get
{
if(leftCmdValue==null)
{
leftCmdValue = new DelegateCommand(LeftCmdExecuted);
}
return leftCmdValue;
}
} private void LeftCmdExecuted()
{
MessageBox.Show("Left Monitor");
} private DelegateCommand rightCmdValue;
public DelegateCommand RightCmd
{
get
{
if(rightCmdValue==null)
{
rightCmdValue = new DelegateCommand(RightCmdExecuted);
}
return rightCmdValue;
}
} private void RightCmdExecuted()
{
MessageBox.Show("Right Monitor");
}
}
}
public partial class App : System.Windows.Application
{ protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e); SetupWindows();
} private void SetupWindows()
{
System.Windows.Forms.Screen mainScreen = Screen.AllScreens[]; ;
WinLeft leftWin = new WinLeft()
{
WindowStartupLocation = WindowStartupLocation.Manual,
WindowState = System.Windows.WindowState.Normal,
Left = mainScreen.WorkingArea.Left,
Top = mainScreen.WorkingArea.Top,
Width = mainScreen.WorkingArea.Width,
Height = mainScreen.WorkingArea.Height
}; System.Windows.Forms.Screen secondaryScreen = Screen.AllScreens[];
WinRight rightWin = new WinRight()
{
WindowStartupLocation = WindowStartupLocation.Manual,
WindowState = System.Windows.WindowState.Normal,
Left = secondaryScreen.WorkingArea.Left,
Top = secondaryScreen.WorkingArea.Top,
Width = secondaryScreen.WorkingArea.Width,
Height = secondaryScreen.WorkingArea.Height
}; leftWin.Show();
leftWin.WindowState = WindowState.Maximized;
rightWin.Show();
rightWin.WindowState = WindowState.Maximized;
rightWin.Owner = leftWin;
}
}

wpf dual monitor的更多相关文章
- win7 双屏双任务栏
扩展屏幕下都显示任务栏!!! 第一步:Dual Monitor Taskbar 下载 下载链接:链接: http://pan.baidu.com/s/1pKxYUFL 密码: gu5c 第二步:安装完 ...
- win7系统扩展双屏幕时,如何在两个屏幕下都显示任务栏
扩展屏幕下都显示任务栏!!! win7系统本身无法设置该功能(目前我是不知道) 但可以下载第三方软件来解决该问题. 第一步:Dual Monitor Taskbar 下载软件 下载链接:http:// ...
- Fedora 中多显示器环境下的工作区切换
[Dual monitor workspaces] 默认情况下,fedora中 Gnome 桌面环境在切换工作去的时候,只会在 Primary display 上切换, 其他显示器保持不变.如果要实现 ...
- win7系统扩展双屏幕时,怎样在两个屏幕下都显示任务栏
扩展屏幕下都显示任务栏!!! win7系统本身无法设置该功能(眼下我是不知道) 但能够下载第三方软件来解决该问题. 第一步:Dual Monitor Taskbar 下载软件 下载链接:http:// ...
- win7系统扩展双屏幕时,开启两个屏幕下都显示任务栏,第三方插件
Dual Monitor Taskbar 下载软件 下载地址 https://dual-monitor-taskbar.en.softonic.com/ 安装即可
- WPF MVVM UI分离之《交互与数据分离》 基础才是重中之重~delegate里的Invoke和BeginInvoke 将不确定变为确定系列~目录(“机器最能证明一切”) 爱上MVC3系列~全局异常处理与异常日志 基础才是重中之重~lock和monitor的区别 将不确定变成确定~我想监视我的对象,如果是某个值,就叫另一些方法自动运行 将不确定变成确定~LINQ DBML模型可以对
WPF MVVM UI分离之<交互与数据分离> 在我们使用WPF过程中,不可避免并且超级喜欢使用MVVM框架. 那么,使用MVVM的出发点是视觉与业务逻辑分离,即UI与数据分离 诸如下 ...
- 【基于WPF+OneNote+Oracle的中文图片识别系统阶段总结】之篇三:批量处理后的txt文件入库处理
篇一:WPF常用知识以及本项目设计总结:http://www.cnblogs.com/baiboy/p/wpf.html 篇二:基于OneNote难点突破和批量识别:http://www.cnblog ...
- 11g新特性:Health Monitor Checks
一.什么是Health Monitor ChecksHealth Monitor Checks能够发现文件损坏,物理.逻辑块损坏,undo.redo损坏,数据字典损坏等等.Health Monitor ...
- sql monitor生成不了报告& FFS hint不生效两个问题思考
事情的发生就是这么偶然,一步步的深入才能汲取到更深入的知识~~ -------------------START------------------------------------------- ...
随机推荐
- ReactNative: 使用导航栏组件-NavigatorIOS组件和Navigator组件
一.简言 在软件开发中,不论是Web还是App,它们的应用程序都是由很多的功能视图组成的.对于这些组合的视图,如何实现页面间平滑地过渡,应用都有统一的一套跳转机制,这个功能就是路由或者叫导航.应用程序 ...
- React: React组件的生命周期
一.简介 在前面的第二篇博文中对组件的生命周期虽然做了一个大略介绍,但总感觉说的过于简单,毕竟生命周期是React组件的核心部分.在我们熟练使用React挂载和合成组件来创建应用表现层的过程中,针对数 ...
- 架构组件:基于Shard-Jdbc分库分表,数据库扩容方案
本文源码:GitHub·点这里 || GitEE·点这里 一.数据库扩容 1.业务场景 互联网项目中有很多"数据量大,业务复杂度高,需要分库分表"的业务场景. 这样分层的架构 (1 ...
- SSH框架之Spring第一篇
1.1. spring概述: 1.1.1 spring介绍 : Spring是分层的Java SE/EE应用 full-stack轻量级开源框架,以IoC(Inverse Of Control : 反 ...
- 每秒100W请求,12306秒杀业务,架构如何优化?
如<同样是高并发,QQ/微博/12306的架构难度一样吗?>一文所述,同样是高并发场景,三类业务的架构挑战不一样: QQ类业务,用户主要读写自己的数据,访问基本带有uid属性,数据访问锁冲 ...
- Scrapy安装和简单使用
模块安装 Windows 安装scrapy 需要安装依赖环境twisted,twisted又需要安装C++的依赖环境 pip install scrapy 时 如果出现twisted错误 在http ...
- Win2003下IIS以FastCGI模式运行PHP
由于PHP5.3 的改进,原有的IIS 通过isapi 方式解析PHP脚本已经不被支持,PHP从5.3.0 以后的版本开始使用微软的 fastcgi 模式,这是一个更先进的方式,运行速度更快,更稳定. ...
- 关于OpenCASCADE数组序列的起始值
C/C++的数组是从0开始计算的,5个值的数组则下标会对应 0, 1, 2, 3, 4. 在数学上可能不这么数,我所知道的 Mathematica 内的 List 是从 1 开始作为下标的. Open ...
- The Preliminary Contest for ICPC Asia Nanjing 2019
传送门 A. The beautiful values of the palace 题意: 给出一个\(n*n\)的矩阵,并满足\(n\)为奇数,矩阵中的数从右上角开始往下,类似于蛇形填数那样来填充. ...
- 使用STS4新建springboot项目
1.配置maven,自定义setting文件和仓库,一定要用阿里云镜像地址下载依赖,官方太坑了,整了半天都没弄好,原来是下载太慢文件损坏 <mirror> <id>alimav ...
