public override void PrepareForSegue (UIStoryboardSegue segue, NSObject sender)
{
if (segue.Identifier == "SelectMetadataObjectTypes") {
Func<AVMetadataObjectType, string> key = v => v.ToString ();
barcodeTypeMap = metadataOutput.AvailableMetadataObjectTypes
.GetFlags ()
.ToDictionary (key);
var allItems = barcodeTypeMap.Keys.ToArray ();
var selectedItems = metadataOutput.MetadataObjectTypes
.GetFlags ()
.Select (key)
.ToList ();
var navigationController = (UINavigationController)segue.DestinationViewController;
var selectionCtrl = (ItemSelectionViewController)navigationController.ViewControllers [0];
selectionCtrl.Title = "Metadata Object Types";
selectionCtrl.Delegate = this;
selectionCtrl.Identifier = metadataObjectTypeItemSelectionIdentifier;
selectionCtrl.AllItems = allItems;
selectionCtrl.SelectedItems = selectedItems;
selectionCtrl.AllowsMultipleSelection = true;
} else if (segue.Identifier == "SelectSessionPreset") {
Func<NSString, string> key = v => v;
presetMap = AvailableSessionPresets ().ToDictionary (key);
var allItems = presetMap.Keys.ToArray ();
var navigationController = (UINavigationController)segue.DestinationViewController;
var selectionCtrl = (ItemSelectionViewController)navigationController.ViewControllers [0];
selectionCtrl.Title = "Session Presets";
selectionCtrl.Delegate = this;
selectionCtrl.Identifier = sessionPresetItemSelectionIdentifier;
selectionCtrl.AllItems = allItems;
selectionCtrl.SelectedItems = new List<string> { key (session.SessionPreset) };
selectionCtrl.AllowsMultipleSelection = false;
}
}