private ViewDialog CreateWindow(FrameworkElement view) { if (view == null) { throw new ArgumentNullException("view"); } view.RemoveFromParent(); var screenSize = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea; var dialog = new ViewDialog() { InnerContent = view, MinWidth = 400, MinHeight = 200, Width = screenSize.Width * 0.7, Height = screenSize.Height * 0.7, WindowStartupLocation = WindowStartupLocation.CenterScreen }; Zoom.EnableZoom(view); this.OnWindowCreated(dialog); return(dialog); }
/// <summary> /// 根据聚合元数据,生成最终的聚合控件 /// </summary> /// <param name="aggt"> /// 集合中的第一个,是主区域对应的View</param> /// <param name="recurChildren"></param> /// <param name="recurSurrounders"></param> /// <param name="ownerView"></param> /// <param name="type"></param> /// <returns></returns> public ControlResult GenerateControl(AggtBlocks aggt) { var mainView = this._viewFactory.CreateView(aggt.MainBlock); this.CreateCommandsUI(mainView, aggt.MainBlock); var result = this.GenerateCompoundControl(aggt, mainView); Zoom.EnableZoom(result.Control); if (this.GesturesLocation == GesturesLocation.Whole) { this.CreateCommandBindingsOnWhole(result.Control, mainView); } return(result); }