Пример #1
0
        void PrepareForSegue(DetailViewController detailViewController)
        {
            NSIndexPath selectedIndexPath = CollectionView.GetIndexPathsForSelectedItems()[0];

            detailViewController.ImageIdentifier = DataSource.GetIdentifier(selectedIndexPath);
            detailViewController.DataSource      = DataSource;
        }
Пример #2
0
    public override void FinishedLaunching(UIApplication app)
    {
        detailViewController = new DetailViewController ("DetailViewController", null);
        detailViewController.LoadView();

        window.AddSubview(navController.View);
        window.MakeKeyAndVisible();
    }
Пример #3
0
    public override void FinishedLaunching(UIApplication app)
    {
        detailViewController = new DetailViewController("DetailViewController", null);
        detailViewController.LoadView();

        window.AddSubview(navController.View);
        window.MakeKeyAndVisible();
    }
Пример #4
0
        public DetailSource(DetailEntity[] details, int choiceIndexPath, DetailViewController vc)
        {
            Details            = details;
            ChoiceIndexPathRow = choiceIndexPath;

            if (vc != null)
            {
                this.vc = vc;
            }
        }
Пример #5
0
        protected override void OnFrameAssigned()
        {
            base.OnFrameAssigned();
            dvController = Frame.GetController <DetailViewController>();
            if (dvController == null)
            {
                return;
            }

            dvController.SaveAction.Execute += new SimpleActionExecuteEventHandler(SaveAction_Execute);
        }
Пример #6
0
        public void PresentWelcomeScreen()
        {
            if (detailViewController == null)
            {
                var searchBarViewController = new SearchBarViewController(appModel.Search);
                var playerViewController    = new PlayerViewController(appModel.Player);

                detailViewController = new DetailViewController(appModel, searchBarViewController, playerViewController);
                breadcrumbView       = detailViewController.View.BreadcrumbView;
                breadcrumbView.NavigationRequested += NavigateTo;
            }

            PushView("welcomeScreen", "Welcome Screen", new WelcomeView());
        }
        private void SetupViewControllerFromSelection(NSViewController viewController)
        {
            if (DetailViewController.HasChildViewController())
            {
                if (viewController == DetailViewController.ChildViewControllers.First())
                {
                    return;
                }

                DetailViewController.RemoveFirstChildViewController();
                EmbedChildViewController(viewController);
            }
            else
            {
                EmbedChildViewController(viewController);
            }
        }
        private void HandleSelectionChange(NSNotification notification)
        {
            if (!(notification.Object is NSTreeController treeController))
            {
                return;
            }

            if (OutlineViewController is LeadingContentListViewController outlineViewController)
            {
                NSTreeNode[]     selectedNodes = treeController.SelectedNodes;
                NSViewController?viewControllerForSelection = outlineViewController.GetViewControllerForSelectedNodes(selectedNodes);
                if (viewControllerForSelection is null)
                {
                    DetailViewController.RemoveFirstChildViewController();
                    return;
                }

                SetupViewControllerFromSelection(viewControllerForSelection);
            }
        }
        private void EmbedChildViewController(NSViewController viewController)
        {
            DetailViewController.AddChildViewController(viewController);
            NSView firstSubview = DetailViewController.View.Subviews.First();

            firstSubview.AddSubview(viewController.View);
            viewController.View.TranslatesAutoresizingMaskIntoConstraints = false;

            NSLayoutConstraint[] horizontalConstraints = NSLayoutConstraint.FromVisualFormat(
                "H:|[targetView]|",
                NSLayoutFormatOptions.None,
                null,
                NSDictionary.FromObjectAndKey(viewController.View, (NSString)"targetView"));
            NSLayoutConstraint.ActivateConstraints(horizontalConstraints);

            NSLayoutConstraint[] verticalConstraints = NSLayoutConstraint.FromVisualFormat(
                "V:|[targetView]|",
                NSLayoutFormatOptions.None,
                null,
                NSDictionary.FromObjectAndKey(viewController.View, (NSString)"targetView"));
            NSLayoutConstraint.ActivateConstraints(verticalConstraints);
        }
