diff --git a/Demos/Microsoft.Band.Sample/Microsoft.Band.iOS.Sample/MainViewController.cs b/Demos/Microsoft.Band.Sample/Microsoft.Band.iOS.Sample/MainViewController.cs index 3b1b7bd..449fdce 100644 --- a/Demos/Microsoft.Band.Sample/Microsoft.Band.iOS.Sample/MainViewController.cs +++ b/Demos/Microsoft.Band.Sample/Microsoft.Band.iOS.Sample/MainViewController.cs @@ -142,7 +142,7 @@ async partial void SendMessageClick (UIButton sender) // send a message with a dialog try { - await client.NotificationManager.SendMessageTaskAsync (customId, "Hello", "Hello World!", DateTime.Now, true); + await client.NotificationManager.SendMessageTaskAsync (tileId, "Hello", "Hello World!", DateTime.Now, true); Output ("Sent the message!!"); } catch (BandException ex) { Output ("Failed to send the message:"); diff --git a/Microsoft.Band/Microsoft.Band.iOS/ApiDefinition.cs b/Microsoft.Band/Microsoft.Band.iOS/ApiDefinition.cs index 008c67c..a18bac4 100644 --- a/Microsoft.Band/Microsoft.Band.iOS/ApiDefinition.cs +++ b/Microsoft.Band/Microsoft.Band.iOS/ApiDefinition.cs @@ -781,12 +781,14 @@ interface BandTile bool BadgingEnabled { [Bind ("isBadgingEnabled")] get; set; } // @property (readonly, nonatomic) NSMutableArray * pageIcons; + [Internal] [Export ("pageIcons")] - NSMutableArray PageIcons { get; } + NSMutableArray PageIconsInternal { get; } // @property (readonly, nonatomic) NSMutableArray * pageLayouts; + [Internal] [Export ("pageLayouts")] - NSMutableArray PageLayouts { get; } + NSMutableArray PageLayoutsInternal { get; } // +(MSBTile *)tileWithId:(NSUUID *)tileId name:(NSString *)tileName tileIcon:(MSBIcon *)tileIcon smallIcon:(MSBIcon *)smallIcon error:(NSError **)pError; [Static] diff --git a/Microsoft.Band/Microsoft.Band.iOS/Microsoft.Band.iOS.csproj b/Microsoft.Band/Microsoft.Band.iOS/Microsoft.Band.iOS.csproj index 8e38026..0732af4 100644 --- a/Microsoft.Band/Microsoft.Band.iOS/Microsoft.Band.iOS.csproj +++ b/Microsoft.Band/Microsoft.Band.iOS/Microsoft.Band.iOS.csproj @@ -62,6 +62,7 @@ + diff --git a/Microsoft.Band/Microsoft.Band.iOS/Tiles/BandTile.cs b/Microsoft.Band/Microsoft.Band.iOS/Tiles/BandTile.cs new file mode 100644 index 0000000..fdbbed5 --- /dev/null +++ b/Microsoft.Band/Microsoft.Band.iOS/Tiles/BandTile.cs @@ -0,0 +1,49 @@ +using System.Collections.Generic; + +using Microsoft.Band.Pages; + +namespace Microsoft.Band.Tiles +{ + public partial class BandTile + { + private object pageIconsLock = new object(); + private BandCollection pageIcons; + + public IList PageIcons { + get { + // check outside to avoid unnecessary locking + if (pageIcons == null) { + // we lock for thread safety + lock (pageIconsLock) { + // do a check before init + if (pageIcons == null) { + pageIcons = new BandCollection (PageIconsInternal); + } + } + } + + return pageIcons; + } + } + + private object pageLayoutsLock = new object(); + private BandCollection pageLayouts; + + public IList PageLayouts { + get { + // check outside to avoid unnecessary locking + if (pageLayouts == null) { + // we lock for thread safety + lock (pageLayoutsLock) { + // do a check before init + if (pageLayouts == null) { + pageLayouts = new BandCollection (PageLayoutsInternal); + } + } + } + + return pageLayouts; + } + } + } +}