Going from Xamarin.Mac to .NET MAUI mac catalyst, differences between UIKit and AppKit

noobsoftware 251 Reputation points
2022-11-08T13:44:23.627+00:00

I have a bunch of code written in AppKit and Foundation in my Xamarin.Mac applications that i want to transfer over to .NET MAUI but there seems to be a large difference between AppKit and UIKit, firstly i don't really understand why AppKit has been abandoned, it is my understanding that UIKit is from iOS so it seems limited in some aspects. Specifically i would like to modify the appearance of the application's window. But changing the windows opacity (setting opaque to false and changing alpha value) seems to have no effect at all. I am able to change the background color of the window but cannot set things like: NSWindowStyle.FullSizeContentView. Is it possible to change from UIKit fo AppKit. If not is it possible to alter the appearance of the window? Specifically i want to add what was an NSVisualEffectView with blending mode for the background of the window with the items behind it, the counterpart seems to be UIVisualEffectView but it does not have any of the same properties such as view.BlendingMode = NSVisualEffectBlendingMode.BehindWindow;

Any help is greatly appreciated.

Developer technologies | .NET | .NET MAUI
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 36,436 Reputation points Microsoft External Staff
    2022-11-14T03:05:39.53+00:00

    Hi @noobsoftware ,

    Xamarin.Forms ran on the Mac using Xamarin.Mac (Cocoa App) as the mac platform project so since it was a Xamarin.Mac app, it had access to everything a native Mac app had access to.
    .NET MAUI apps can be written for macOS 10.15 or higher, using Mac Catalyst. Catalyst apps are granted access to a part of AppKit in the SDK by Apple, so you could not access the full API with MAUI.

    I read the article, the author used a swift third-party library to access hidden and private API. You could try to Bind iOS Swift libraries.

    As YonglunLiu-MSFT said, some migration tools are not ready yet. And your main purpose is to change the appearance of window and may need Mac Platform API Support, you can join the discussion, or create a feature request at https://github.com/dotnet/maui , thanks for your understanding.

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.