Пример #10
0
        /// <summary>
        /// Ao ativar o controller
        /// </summary>
        protected override void OnActivated()
        {
            DetailController  = Frame.GetController <DetailViewController>();
            currentObjectType = View.ObjectTypeInfo != null ? View.ObjectTypeInfo.Type.Name : string.Empty;

            if (DetailController != null && listObjectTypes.Contains(currentObjectType))
            {
                DetailController.SaveAction.Executing         += SaveAction_Executing;
                DetailController.SaveAndNewAction.Executing   += SaveAction_Executing;
                DetailController.SaveAndCloseAction.Executing += SaveAction_Executing;
            }

            if (Application is DevExpress.ExpressApp.Win.WinApplication)
            {
                if (Application.MainWindow != null)
                {
                    ((DevExpress.ExpressApp.Win.WinWindow)Application.MainWindow).Form.GotFocus += Form_GotFocus;
                }
            }

            Frame.ViewChanged += Frame_ViewChanged;

            base.OnActivated();
        }
 private void ViewController1_Activated(object sender, EventArgs e)
 {
     detailViewController = Frame.GetController <DetailViewController>();
     detailViewController.SaveAndNewAction.Executing += SaveAndNewAction_Executing;
     Frame.ViewChanged += Frame_ViewChanged;
 }
Пример #12
0
        public AddViewController(UIViewController theView, BaseItem ParentTask,long assignedID,int groupID, DateTime duedate)
            : base(null,true)
        {
            this.NavigationItem.LeftBarButtonItem = new UIBarButtonItem("Cancel", UIBarButtonItemStyle.Bordered, delegate{
                this.DeactivateController(true);
            });

            taskElement = new ImageStringElement("Item",Images.boxImg,delegate {
                this.NavigationController.PopViewControllerAnimated(false);
                var task = new BaseItem(assignedID){
                    Kind = TaskKind.Item,
                    ExternalParentID = ParentTask == null ? 0: ParentTask.ExternalID ,
                    ParentID = ParentTask == null ? 0: ParentTask.ID ,
                    GroupID = ParentTask == null ? groupID: ParentTask.GroupID,
                    OwnerID = ParentTask == null ? Settings.Sync.userID : ParentTask.OwnerID,
                    DueDate = duedate
                };
                theView.NavigationController.PushViewController(new DetailViewController(task,true),true);
            });

            calendarElement = new ImageStringElement("Calendar Event",Images.AppleCalendar,delegate {
                this.NavigationController.PopViewControllerAnimated(false);
                addController = new EKEventEditViewController();
                // set the addController's event store to the current event store.
                addController.EventStore = Util.MyEventStore;
                addController.Event = EKEvent.FromStore(Util.MyEventStore);
                if(duedate.Year < 2000)
                    duedate = DateTime.Today;
                addController.Event.StartDate = duedate.AddHours(DateTime.Now.Hour);
                addController.Event.EndDate = duedate.AddHours(DateTime.Now.Hour + 1);

                addController.Completed += delegate(object theSender, EKEventEditEventArgs eva) {
                    switch (eva.Action)
                    {
                        case EKEventEditViewAction.Canceled :
                            theView.NavigationController.DismissModalViewControllerAnimated(true);
                            break;
                        case EKEventEditViewAction.Deleted :
                            theView.NavigationController.DismissModalViewControllerAnimated(true);
                            break;
                        case EKEventEditViewAction.Saved:
                            theView.NavigationController.DismissModalViewControllerAnimated(true);
                            break;
                    }
                };

                theView.NavigationController.PresentModalViewController(addController,true);
            });

            checkListElement = new ImageStringElement("List",Images.checkListImage, delegate{
                this.NavigationController.PopViewControllerAnimated(false);
                var task = new CheckList(assignedID){
                Kind = TaskKind.List,
                    ExternalParentID = ParentTask == null ? 0: ParentTask.ExternalID ,
                    ParentID = ParentTask == null ? 0: ParentTask.ID ,
                    GroupID = ParentTask == null ? 0: ParentTask.GroupID,
                    OwnerID = ParentTask == null ? Settings.Sync.userID : ParentTask.OwnerID,
                    DueDate = duedate
                };

                var taskVC = new DetailViewController(task,true);
                taskVC.TaskListSaved += savedTask => {
                        theView.NavigationController.PushViewController(new TaskViewController(savedTask.Description,true,savedTask),true);
                };

                theView.NavigationController.PushViewController(taskVC,true);
            });

            phoneCallElement = new ImageStringElement("Phone Call",Images.phoneImg, delegate{
                this.NavigationController.PopViewControllerAnimated(false);
                var task = new BaseItem(assignedID){
                    Kind = TaskKind.PhoneCall,
                    ExternalParentID = ParentTask == null ? 0: ParentTask.ExternalID ,
                    ParentID = ParentTask == null ? 0: ParentTask.ID ,
                    GroupID = ParentTask == null ? 0: ParentTask.GroupID,
                    OwnerID = ParentTask == null ? Settings.Sync.userID : ParentTask.OwnerID,
                    DueDate = duedate

                };
                theView.NavigationController.PushViewController(new DetailViewController(task,true),true);

            });

            emailElement = new ImageStringElement("Send an Email",Images.emailImg,delegate{
                this.NavigationController.PopViewControllerAnimated(false);
                var task = new BaseItem(assignedID){
                    Kind = TaskKind.Email,
                    ExternalParentID = ParentTask == null ? 0: ParentTask.ExternalID ,
                    ParentID = ParentTask == null ? 0: ParentTask.ID ,
                    GroupID = ParentTask == null ? 0: ParentTask.GroupID,
                    OwnerID = ParentTask == null ? Settings.Sync.userID : ParentTask.OwnerID,
                    DueDate = duedate

                };
                theView.NavigationController.PushViewController(new DetailViewController(task,true),true);

            });

            websiteElement = new ImageStringElement("Visit a Website",Images.globeImg,delegate{
                this.NavigationController.PopViewControllerAnimated(false);
                var task = new BaseItem(assignedID){
                    Kind = TaskKind.VisitAWebsite,
                    ExternalParentID = ParentTask == null ? 0: ParentTask.ExternalID ,
                    ParentID = ParentTask == null ? 0: ParentTask.ID ,
                    GroupID = ParentTask == null ? 0: ParentTask.GroupID,
                    OwnerID = ParentTask == null ? Settings.Sync.userID : ParentTask.OwnerID,
                    DueDate = duedate

                };
                theView.NavigationController.PushViewController(new DetailViewController(task,true),true);

            });

            Root = new RootElement("Add new item")
            {
                new Section()
                {
                    taskElement,
                    calendarElement,
                    checkListElement,
                },
                new Section()
                {
                    phoneCallElement,
                    emailElement,
                    websiteElement,
                }
            };

            ///
        }
