public static ToDoListEditorProductSubWindow Open(ToDoListProductView _productView, ToDoProduct todoProduct = null, string name = "Product Editor") { var window = Open <ToDoListEditorProductSubWindow>(name).Init(_productView, todoProduct); instance = window; window.Show(); return(window); }
protected override void SetUpView() { eventKey = GetHashCode(); todoListNoteView = new ToDoListNoteView(this); todoListView = new ToDoListView(this); todoListCategoryListView = new ToDoListCategoryListView(this); todoListProductView = new ToDoListProductView(this); todoListToolBarView = new ToolBarView { style = "box" }.FontSize(15).Height(40); AddView(todoListToolBarView); // todoListToolBarView // .AddMenu("笔记", () => ChangePage(todoListNoteView.eventKey)) // .AddMenu("清单", () => ChangePage(todoListView.eventKey)) // .AddMenu("隐藏", () => ChangePage(todoListHideView.eventKey)) // .AddMenu("分类管理", () => ChangePage(todoListCategoryListView.eventKey)) // .AddMenu("已完成", () => ChangePage(todoListFinishedView.eventKey)) // .AddMenu("产品", () => ChangePage(todoListProductView.eventKey)); // views.Add(todoListNoteView); // views.Add(todoListView); // views.Add(todoListHideView); // views.Add(todoListCategoryListView); // views.Add(todoListFinishedView); // views.Add(todoListProductView); AddMenu(todoListToolBarView, ("笔记", todoListNoteView), ("清单", todoListView), ("分类管理", todoListCategoryListView), ("产品", todoListProductView) ); todoListToolBarView.ForceClick(1); }
private ToDoListEditorProductSubWindow Init(ToDoListProductView _productView, ToDoProduct todoProduct) { productView = _productView; this.todoProduct = todoProduct; Clear(); var verticalLayout = new VerticalLayout("box").AddTo(this); var productName = this.todoProduct == null ? string.Empty : this.todoProduct.name; var productDescription = this.todoProduct == null ? string.Empty : this.todoProduct.description; new LabelView("名称:").TextMiddleCenter().FontBold().FontSize(20).AddTo(verticalLayout); new TextAreaView(productName, pName => productName = pName).Height(30) .AddTo(verticalLayout); new LabelView("描述:").TextMiddleCenter().FontBold().FontSize(20).AddTo(verticalLayout); new TextAreaView(productDescription, pDesc => productDescription = pDesc) .Height(60).AddTo(verticalLayout); new ButtonView("保存", () => { SaveProduct(productName, productDescription); }, true).Height(20) .AddTo(verticalLayout); return(this); }