private void CoversAdd() { List <string> covers = _covers ?? (_covers = f.DirSearch(string.Format("../../../../../SmallCovers"))); List <UserControl> c = new List <UserControl>(); List <string> covers_new = covers.Where(e => e.Contains("m" + Properties.Resources.magazine.ToLower())).ToList(); coversPanel.Children.Clear(); foreach (var item in covers_new) { BitmapImage b = new BitmapImage(); b.BeginInit(); b.CacheOption = BitmapCacheOption.None; b.UriSource = new Uri(item); b.EndInit(); ImageBrush content = new ImageBrush(); content.ImageSource = b; Page_Carousel p = new Page_Carousel(this); p.BackGroundURL = item; Frame fr = new Frame(); fr.Width = 186; fr.Height = 248; Thickness th = fr.Padding; th.Left = 10; th.Right = 5; th.Top = 10; th.Bottom = 5; fr.Padding = th; fr.Content = p; coversPanel.Children.Add(fr); p.Background = content; } }
private FrameworkElement CreateFixedSizeLabel(string uri_picture, Size size) { Page_Carousel label = new Page_Carousel(_flip); label.FontSize = 64; label.MinWidth = label.MaxWidth = label.Width = size.Width; label.MinHeight = label.MaxHeight = label.Height = size.Height; BitmapImage b = new BitmapImage(new Uri(uri_picture, UriKind.Relative)); ImageBrush content = new ImageBrush(); content.ImageSource = b; label.Background = content; label.BackGroundURL = uri_picture; return(label); }