public Vector2 Render(ITreeview <TSource> treeview, EventType eventType) { if (treeview == null) { throw new ArgumentNullException("treeview"); } if (treeview.ItemsSource == null) { // Nothing to render return(_scrollPosition); } if (treeview.TreeviewSourceDecoder == null) { // Cannot render as cannot decode. return(_scrollPosition); } if (eventType == EventType.Repaint) { // Only reset before the click locations are due to be refreshed. rowClickableLocations.Reset(); } var localDecoder = treeview.TreeviewSourceDecoder; _scrollPosition = guiLayout.BeginScrollView(_scrollPosition); var root = itemCache.Root(treeview, localDecoder); // render root treeviewRowRenderer.RenderRow(root, localDecoder, eventType); if (root.IsExpanded) { RenderChildren(root, localDecoder, eventType); } guiLayout.EndScrollView(); return(_scrollPosition); }