Ejemplo n.º 1
0
        public TestNodesViewModel(TestNodeService testNodeService)
        {
            mTestNodeService = testNodeService;

            bool DefaultPredicate(Node <TestNodeDto, int> node) => node.IsRoot;

            //transform the data to a full nested tree
            //then transform into a fully recursive view model
            mCleanUp = testNodeService.TestNodes.Connect()
                       .TransformToTree(testNode => testNode.ParentId, Observable.Return((Func <Node <TestNodeDto, int>, bool>)DefaultPredicate))
                       .Transform(node => new TestNodeViewModel(node, Move, Remove))
                       .Bind(out mTestNodeViewModels)
                       .DisposeMany()
                       .Subscribe();
        }
Ejemplo n.º 2
0
 public MainWindowViewModel()
 {
     TestNodes = new TestNodesViewModel(TestNodeService.CreateWithRandomContent());
 }