private void UpdateMetadata(Task<NameValueCollection> metadataTask)
        {
            if (!metadataTask.IsFaulted)
            {
                var collection = metadataTask.Result.FilterHeadersForViewing();

                var editableCollection =
                    new EditableKeyValueCollection(
                        collection.Select(key => new EditableKeyValue()
                                                     {
                                                         Key = key,
                                                         Value = collection[key],
                                                         IsReadOnly = MetadataExtensions.ReadOnlyHeaders.Contains(key)
                                                     }));

                Metadata = editableCollection;
                AddEmptyItem();
            }
            else
            {
                StatusMessage = "File details could not be loaded. \n\n" +
                                metadataTask.Exception.ExtractSingleInnerException().Message;
            }

            OnPropertyChanged("IsSaveVisible");
        }
        private void Initialise(NameValueCollection settings)
        {
            var editableCollection =
                new EditableKeyValueCollection(
                    settings.SelectMany(
                        key => settings.GetValues(key).Select(
                            value => new EditableKeyValue()
                                         {
                                             Key = key,
                                             Value = value,
                                         })));

            editableCollection.KeyValueChanged += delegate { OnChanged(EventArgs.Empty); };
            editableCollection.CollectionChanged += delegate { OnChanged(EventArgs.Empty); };

            EditableValues = editableCollection;
            AddEmptyItem();
        }