Skip to content

[Preview4] Window.Current is null  #4177

@sonnemaf

Description

@sonnemaf

Describe the bug
The Window.Current is 'null in a Desktop project. I use it to retrieve whether the Ctrl and Shift keys are Down. Using CoreWindow.GetKeyState(). I hope there is an workaround for retrieving the KeyState.

Steps to reproduce the bug

Steps to reproduce the behavior:

  1. Build a Preview 4 WinUI app.
  2. Inspect the Microsoft.UI.Xaml.Window.Current property.

Expected behavior
It should not be null

Screenshots
image

Version Info

NuGet package version:
[Microsoft.WinUI 3.0.0-preview4.210210.4]

Windows app type:

UWP Win32
No Yes
Windows 10 version Saw the problem?
Insider Build (xxxxx)
October 2020 Update (19042) Yes
May 2020 Update (19041)
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Xbox
Surface Hub
IoT

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions