/** * Adauga poze in meniu * */ void adaugaPoze() { img[0] = new Image(); img[0].MouseLeftButtonDown += new MouseButtonEventHandler(MeniuPicks_MouseLeftButtonDown); ADDPozaCuBorder p = new ADDPozaCuBorder(myMeniuPicksCanvas, img[0], 70, 70, poze[0], 520, 15); p.Border(new CornerRadius(2, 2, 2, 2), ConvertToColor("#FFFFFFFF"), new Thickness(2), 71, 71); for (int i = 1; i < 6; i++) { img[i] = new Image(); img[i].MouseLeftButtonDown += MeniuPicks_MouseLeftButtonDown; p = new ADDPozaCuBorder(myMeniuPicksCanvas, img[i], 70, 70, poze[i], 520 - 90 * i, 15); p.Border(new CornerRadius(2, 2, 2, 2), ConvertToColor("#FFFFFFFF"), new Thickness(2), 71, 71); } imagecount = 5; }
/* * Afiseaza urmatorul element din meniu * */ void polygon_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (imagecount < poze.Length-1) { // Sterg pozele cu border cu tot si le refac myMeniuPicksCanvas.Children.Clear(); initialize(); int i = 0; imgcount = 0; for (i = imagecount - 4; i <= imagecount + 1; i++,imgcount++) { //img[imgcount].Source = new BitmapImage(new Uri(poze[i], UriKind.Relative)); img[imgcount] = new Image(); img[imgcount].MouseLeftButtonDown += MeniuPicks_MouseLeftButtonDown; p = new ADDPozaCuBorder(myMeniuPicksCanvas, img[imgcount], 70, 70, poze[i], 520 - 90 * imgcount, 15); p.Border(new CornerRadius(2, 2, 2, 2), ConvertToColor("#FFFFFFFF"), new Thickness(2), 71, 71); } imagecount++; if(imagecount >= poze.Length-1) { polygonInainte.Stroke = new SolidColorBrush(Colors.Gray); polygonInainte.Fill = new SolidColorBrush(Colors.Red); polygonInainte.Opacity = 0.5; } polygonInapoi.Stroke = new SolidColorBrush(Colors.Gray); polygonInapoi.Fill = new SolidColorBrush(Colors.Yellow); polygonInapoi.Opacity = 0.9; } }