public override void ItemDidCollapse(NSNotification notification)
        {
            NSObjectFacade facade  = notification.UserInfo.Values[0] as NSObjectFacade;
            var            outline = (NSOutlineView)notification.Object;
            nint           row     = outline.RowForItem(facade);

            if (this.isUpdatingExpansions)
            {
                NSView view = outline.GetView(0, row, makeIfNecessary: true);
                if (view.Subviews[0] is NSButton expander)
                {
                    expander.State = NSCellStateValue.Off;
                }

                return;
            }

            if (facade.Target is PanelGroupViewModel group)
            {
                this.dataSource.DataContext.SetIsExpanded(group.Category, isExpanded: false);
            }
            else if (facade.Target is ObjectPropertyViewModel ovm)
            {
                NSView view = outline.GetView(0, row, makeIfNecessary: false);
                SetRowValueBackground(view, valueBackground: false);
            }
        }
Exemple #2
0
        public NSObject GetFacade(object element)
        {
            NSObject facade;

            if (!this.groupFacades.TryGetValue(element, out facade))
            {
                this.groupFacades[element] = facade = new NSObjectFacade(element);
            }
            return(facade);
        }
Exemple #3
0
        public override void ItemDidCollapse(NSNotification notification)
        {
            if (this.isExpanding)
            {
                return;
            }

            NSObjectFacade facade = notification.UserInfo.Values[0] as NSObjectFacade;
            var            group  = facade.Target as IGroupingList <string, EditorViewModel>;

            if (group != null)
            {
                this.dataSource.DataContext.SetIsExpanded(group.Key, isExpanded: false);
            }
        }
Exemple #4
0
        public NSObject GetFacade(object element)
        {
            NSObject facade;

            if (element is IGrouping <string, PropertyViewModel> )
            {
                if (!this.groupFacades.TryGetValue(element, out facade))
                {
                    this.groupFacades[element] = facade = new NSObjectFacade(element);
                }
            }
            else
            {
                facade = new NSObjectFacade(element);
            }

            return(facade);
        }
        private void EnsureOpenOrClose(NSOutlineView outline, NSObjectFacade item, bool open)
        {
            if (open)
            {
                outline.ExpandItem(item);
            }
            else
            {
                outline.CollapseItem(item);
            }

            NSView view = GetViewForItem(outline, item, makeIfNeccessary: true);

            if (view.Subviews[0] is NSButton expander)
            {
                expander.State = (open) ? NSCellStateValue.On : NSCellStateValue.Off;
            }
        }
        public NSObjectFacade GetFacade(object element)
        {
            NSObjectFacade facade;

            if (element is PanelGroupViewModel)
            {
                if (!this.groupFacades.TryGetValue(element, out facade))
                {
                    this.groupFacades[element] = facade = new NSObjectFacade(element);
                }
            }
            else
            {
                facade = new NSObjectFacade(element);
            }

            return(facade);
        }
        private NSView GetViewForItem(NSOutlineView outline, NSObjectFacade facade, bool makeIfNeccessary = false)
        {
            nint row = outline.RowForItem(facade);

            return(outline.GetView(0, row, makeIfNeccessary));
        }
 public bool TryGetFacade(object element, out NSObjectFacade facade)
 {
     return(this.groupFacades.TryGetValue(element, out facade));
 }
        private NSView GetViewForItem(NSOutlineView outline, NSObjectFacade facade)
        {
            nint row = outline.RowForItem(facade);

            return(outline.GetView(0, row, false));
        }