A macOS Menu Bar app built with Xamarin and C#
MIT License
Ambar is a macOS Menu Bar app developed with Xamarin and C#. This project aims to show developing a menu bar app for macOS in C#.
Using Ambar as the base, I was able to build Carol - a minimal and beautiful lyrics app for macOS. Check it out.
It is for the folks wanting to start developing for macOS/iOS/tvOS/watchOS but do not want to delve into Swift/Obj-C and are already comfortable with C# and .Net technologies.
Here is how you can do it -
Main.storyboard
and provide Storyboard ID to View Controller.Application is agent (UIElement)
with its value set to Yes
to make the app behave as a ghost.CreateStatusItem()
method of NSStatusBar
.Template
property of NSImage
.Selector
class of ObjCRuntime
.NSPopover
and its Show()
method.NSEvent
and a custom class.QuitApplication
by control + drag
. In VS, call Terminate
method of NSApplication
.Unless stated otherwise, everything is done in Visual Studio for Mac.
If you think this project can be improved to show more of what can be done using Xamarin and C#, you are welcome to contribute. If you build something epic using it, just let me know.