Mono C # - Converting WinForms Interface to Cocoa? (or whatever OS X's default interface is)

I have a C # application that I managed to work with Mono and work on OS X. The application itself works fine, but in fact it does not work very well when working on OS X. Button fonts look jagged, and many of the functions by default, which exist for the version of Windows 7, are missing. For me, it looks like a Win98 application with the top border of OS X attached to it.

I am learning, perhaps, learning Objective-C so that I can write the "right" OS X applications, but for now I would like my projects to work on Apple without forcing them to look at each other.

Can I convert a WinForms application to Cocoa? Is Cocoa the right interface to use?

If possible, what is the best way to do this, and do you know anyone from a good tutorial / process entry to get me started? It would be nice to see something that actually shows the process. I learn a lot more from the sample code and a short explanation than from the general article.

Thanks again!

+4
source share
2 answers

If you want to create your own OSX application, then you are right that you want to use Cocoa. If you still want to use C #, you can use MonoMac .

MonoMac allows you to create your own graphical interface natively on OSX (in fact, using the interface builder supplied by Apple), but it allows you to write your application in .Net / C #. Thus, you can continue to use the existing application logic and change the GUI code only.

+7
source

It is pretty universal that a portable application will always look like a portable application. Even large companies with a huge budget cannot do anything better (I quote Adobe - what a mess).

A Mac slap in the port of a Windows application will show its seams. If you want the application to act as its own application (and take advantage of the performance benefits offered by the platform), the absolute best approach is to use the architectural documentation, specifications and requirements that I know you have - a conscientious developer, - adapt the design to your own platform. These are Cocoa Frameworks (APIs), which are written in Objective-C (language).

There is simply no other way that does not end with a crap-like port that is riddled with bugs and behavioral problems generated by porters who are not familiar with the target platform. This is not limited to Mono / C # -to- Cocoa / Obj-C. The opposite is also true. These problems are even related to the Java-for-PlatformA-to-Java-for-PlatformB ports for desktop applications. Start with a solid architecture and build a platform if you want the best user experience.

However, you are one step ahead, aware of this and wanting to do better. Bravo! :-) Although I do not know a single textbook along this path, I would not even suggest the right approach, since you indicated that you are looking for quality. Take advantage of many Cocoa books and many other online communities (like this one) and learn the platform before moving on to your Cocoa-adapted architecture and code base.

Comment based discussion update

To be clear: I am not saying that there is no way or that there is no tool that makes this possible. Actually there is a lot that I saw, but I do not remember and did not bother to search. My point remains: the OP is related to the quality of the appearance (and I assume the behavior and, possibly, the performance), and the porting tools / translation levels do not achieve this due to the inherent differences in the platform architecture and user experience idioms. The OP suspects that it is best to study the platform and build it specifically for this, and I agree. Your opinion may vary. Keep this in mind.

+2
source

Source: https://habr.com/ru/post/1339860/