Skip to content

[RNW] GetForCurrentView API alternatives for islands #114

@asklar

Description

@asklar

React Native for Windows doesn't currently officially support islands today (on system xaml nor winui3) but I’m doing work to bring up islands support.

We have usages of a few WinRT types via GetForCurrentView which won't work in island scenarios, this tracks pursuing alternatives in Reunion that allow us to have a unified calling pattern for both win32 and UWP.

Members of DisplayInformation we use (after doing a GetForCurrentView):

  • DpiChanged
  • ResolutionScale
  • LogicalDpi
  • ScreenWidthInRawPixels, ScreenHeightInRawPixels
    These last 2 are used to expose them to the JS side of apps and libraries.

There are a couple of other places where we do things like GetForCurrentView that we’ll need to figure out how to achieve with islands:

  • CoreInputView -> GetCoreInputViewOcclusions -> OcclusionsChanged
    We do that to know when the on screen keyboard shows/hides and raise JS events to that effect so that the UI can re-layout.
  • SystemNavigationManager -> BackRequested and AppViewBackButtonVisibility
    This might be ok to not hook up in island scenarios if we never have a device with back buttons that can also run Win32 apps
  • ApplicationModel.Resources.Core.ResourceContext.GetForCurrentView() -> QualifierValues -> Lookup(“LayoutDirection”)
    This is used to determine whether we should display in RTL or LTR. I’m assuming the alternative is to do GetLayout(hwnd) == LAYOUT_RTL instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-GraphicsTopics related to DisplayInformation, CameraCaptureUI APIsarea-WindowingTopics related to the Windowing API in Windows App SDK, including AppWindow, presenters, etc.feature proposal

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions