Skip to content

Cannot derive from sealed type Window #5286

Closed

Description

@vadd98

Current behavior

I'm developing a WinUI 3 project. I have a window in a xaml, which is the main window of the project. On Windows I have no problem, by the way on MacOS I get the error "Cannot derive from sealed type Window".

Expected behavior

Being able to derive from Window.

How to reproduce it (as minimally and precisely as possible)

Create a window xaml and try to build.

Workaround

Nothing.

Environment

Nuget Package:

  • Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia
  • Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia
  • Uno.SourceGenerationTasks
  • Uno.UI.RemoteControl / Uno.WinUI.RemoteControl
  • Other:

Nuget Package Version(s):
3.5

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Skia
    • WPF
    • GTK (Linux)
    • Tizen
  • Windows
  • Build tasks
  • Solution Templates

IDE:

  • Visual Studio 2017 (version: )
  • Visual Studio 2019 (version: )
  • Visual Studio for Mac (version: 8.8.3 )
  • Rider Windows (version: )
  • Rider macOS (version: )
  • Visual Studio Code (version: )

Relevant plugins:

  • Resharper (version: )

Anything else we need to know?

Activity

  1. added
    kind/bug
    triage/untriaged
    on Feb 20, 2021
  2. removed
    triage/untriaged
    on Feb 22, 2021
  3. jeromelaban commented on Feb 22, 2021

    @jeromelaban
    Member

    Thanks for the report.

    At of Uno 3.5, the Window class is not the same as the one found in WinUI 3.0, and cannot be used directly in XAML.

    You can refer to the unoapp-winui sample for an example application that does not rely on Window in XAML.

  4. added
    kind/enhancement
    project/core-tools 🛠️
    and removed
    kind/bug
    on Feb 22, 2021
  5. vadd98 commented on Feb 22, 2021

    @vadd98
    Author

    Thanks for your suggestion.
    By the way, is it possible to know if this feature will be implemented in next versions?
    Actually my app is particular relying on the Window xaml, so I'd like to know if I can just wait for next Uno versions or if I have to rewrite the logic referring to the unoapp-winui sample

  6. jeromelaban commented on Feb 22, 2021

    @jeromelaban
    Member

    We will implement the missing APIs in future release, to align with the WinUI windowing contract.

  7. MartinZikmund commented on Mar 27, 2024

    @MartinZikmund
    Member

    This is done now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/enhancementproject/core-tools 🛠️

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions