public static TextPanelViewModel Create(string caption, Point location, RibbonMergingViewModel parentViewModel) { TextPanelViewModel instance = ViewModelSource.Create(() => new TextPanelViewModel()); instance.ParentViewModel = parentViewModel; instance.Caption = caption; instance.Location = location; return(instance); }
public RibbonMergingViewModel() { Panels = new ObservableCollection <PanelViewModel>(); Panels.Add(TextPanelViewModel.Create("Simple Pad", new Point(0.0, 0.0), this)); Panels.Add(PaintPanelViewModel.Create("Simple Paint", new Point(300.0, 50.0), this)); }
public void CreateNewTextPanel() { Panels.Add(TextPanelViewModel.Create("Simple Pad", new Point(50, 50), this)); Panels[Panels.Count - 1].IsActive = true; }