Questions tagged [xamarin.mac]

Xamarin.Mac is an open source library for building Cocoa applications on OSX using C# and .NET. It is based on top of the Mono framework.

Xamarin.Mac: an open source library for building Cocoa applications on OSX using C# and .NET.

You can dig into the source code and read the documentation.

584 questions
3
votes
2 answers

Prevent editing of NSTextField by double right-click

I am using MonoMac/C# and have an NSOutlineView where some of the items are editable. So if you select an item and then click it again (slow double click) the NSTextField of the row enter edit mode. My problem is that this happens even if you…
Christoffer Reijer
  • 1,925
  • 2
  • 21
  • 40
3
votes
1 answer

Creating a windowless menu-bar icon application in Monomac/Xamarin C#

I am attempting to create an application in MonoMac/Xamarin.Mac that does not have a dock icon, nor a visible window when it launches and only an icon in the top-right menu bar. I have set LSUIElement = 1 (tried both String and Boolean types) in…
BB1
  • 304
  • 2
  • 8
3
votes
2 answers

Is it possible to bundle the Mono runtime on OS X (without using Xamarin)?

I want to bundle the Mono runtime with my OS X application, so that the users won't need to install an additional framework just to run my application. When attempting to use MonoDevelop's automatic packaging feature, and checking "Include the Mono…
Erlend D.
  • 3,013
  • 6
  • 37
  • 59
3
votes
1 answer

Xamarin.Mac - Issue submitting to Mac App Store

We are in the process of submitting our app for the Mac App Store. I get the following email from Apple when submitting to the store: Dear developer, We have discovered one or more issues with your recent delivery for "YourApp". To process your…
jonathanpeppers
  • 26,115
  • 21
  • 99
  • 182
2
votes
0 answers

Can't get callback notifications from IOKit to fire using pInvoke

I'm trying to write a .net multiplatform library, and macos is giving me some trouble. I'm attempting to use IOKit to let me know when a serial port has been plugged or unplugged, and from there, I can use the standard .net serial port libraries to…
sonic1015
  • 31
  • 4
2
votes
0 answers

How to get list of printers on mac using .NET MAUI

I am working on a desktop only .NET MAUI application that targets both Mac and Windows. I need to create Printing Service to communicate with the installed printers on the machine. On Windows i was able to achieve that using System.Drawing.Printing…
2
votes
0 answers

Xamarin.Mac NSSavePanel() does not show up and returns "-2" when passing the file access security policy in sandbox in Xcode 14.2

This problem did not happen before macOS Ventura(Xcode 14.2), but I think the process of handling the security policy to Sandbox file access has changed significantly since this current version. I have not changed any code, but when I run…
2
votes
1 answer

"Not a valid framework" (MM0140) error when trying to build Xamarin native bindings library for framework targeting net6-macos

I have working native bindings library targeting old xamarin.mac (xamarin.full net framework 4.8) built with mono. It is binding ScritptingBridge.framework, not a static library. It is builds and works as expected. Note: full project for experiments…
Serg
  • 3,454
  • 2
  • 13
  • 17
2
votes
1 answer

How to create a console app that references Xamarin.Mac.dll in .NET 6

This guide explains how to create a console app that uses Xamarin.Mac APIs. The trick is to reference Xamarin.Mac.dll and link libxammac.dylib in your project. But it is limited to the Mono runtime (pre-.NET-Core). With .NET 6, there are now…
David Lechner
  • 1,433
  • 17
  • 29
2
votes
0 answers

Setting Accent Color on Xamarin.Mac Big Sur

In macOS Big Sur you can set an accent color of the app. In XCode you can do that by changing the color in the Assets catalog. After a lot of research this does not appear to be possible in Xamarin. However it seems that there is a possible…
Ivan Ičin
  • 9,672
  • 5
  • 36
  • 57
2
votes
0 answers

How do I get Upload and Download usage on my Cocoa app (Xamarin.Mac) at a certain time

I got two properties from IPv4InterfaceStatistics class, which are BytesReceived and BytesSent for getting the number of bytes that were received and sent from an interface respectively. I'm getting all of the available network interfaces using…
Mr.Tin Tin
  • 43
  • 1
  • 7
2
votes
1 answer

NSPasteboard in Xamarin.Mac

I am trying to get string from NSPasteboard in Xamarin.Mac, here is my code NSPasteboard pasteboard = NSPasteboard.GeneralPasteboard; string text = ""; Then what method of pasteboard do I use to store the string into text?
王子轩
  • 41
  • 1
  • 2
2
votes
0 answers

In NSColorPanel, when I dragging the selected color into Color Favourites List, the application crash

This problem only occurs when NSColorPanelSwatches.plist doesn’t exist and OS Version is MacOS BigCur. When I use Swift to Create the same View and do the same action, the question will not occurs. Is this a problem with the Appkit in…
2
votes
1 answer

Detect Wifi SSID in Xamarin MAC application

I have a xamarin.MAC application built using Xamarin.MAC. Now I need to find a way to get the connected Wifi SSID in MAC application. I see lot of solution for xamarin.ios.But couldn't see the solution for MAC Application. Do any one know how can I…
Roshil K
  • 2,583
  • 28
  • 38
2
votes
1 answer

Why is my MacOS App Napping despite me instructing it not to

Although this is happening within a Xamarin.Mac project, I think the issue is more to do with MacOS, as the signs are that of App Nap. In my AppDelegate.cs file, I have this: public override void DidFinishLaunching(NSNotification notification) { …
Ash
  • 2,021
  • 2
  • 26
  • 59