private void XafPopupWindowControl_CustomizePopupWindowSize(object sender, CustomizePopupWindowSizeEventArgs e) { var popupWindowControl = ((XafPopupWindowControl)sender); popupWindowControl.CustomizePopupWindowSize -= XafPopupWindowControl_CustomizePopupWindowSize; if (View != null) { var popupControl = ((IModelWebPopupControl)View.Model.GetNode(PopupControlMapName)); var height = popupControl.GetValue <Unit>("Height"); var width = popupControl.GetValue <Unit>("Width"); if (!height.IsEmpty && !width.IsEmpty) { e.Size = new Size((int)height.Value, (int)width.Value); e.Handled = true; } if (popupControl.ShowPopupMode.HasValue) { e.ShowPopupMode = popupControl.ShowPopupMode.Value; } if (popupControl.PopupTemplateType.HasValue) { e.PopupTemplateType = popupControl.PopupTemplateType.Value; } if (!e.Handled && popupControl.ShowPopupMode.HasValue || popupControl.ShowPopupMode.HasValue) { e.Handled = true; } } }
protected void PopupWindowControl_CustomizePopupWindowSize(object sender, CustomizePopupWindowSizeEventArgs e) { if (e.ShowViewSource.SourceView.ObjectTypeInfo.Name == "DemoObject") { PopupInfoDemoObject currentObjectInPopup = e.PopupFrame.View.CurrentObject as PopupInfoDemoObject; DemoObject currentParentObject = View.CurrentObject as DemoObject; if ((currentParentObject != null) && (currentObjectInPopup != null)) { e.Height = new Unit(currentParentObject.Height); e.Width = new Unit(currentParentObject.Width); e.Handled = true; } } }
void PopupWindowControl_CustomizePopupWindowSize(object sender, CustomizePopupWindowSizeEventArgs e) { e.Handled = true; e.Size = new Size(1280, 800); }