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------------------------------------------- ...
随机推荐
- 了解angularjs中的生命周期钩子函数$onInit,$onChange,$onDestory,$postLink
壹 ❀ 引 我在前面花了三篇文章用于介绍angularjs的指令directive,组件component,并专门花了一篇文章介绍directive与component的不同,其中提到在compon ...
- javascript中的定时器入门
JavaScript提供定时器(timer)的功能,可以延期执行或重复执行函数或代码段. window对象提供了三个方法来实现定时器的效果,分别是setTimeout().setInternal()和 ...
- SpringBoot打包为war包,并在tomcat中运行
先看一下我创建的最简单的项目吧. controller类 @RestController public class TestController { @RequestMapping("ind ...
- Java入门系列之StringBuilder、StringBuffer(三)
前言 上一节我们讲解了字符串的特性,除了字符串类外,还有两个我们也会经常用到的类,那就是StringBuffer和StringBuilder.因为字符串不可变,所以我们每次对字符串的修改比如通过连接c ...
- 基于Spring Boot+Spring Security+JWT+Vue前后端分离的开源项目
一.前言 最近整合Spring Boot+Spring Security+JWT+Vue 完成了一套前后端分离的基础项目,这里把它开源出来分享给有需要的小伙伴们 功能很简单,单点登录,前后端动态权限配 ...
- Linux gzip: stdin: not in gzip format
在解压tar.gz文件的时候报错 tar -zxvf otp_src_18.3.tar.gz gzip: stdin: not in gzip format tar: Child returned s ...
- PHP实现支付宝登录
1.支付宝路由拼接 public function dev() { $http = 'https://openauth.alipaydev.com/oauth2/publicAppAuthorize. ...
- Linux-用户/分组相关以及处理密码遗忘
一.用户创建 1.简单创建 useradd 用户名 2.指定目录创建用户 useradd -d 目录路径 用户名 //注意这一类的目录路径必须写当前所在文件夹的相对路径而不能直接写目录名称 3.指定用 ...
- JAVA微信企业付款到零钱(十分钟搞定),附完整DEMO下载
最近帮朋友做了一个简单的微分销系统,实现从企业付款到零钱分润的功能,简单记录一下微信企业付款到零钱的开发过程, 主要就是按规则封装好请求参数调用微信接口,涉及一些签名校验: A.接口流程 1. 获取用 ...
- Matlab实现直方图均衡化
G=imread('aini555.jpg'); I=rgb2gray(G); J=histeq(I); %直方图均衡化,这一个函数就可以做到均衡化的效果 figure, subplot(),imsh ...