Example #1
0
        public void upisVesti(int idPageSent)
        {
            int[] nizId = new int[4];
            int   id;

            ride.getText();

            id = ride.getMaxId();

            int brojac = 0;

            while (brojac < 4)
            {
                if (id != idPageSent)
                {
                    nizId[brojac] = id;
                    brojac++;
                }
                id--;
            }

            xml = ride.getTeksti();
            StudentskeVesti vest1 = ride.action(idPageSent);

            GlavniGrid.DataContext = vest1;


            StudentskeVesti vest2 = ride.action(nizId[0], xml);

            artikal1.DataContext = vest2;
            artikal1.Tag         = nizId[0];

            StudentskeVesti vest3 = ride.action(nizId[1], xml);

            artikal2.DataContext = vest3;
            artikal2.Tag         = nizId[1];

            StudentskeVesti vest4 = ride.action(nizId[2], xml);

            artikal3.DataContext = vest4;
            artikal3.Tag         = nizId[2];

            StudentskeVesti vest5 = ride.action(nizId[3], xml);

            artikal4.DataContext = vest5;
            artikal4.Tag         = nizId[3];
        }
Example #2
0
        public StudentskeVesti vrati(Grid ArtikliLevo, Grid ArtikliDesno, MyXmlReader ride, string xxml = "")
        {
            string xml = "";

            if (xxml == "")
            {
                ride.getText();
            }
            else
            {
                xml = @xxml + "";
            }



            //for (int i = 0; i < 4; i++)
            //{
            //    StudentskeVesti podaci = new StudentskeVesti();
            //    if (xml == "") { podaci = ride.action(i + 1); }
            //    else { podaci = ride.action(i + 1, xml); }


            //    Rectangle testRek = new Rectangle();
            //    testRek.Fill = new SolidColorBrush(Color.FromArgb(255, 68, 68, 68));
            //    testRek.Width = 250;

            //    StackPanel testSP = new StackPanel();
            //    testSP.Tapped += testSP_Tapped;
            //    Grid.SetRow(testSP, 1);

            //    Rectangle testRek1 = new Rectangle();
            //    testRek1.Width = 230;
            //    testRek1.Height = 150;
            //    testRek1.VerticalAlignment = VerticalAlignment.Top;

            //    TextBlock testTB = new TextBlock();
            //    testTB.Width = 230;
            //    testTB.FontSize = 30;
            //    testTB.TextWrapping = TextWrapping.Wrap;
            //    testTB.FontWeight = FontWeights.Light;
            //    testTB.Margin = new Thickness(0, 20, 0, 30);
            //    testTB.Text = podaci.Naslov;

            //    TextBlock testTB1 = new TextBlock();
            //    testTB1.Width = 230;
            //    testTB1.FontSize = 18;
            //    testTB1.TextWrapping = TextWrapping.Wrap;
            //    testTB1.FontWeight = FontWeights.Light;
            //    testTB1.Text = podaci.Opis;

            //    switch (i)
            //    {
            //        case 0:
            //            {
            //                //testRek.Height = 400;
            //                //Grid.SetRow(testRek, 0);
            //                //Grid.SetRowSpan(testRek, 2);
            //                //ArtikliLevo.Children.Add(testRek);

            //                //Uri uri = new Uri("ms-appx://" + podaci.MalaSlika);
            //                //BitmapImage s = new BitmapImage();
            //                //s.UriSource = uri;
            //                //ImageBrush ss = new ImageBrush();
            //                //ss.ImageSource = s;
            //                //testRek1.Fill = ss;

            //                //Grid.SetRow(testSP, 1);
            //                //testSP.Children.Add(testRek1);
            //                //testSP.Children.Add(testTB);
            //                //testSP.Children.Add(testTB1);
            //                //ArtikliLevo.Children.Add(testSP);

            //                break;
            //            }
            //        case 1:
            //            {
            //                testRek.Height = 360;
            //                Grid.SetRow(testRek, 3);
            //                Grid.SetRowSpan(testRek, 3);
            //                ArtikliLevo.Children.Add(testRek);

            //                Uri uri = new Uri("ms-appx://" + podaci.MalaSlika);
            //                BitmapImage s = new BitmapImage();
            //                s.UriSource = uri;
            //                ImageBrush ss = new ImageBrush();
            //                ss.ImageSource = s;
            //                testRek1.Fill = ss;

            //                Grid.SetRow(testSP, 4);
            //                testSP.Children.Add(testRek1);
            //                testSP.Children.Add(testTB);
            //                testSP.Children.Add(testTB1);
            //                ArtikliLevo.Children.Add(testSP);
            //                break;
            //            }
            //        case 2:
            //            {
            //                testRek.Height = 310;
            //                Grid.SetRow(testRek, 0);
            //                Grid.SetRowSpan(testRek, 2);
            //                ArtikliDesno.Children.Add(testRek);

            //                Uri uri = new Uri("ms-appx://" + podaci.MalaSlika);
            //                BitmapImage s = new BitmapImage();
            //                s.UriSource = uri;
            //                ImageBrush ss = new ImageBrush();
            //                ss.ImageSource = s;
            //                testRek1.Fill = ss;

            //                Grid.SetRow(testSP, 1);
            //                testSP.Children.Add(testRek1);
            //                testSP.Children.Add(testTB);
            //                testSP.Children.Add(testTB1);
            //                ArtikliDesno.Children.Add(testSP);

            //                break;
            //            }
            //        case 3:
            //            {
            //                testRek.Height = 450;
            //                Grid.SetRow(testRek, 3);
            //                Grid.SetRowSpan(testRek, 3);
            //                ArtikliDesno.Children.Add(testRek);

            //                Uri uri = new Uri("ms-appx://" + podaci.MalaSlika);
            //                BitmapImage s = new BitmapImage();
            //                s.UriSource = uri;
            //                ImageBrush ss = new ImageBrush();
            //                ss.ImageSource = s;
            //                testRek1.Fill = ss;

            //                Grid.SetRow(testSP, 4);
            //                testSP.Children.Add(testRek1);
            //                testSP.Children.Add(testTB);
            //                testSP.Children.Add(testTB1);
            //                ArtikliDesno.Children.Add(testSP);
            //                break;
            //            }
            //    }



            //}



            //Artikli.Children.Add(testSP);
            return(this);
        }