//List<InformatorServis.Predmeti> predmeti; //InformatorServis.PredmetiClient cl = new InformatorServis.PredmetiClient(); public pgInfo_za_uplate() { InitializeComponent(); //Pozivanje servisne operacije asinhrono //cl.ListaPredmetaAsync(); //cl.ListaPredmetaCompleted += cl_ListaPredmetaCompleted; //------------------------Primer---------------------------- //---Dodavanje dugmica dinamicki, ako nekom bude potrebno--- //for (int i = 0; i < gdRight.ColumnDefinitions.Count; i++) //{ // for (int j = 0; j < gdRight.RowDefinitions.Count; j++) // { // Rectangle btn = new Rectangle(); // btn.Fill = new SolidColorBrush(Colors.Azure); // btn.Margin = new Thickness(5); // Grid.SetColumn(btn, i); // Grid.SetRow(btn, j); // gdRight.Children.Add(btn); // } //} //--------------------------Dodavanje elementa pomocu metode---------------- for (int i = 0; i < 16; i++) { var btn = new btnDugmeTemp { Margin = new Thickness(5), btnBackColor = new SolidColorBrush(Color.FromArgb(Convert.ToByte(255), Convert.ToByte(i * 10), Convert.ToByte(255 / (i + 1)), Convert.ToByte(i + 20))), btnText = i.ToString() }; btn.click += btn_click; // Animate.AddChildAnimate(btn, gdRight, i * 50); } //-------------------------Dodavanje animacije celom grid layout-u---------------- //Animate.GridAnimateEntrance(gdRight); }
//Metoda sa rezultatom "upita" //void cl_ListaPredmetaCompleted(object sender, InformatorServis.ListaPredmetaCompletedEventArgs e) //{ // predmeti = e.Result.ToList(); //} private void Button_Click(object sender, RoutedEventArgs e) { i++; var btn = new btnDugmeTemp { Margin = new Thickness(5) }; (btn as btnDugmeTemp).btnText = "Dugme" + i; BitmapImage bmi = new BitmapImage(new Uri("/Resources/cek.png", UriKind.Relative)); (btn as btnDugmeTemp).btnImage = bmi; //Grid.SetColumn(btn, 3); //Grid.SetRow(btn, 3); //gdRight.Children.Add(btn); //Animate.AddChildAnimate(btn, gdRight, 50); }