New Xamarin.Mac Documentation Available

KMullinsKMullins USXamarin Team Xamurai

We have just released the following new Xamarin.Mac documents:

  • Working with Copy and Paste - This article covers working with the Pasteboard to provide Copy and Paste in a Xamarin.Mac application. It shows how to work with standard data types that can be shared between multiple apps and how to support custom data within a give app.
  • Sandboxing a Xamarin.Mac App - This article covers sandboxing a Xamarin.Mac application for release on the App Store. It covers all of the elements that go into sandboxing: container directories, entitlements, user-determined permissions, privilege separation, and kernel enforcement.
  • Working with Databases - This article covers using Key-Value Coding and Key-Value Observing to allow for Data Binding with direct access to SQLite databases to UI elements in Xcode's Interface Builder. It also covers using the SQLite.NET ORM to provide access to SQLite data.
  • .XIBless User Interface Design - This article covers creating a Xamarin.Mac application's User Interface directly from C# code without using Xcode's Interface Builder or .xib files.
  • Standard Controls - Working with the standard AppKit controls such as Buttons, Labels, Text Fields, Check Boxes and Segmented Controls in a Xamarin.Mac application. This guide covers adding them to a User Interface Design in Xcode's Interface Builder, exposing them to code through Outlets and Actions and working with AppKit Controls in C# Code.
  • Collection Views - This article covers working with Collection Views in a Xamarin.Mac application. It covers creating and maintaining Collection Views in Xcode and Interface builder, how to expose the Collection View elements to code using Outlets and Actions, populating Collection Views and finally responding to Collection Views in C# code.
  • Data Binding and Key-Value Coding - This article covers using Key-Value Coding and Key-Value Observing to allow for Data Binding to UI Elements in Xcode's Interface Builder.

If there are any questions or comments, please let me know.

Thanks,

Kevin

Posts

  • MichaelBothMichaelBoth AUMember ✭✭✭

    Kudos, that is quite a significant expansion on the documentation, and this will really help both new and not-so-new Xamarin Mac programmers to move forward.

    Based on my own trial-by-fire with Data Binding and Key-Value Coding, the documentation is quite complete, except with not mentioning the "keyPathsForValuesAffecting" protocol, for when you wish a data value within a view to update when other related fields are updated. I think it's worthwhile adding even a simple example to the documentation to save others the time it took me to dig around through scraps of already available information.

    So for example I have in my code this snippet that updates an 'Amount' bound value whenever the Rate or Quantity are

    [Export("Amount")] public NSNumber Amount { get { return new NSNumber ((double)StronglyTypedViewModel.Amount); } set { WillChangeValue ("Amount"); StronglyTypedViewModel.Amount = value.ToDecimal (); DidChangeValue ("Amount"); } } [Export("keyPathsForValuesAffectingAmount")] public static NSSet keyPathsForValuesAffectingAmount() { return new NSSet ("Rate", "Quantity"); }

    Within my StronglyTypedViewModel I have an 'UpdateAmount' function that sets Amount = Rate * Quantity, so the "keyPathsForValuesAffectingAmount" member is needed to update "Amount" on screen whenever one of Rate or Quantity changes.

  • GraGra33GraGra33 USMember

    Congrats to the team on the update. This will be a great resource for all.

    Another thing missing is the predicate filter - this is the nearest thing to match WPFs CollectionViewSource. This can be a little tricky to work with and there are a couple of gotchas. Hope to see it in the next documentation update.

  • KMullinsKMullins USXamarin Team Xamurai

    Hi @MichaelBoth and @GraGra33,

    Thanks for the feedback! I'll incorporate changes into the docs when I get the chance.

    Please let me know if you find anything else.

    Thanks,

    Kevin

Sign In or Register to comment.