private void Checkbox1_Unchecked(object sender, RoutedEventArgs e) { this.panel3.Children.Clear(); foreach (UserControl_MyPage x in book1.Items) { if (x.checkbox1.IsChecked == true && x.imageURL != null) { UserControl_MyPage y = new UserControl_MyPage(); y.Height = 100; y.Width = 100; y.Title = x.Title; y.imageURL = x.imageURL; this.panel3.Children.Add(y); } else if (x.checkbox1.IsChecked == true && x.ImageBytes != null) { UserControl_MyPage y = new UserControl_MyPage(); y.Height = 100; y.Width = 100; y.Title = x.Title; y.ImageBytes = x.ImageBytes; this.panel3.Children.Add(y); } } }
private void Button_Click_4(object sender, RoutedEventArgs e) { var PhotoList = global::PhotoDataModel_V2.PhotoDataSource.Search("FIFAWORLDCUP"); for (int i = 0; i < PhotoList.Count; i++) { UserControl_MyPage page = new UserControl_MyPage(); page.checkbox1.Checked += Checkbox1_Checked; page.checkbox1.Unchecked += Checkbox1_Unchecked; page.Title = PhotoList[i].Title; page.imageURL = PhotoList[i].ImagePath; this.book1.Items.Add(page); } }
private void Button_Click_5(object sender, RoutedEventArgs e) { AdventureWorksEntities dbContext = new AdventureWorksEntities(); var query = from p in dbContext.ProductPhotoes select p; List <ProductPhoto> ProductList = query.ToList(); for (int i = 0; i < ProductList.Count; i++) { UserControl_MyPage mypage = new UserControl_MyPage(); mypage.checkbox1.Checked += Checkbox1_Checked; mypage.checkbox1.Unchecked += Checkbox1_Unchecked; mypage.Title = ProductList[i].ModifiedDate.Value.ToShortDateString(); mypage.ImageBytes = ProductList[i].LargePhoto; this.book1.Items.Add(mypage); } }
public EBook() { InitializeComponent(); UserControl_MyPage page1 = new UserControl_MyPage(); }