示例#1
0
        public static IObservable <ThemeEditorTreeViewItem> OnItemAddedAsObservable(this ThemeEditorTreeView self)
        {
            return(new AnonymousObservable <ThemeEditorTreeViewItem>(observer =>
            {
                void OnNext(TreeViewItem item)
                {
                    try
                    {
                        observer.OnNext((ThemeEditorTreeViewItem)item);
                    }
                    catch (Exception e)
                    {
                        observer.OnError(e);
                    }
                }

                self.OnItemAdded += OnNext;
                return new Disposable(() => self.OnItemAdded -= OnNext);
            }));
        }
示例#2
0
 public void Setup()
 {
     TreeView     = new ThemeEditorTreeView(_state);
     _searchField = new TreeViewSearchField(TreeView, 0);
     AddContextMenuToTreeView(TreeView);
 }