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); })); }
public void Setup() { TreeView = new ThemeEditorTreeView(_state); _searchField = new TreeViewSearchField(TreeView, 0); AddContextMenuToTreeView(TreeView); }