void ReleaseDesignerOutlets() { if (AssetNameLabel != null) { AssetNameLabel.Dispose(); AssetNameLabel = null; } if (DownloadProgressView != null) { DownloadProgressView.Dispose(); DownloadProgressView = null; } if (DownloadStateLabel != null) { DownloadStateLabel.Dispose(); DownloadStateLabel = null; } }
private void HandleAssetDownloadProgress(NSNotification notification) { NSObject assetStreamName = null; NSObject progress = null; notification.UserInfo?.TryGetValue(new NSString(Asset.Keys.Name), out assetStreamName); if (assetStreamName == null || assetStreamName?.ToString() != asset.Stream.Name) { return; } notification.UserInfo?.TryGetValue(new NSString(Asset.Keys.PercentDownloaded), out progress); NSNumber number = progress as NSNumber; if (number == null) { throw new Exception("Unable to parse progress value."); } DownloadProgressView.SetProgress(number.FloatValue, true); }