示例#1
0
        public ServiceListWnd()
        {
            InitializeComponent();
            borderMessage.MouseDown += borderMessage_MouseDown;
            FooViewModel root = this.tree.Items[0] as FooViewModel;

            base.CommandBindings.Add(
                new CommandBinding(
                    ApplicationCommands.Undo,
                    (sender, e) => // Execute
            {
                e.Handled      = true;
                root.IsChecked = false;
                this.tree.Focus();
            },
                    (sender, e) => // CanExecute
            {
                e.Handled    = true;
                e.CanExecute = (root.IsChecked != false);
            }));

            base.CommandBindings.Add(
                new CommandBinding(
                    ApplicationCommands.Redo,
                    (sender, e) => // Execute
            {
                e.Handled      = true;
                root.IsChecked = true;
                this.tree.Focus();
            },
                    (sender, e) => // CanExecute
            {
                e.Handled    = false;
                e.CanExecute = true;
            }));
            this.tree.Focus();
        }
示例#2
0
        public static List <FooViewModel> CreateFoos()
        {
            FooViewModel root = new FooViewModel("Lung Cancer")
            {
                IsInitiallySelected = true,
                Children            =
                {
                    new FooViewModel("Screaning")
                    {
                        Children =
                        {
                            new FooViewModel("CT Protocal Development"),
                            new FooViewModel("CAD System")
                            {
                                Children =
                                {
                                    new FooViewModel("X-ray"),
                                    new FooViewModel("CT")
                                    {
                                        Children =
                                        {
                                            new FooViewModel("Low Dose CT"),
                                            new FooViewModel("HRCT")
                                        }
                                    },
                                    new FooViewModel("MR"),
                                    new FooViewModel("PET-CT")
                                }
                            },
                        }
                    },
                    new FooViewModel("Planing")
                    {
                        Children =
                        {
                            new FooViewModel("Diagnosis")
                            {
                                Children =
                                {
                                    new FooViewModel("TBLB")
                                    {
                                        Children =
                                        {
                                            new FooViewModel("ENB"),
                                            new FooViewModel("EBUS-GS"),
                                            new FooViewModel("ENB With EBUS"),
                                        }
                                    },
                                    new FooViewModel("TBNA")
                                    {
                                        Children =
                                        {
                                            new FooViewModel("ENB"),
                                            new FooViewModel("EBUS"),
                                        }
                                    },
                                    new FooViewModel("TTNA")
                                    {
                                        Children =
                                        {
                                            new FooViewModel("ENB"),
                                        }
                                    }
                                }
                            },
                            new FooViewModel("Treatment")
                            {
                                Children =
                                {
                                    new FooViewModel("ENB-RFA"),
                                    new FooViewModel("SBRT"),
                                    new FooViewModel("VATS"),
                                    new FooViewModel("COPD")
                                    {
                                        Children =
                                        {
                                            new FooViewModel("Enploysena"),
                                            new FooViewModel("SAD")
                                        }
                                    },
                                }
                            },
                        }
                    },
                    new FooViewModel("Follow up")
                    {
                        Children =
                        {
                        }
                    },
                }
            };

            root.Initialize();
            return(new List <FooViewModel> {
                root
            });
        }