protected override void OnBindingContextChanged()
        {
            base.OnBindingContextChanged();

            var newNode = BindingContext as DemoTreeNode;

            if (newNode == null)
            {
                if (Node != null)
                {
                    Debug.WriteLine("OnBindingContextChanged: Node.PropertyChanged unsubscribe");
                    Node.PropertyChanged -= (sender, e) => AdjustSpacer();
                }

                Spacer.WidthRequest = 0;
                return;
            }

            Node = BindingContext as DemoTreeNode;
            if (Node != null)
            {
                Debug.WriteLine("OnBindingContextChanged: Node.PropertyChanged subscribe");
                Node.PropertyChanged += (sender, e) => AdjustSpacer();
            }
        }
        public DemoTreeViewModel()
        {
            MyTree = new DemoTreeNode {
                Title = "Root", Score = 0.5, IsExpanded = true
            };

            var a = MyTree.Children.Add(new DemoTreeNode {
                Title = "Branch A", Score = 0.75, IsExpanded = true
            });

            return;

            a.Children.Add(new DemoTreeNode {
                Title = "Leaf A1", Score = 0.85, IsExpanded = true
            });
            a.Children.Add(new DemoTreeNode {
                Title = "Leaf A2", Score = 0.65, IsExpanded = true
            });

            var b = MyTree.Children.Add(new DemoTreeNode {
                Title = "Branch B", Score = 0.25, IsExpanded = true
            });

            b.Children.Add(new DemoTreeNode {
                Title = "Leaf B1", Score = 0.35, IsExpanded = true
            });
            b.Children.Add(new DemoTreeNode {
                Title = "Leaf B2", Score = 0.15, IsExpanded = true
            });

            // TODO: start optimizing for performance in supporting larger trees

//            var c = MyTree.ChildNodes.Add(new DemoTreeNode { Title = "Branch C", Score = 0.25, IsExpanded = true });
//            var c1 = c.ChildNodes.Add(new DemoTreeNode { Title = "Leaf C1", Score = 0.35, IsExpanded = true });
//            var c2 = c.ChildNodes.Add(new DemoTreeNode { Title = "Branch C2", Score = 0.15, IsExpanded = true });
//            c2.ChildNodes.Add(new DemoTreeNode { Title = "Leaf C2a", Score = 0.15, IsExpanded = true });
//
//            var d = MyTree.ChildNodes.Add(new DemoTreeNode { Title = "Branch D", Score = 0.25, IsExpanded = true });
//            d.ChildNodes.Add(new DemoTreeNode { Title = "Leaf D1", Score = 0.35, IsExpanded = true });
//            d.ChildNodes.Add(new DemoTreeNode { Title = "Leaf D2", Score = 0.15, IsExpanded = true });
        }