private void _SizeChanged(object sender, SizeChangedEventArgs e) { double num = (base.ActualWidth - 154.0) - 70.0; foreach (UIElement element in this.List.Children) { if (element is BACAClient.UserControls.Controls.FrontDesk.TypeRetrieve) { BACAClient.UserControls.Controls.FrontDesk.TypeRetrieve retrieve = (BACAClient.UserControls.Controls.FrontDesk.TypeRetrieve)element; retrieve.Width = num + 20.0; } } foreach (UIElement element2 in this.Page1.Children) { if (element2 is BACAClient.UserControls.Controls.Page) { BACAClient.UserControls.Controls.Page page = (BACAClient.UserControls.Controls.Page)element2; page.Width = num + 20.0; } } foreach (UIElement element3 in this.Page2.Children) { if (element3 is BACAClient.UserControls.Controls.Page) { BACAClient.UserControls.Controls.Page page2 = (BACAClient.UserControls.Controls.Page)element3; page2.Width = num + 20.0; } } }
public void BoundControls() { if (this.data.Count > 10) { this.Page1.Children.Clear(); this.Page2.Children.Clear(); int pageCount = PageUtils.GetPageCount(this.data.Count); this.BindPageControl(pageCount, 1); this.BindPageControl(pageCount, 2); } List <Knowledge> listByPage = new List <Knowledge>(); //todo string str = string.Empty; foreach (Knowledge knowledge in listByPage) { str = str + string.Format("'{0}_{1}',", knowledge.TypeId, knowledge.LngId); } char[] trimChars = new char[] { ',' }; List <Good_top> list = new List <Good_top>(); //todo int num = ((this.pageIndex - 1) * PageUtils.GetPageSize()) + 1; this.List.Children.Clear(); foreach (Knowledge knowledge2 in listByPage) { BACAClient.UserControls.Controls.FrontDesk.TypeRetrieve element = new BACAClient.UserControls.Controls.FrontDesk.TypeRetrieve { model = knowledge2, good = list, index = num, width = (base.ActualWidth - 154.0) - 70.0, UserID = this.returnsearch.UserId }; element.gotokdp += new BACAClient.UserControls.Controls.FrontDesk.TypeRetrieve.ChangedEventHandler(this.gotokdp); this.List.Children.Add(element); num++; } }