Ejemplo n.º 1
0
        public static IObservable <PaletteEditorTreeViewItem <T> > OnItemRemovedAsObservable <T>(this PaletteEditorTreeView <T> self)
        {
            return(new AnonymousObservable <PaletteEditorTreeViewItem <T> >(observer =>
            {
                void OnNext(TreeViewItem item)
                {
                    try
                    {
                        observer.OnNext((PaletteEditorTreeViewItem <T>)item);
                    }
                    catch (Exception e)
                    {
                        observer.OnError(e);
                    }
                }

                self.OnItemRemoved += OnNext;
                return new Disposable(() => self.OnItemRemoved -= OnNext);
            }));
        }
Ejemplo n.º 2
0
 public void Setup()
 {
     TreeView     = CreateTreeView(_state);
     _searchField = new TreeViewSearchField(TreeView, 0);
     AddContextMenuToTreeView(TreeView);
 }