Пример #13
0
        public AddViewController(UIViewController theView, BaseItem ParentTask, long assignedID, int groupID, DateTime duedate) : base(null, true)
        {
            this.NavigationItem.LeftBarButtonItem = new UIBarButtonItem("Cancel", UIBarButtonItemStyle.Bordered, delegate {
                this.DeactivateController(true);
            });

            taskElement = new ImageStringElement("Item", Images.boxImg, delegate {
                this.NavigationController.PopViewControllerAnimated(false);
                var task = new BaseItem(assignedID)
                {
                    Kind             = TaskKind.Item,
                    ExternalParentID = ParentTask == null ? 0: ParentTask.ExternalID,
                    ParentID         = ParentTask == null ? 0: ParentTask.ID,
                    GroupID          = ParentTask == null ? groupID: ParentTask.GroupID,
                    OwnerID          = ParentTask == null ? Settings.Sync.userID : ParentTask.OwnerID,
                    DueDate          = duedate
                };
                theView.NavigationController.PushViewController(new DetailViewController(task, true), true);
            });

            calendarElement = new ImageStringElement("Calendar Event", Images.AppleCalendar, delegate {
                this.NavigationController.PopViewControllerAnimated(false);
                addController = new EKEventEditViewController();
                // set the addController's event store to the current event store.
                addController.EventStore = Util.MyEventStore;
                addController.Event      = EKEvent.FromStore(Util.MyEventStore);
                if (duedate.Year < 2000)
                {
                    duedate = DateTime.Today;
                }
                addController.Event.StartDate = duedate.AddHours(DateTime.Now.Hour);
                addController.Event.EndDate   = duedate.AddHours(DateTime.Now.Hour + 1);

                addController.Completed += delegate(object theSender, EKEventEditEventArgs eva) {
                    switch (eva.Action)
                    {
                    case EKEventEditViewAction.Canceled:
                        theView.NavigationController.DismissModalViewControllerAnimated(true);
                        break;

                    case EKEventEditViewAction.Deleted:
                        theView.NavigationController.DismissModalViewControllerAnimated(true);
                        break;

                    case EKEventEditViewAction.Saved:
                        theView.NavigationController.DismissModalViewControllerAnimated(true);
                        break;
                    }
                };

                theView.NavigationController.PresentModalViewController(addController, true);
            });

            checkListElement = new ImageStringElement("List", Images.checkListImage, delegate {
                this.NavigationController.PopViewControllerAnimated(false);
                var task = new CheckList(assignedID)
                {
                    Kind             = TaskKind.List,
                    ExternalParentID = ParentTask == null ? 0: ParentTask.ExternalID,
                    ParentID         = ParentTask == null ? 0: ParentTask.ID,
                    GroupID          = ParentTask == null ? 0: ParentTask.GroupID,
                    OwnerID          = ParentTask == null ? Settings.Sync.userID : ParentTask.OwnerID,
                    DueDate          = duedate
                };

                var taskVC            = new DetailViewController(task, true);
                taskVC.TaskListSaved += savedTask => {
                    theView.NavigationController.PushViewController(new TaskViewController(savedTask.Description, true, savedTask), true);
                };

                theView.NavigationController.PushViewController(taskVC, true);
            });

            phoneCallElement = new ImageStringElement("Phone Call", Images.phoneImg, delegate {
                this.NavigationController.PopViewControllerAnimated(false);
                var task = new BaseItem(assignedID)
                {
                    Kind             = TaskKind.PhoneCall,
                    ExternalParentID = ParentTask == null ? 0: ParentTask.ExternalID,
                    ParentID         = ParentTask == null ? 0: ParentTask.ID,
                    GroupID          = ParentTask == null ? 0: ParentTask.GroupID,
                    OwnerID          = ParentTask == null ? Settings.Sync.userID : ParentTask.OwnerID,
                    DueDate          = duedate
                };
                theView.NavigationController.PushViewController(new DetailViewController(task, true), true);
            });

            emailElement = new ImageStringElement("Send an Email", Images.emailImg, delegate {
                this.NavigationController.PopViewControllerAnimated(false);
                var task = new BaseItem(assignedID)
                {
                    Kind             = TaskKind.Email,
                    ExternalParentID = ParentTask == null ? 0: ParentTask.ExternalID,
                    ParentID         = ParentTask == null ? 0: ParentTask.ID,
                    GroupID          = ParentTask == null ? 0: ParentTask.GroupID,
                    OwnerID          = ParentTask == null ? Settings.Sync.userID : ParentTask.OwnerID,
                    DueDate          = duedate
                };
                theView.NavigationController.PushViewController(new DetailViewController(task, true), true);
            });

            websiteElement = new ImageStringElement("Visit a Website", Images.globeImg, delegate {
                this.NavigationController.PopViewControllerAnimated(false);
                var task = new BaseItem(assignedID)
                {
                    Kind             = TaskKind.VisitAWebsite,
                    ExternalParentID = ParentTask == null ? 0: ParentTask.ExternalID,
                    ParentID         = ParentTask == null ? 0: ParentTask.ID,
                    GroupID          = ParentTask == null ? 0: ParentTask.GroupID,
                    OwnerID          = ParentTask == null ? Settings.Sync.userID : ParentTask.OwnerID,
                    DueDate          = duedate
                };
                theView.NavigationController.PushViewController(new DetailViewController(task, true), true);
            });



            Root = new RootElement("Add new item")
            {
                new Section()
                {
                    taskElement,
                    calendarElement,
                    checkListElement,
                },
                new Section()
                {
                    phoneCallElement,
                    emailElement,
                    websiteElement,
                }
            };

            ///
        }
 public FeedItemTableSource(List <RssFeedItem> items, DetailViewController controller)
 {
     _items      = items;
     _controller = controller;
 }