如何将 c# WPF 输出分配给电视屏幕,而另一个程序可能在笔记本电脑上 运行

How to assign c# WPF output to TV screen while another program may be running on the laptop

我正在尝试使用 c# wpf 将视频从我的笔记本电脑播放到电视屏幕。
在笔记本电脑上,另一个程序可能是 运行.
如何将 wpf 的屏幕输出定向到电视屏幕
同时让另一个程序在笔记本电脑的屏幕上播放某些内容?

如果电视是您的第二屏幕,您可以尝试在第二屏幕上显示您的 wpf window:

var mainWindow = new MainWindow();
if (Screen.AllScreens.Length > 1)
{
   Screen s = Screen.AllScreens[1];
   Rectangle r = s.WorkingArea;
   mainWindow.Top = r.Top;
   mainWindow.Left = r.Left;
   mainWindow.Show();
}