WPF Application for sharing part of the screen with Teams works nice but menus are shown as empty boxes

Viewed 101

I've written a small application in WPF that shows 2 windows. One, which is basically a transparent window with no borders, for sharing a part of my screenin MS Teams and one with some resizing options.

I have a very big screen on my PC and when I share my desktop I see all participants starting to move closer to their screen because the image is sized down to their screen and makes it very hard to read.

I've seen several application solving this problem but most of them are a bit cumbersome. I'm a developer so I though: "I can do that too".

Now when I share my partial window everything works fine but.... when I f.i. right click somewhere to call the context menu, I see the menu perfectly but on the shared screens a box with no content appears.

This is probably a tough one but who can tell me what to do. Here's the mainpage.xaml:

<Window x:Class="PartialShare.MainWindow"
        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"
        Title="Partial Share (share this one)"
        x:Name="PartialShare"
        d:AllowsTransparency="true"
        mc:Ignorable="d"
        BorderThickness="1"
        BorderBrush="Blue"
        MaxHeight="{x:Static SystemParameters.MaximizedPrimaryScreenHeight}"
        Height="1000"
        Width="1000"
        ResizeMode="CanResizeWithGrip"
        Opacity="1"
        Topmost="true"
        AllowsTransparency="True"
        WindowStyle="None">
    <WindowChrome.WindowChrome>
        <WindowChrome
            CaptionHeight="30"  
            CornerRadius ="10"
            ResizeBorderThickness="20"         
            GlassFrameThickness="0">
        </WindowChrome>
    </WindowChrome.WindowChrome>

    <Window.Background>
        <SolidColorBrush Opacity="0.0" Color="Transparent" />
    </Window.Background>
</Window>

This is what I see:

enter image description here

And this is what they see in MS Teams:

enter image description here

The project is open source on GitHub. You can download it here: https://github.com/PaulSinnema/PartialShare

0 Answers
Related