예제 #1
0
        public void Start(bool animated)
        {
            switch (item.Type)
            {
            case ItemType.File:
                var viewController = MakePresentingViewController(item, loadedItem =>
                {
                    var vc =
                        fileSpecifications.GetFileSpecificationProvider(item)
                        .GetViewControllerForItem(loadedItem.Url, loadedItem.Resource as NSData,
                                                  loadedItem.Attributes);
                    vc.NavigationItem.Title = item.Name;
                    return(vc);
                });
                navigationController?.PushViewController(viewController, animated);
                break;

            case ItemType.Directory:
                throw new InvalidDataException();
            }
        }
예제 #2
0
        public ItemViewModel ItemViewModelFor(NSIndexPath indexPath)
        {
            var item = ItemFor(indexPath);

            return(new ItemViewModel(item, _fileSpecifications.GetFileSpecificationProvider <object>(item)));
        }