Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A macOS Menu Bar app built with Xamarin and C#

License

NotificationsYou must be signed in to change notification settings

AnaghSharma/Ambar-Xamarin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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#.

Update

Using Ambar as the base, I was able to buildCarol - a minimal and beautiful lyrics app for macOS. Check it out.

Why

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.

Tools Required

  1. Visual Studio for Mac
  2. Xcode

Steps

Here is how you can do it -

  1. In Xcode, delete Window Controller Scene fromMain.storyboard and provide Storyboard ID to View Controller.
  2. Add new entry in info.plist -Application is agent (UIElement) with its value set toYes to make the app behave as a ghost.
  3. Create a Menu Bar status item usingCreateStatusItem() method ofNSStatusBar.
  4. Handle status bar icon for dark and light theme usingTemplate property ofNSImage.
  5. Handle event handling of status item usingSelector class ofObjCRuntime.
  6. Show a popover usingNSPopover and itsShow() method.
  7. Make popover show on demand and hide when user moves on usingNSEvent and a custom class.
  8. In Xcode, add a button to View Controller and create an actionQuitApplication bycontrol + drag. In VS, callTerminate method ofNSApplication.

Unless stated otherwise, everything is done in Visual Studio for Mac.

To-do

  • Add a Contextual Menu to show options.
  • Add aLaunch at Login setting.
  • Add aAbout window.

Contribute

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 meknow.

About

A macOS Menu Bar app built with Xamarin and C#

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp