/// <summary> /// 获取默认页面,一般是获取页面失败的时候用 /// </summary> /// <returns></returns> public Task <xinlongyuForm> GetDefaultPage() { Grid grid = new Grid(); TextBlock txt = new TextBlock() { Text = "获取页面失败!" }; txt.HorizontalAlignment = HorizontalAlignment.Center; txt.VerticalAlignment = VerticalAlignment.Center; txt.FontSize = 30; txt.FontWeight = FontWeights.Bold; grid.Children.Add(txt); xinlongyuForm page = new xinlongyuForm(2073); page.Content = grid; return(Task.Run(() => page)); }
/// <summary> /// 解析控件为界面控件 /// </summary> /// <param name="obj"></param> /// <returns></returns> public xinlongyuForm ProduceControl(ControlDetailForPage pageobj, List <IControl> listControl, List <ControlDetailForPage> listControlObj, bool isNavigationWindow) { xinlongyuParentControl _currentForm = new xinlongyuParentControl(); AddTitleBar(_currentForm, pageobj, isNavigationWindow); if (_fatherControlList.Contains(pageobj.ctrl_type)) { this.ProduceFatherControl(pageobj, listControlObj, listControl, _currentForm, true); } else { return(null); } _currentForm.HorizontalAlignment = HorizontalAlignment.Stretch; _currentForm.VerticalAlignment = VerticalAlignment.Stretch; //_currentForm.Margin = new Thickness(10); //实现窗体的滚动条 //ScrollViewer scrollView = new ScrollViewer(); ////scrollView.HorizontalAlignment = HorizontalAlignment.Stretch; ////scrollView.VerticalAlignment = VerticalAlignment.Stretch; //scrollView.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto; //scrollView.Content = _currentForm; xinlongyuForm page = new xinlongyuForm(pageobj.page_id); page.Content = _currentForm; page.Width = pageobj.d1; page.Height = pageobj.d2; //返回page return(page); }