public PdfPage() { this.InitializeComponent(); // Setup the navigation helper this.navigationHelper = new NavigationHelper(this); this.navigationHelper.LoadState += navigationHelper_LoadState; this.navigationHelper.SaveState += navigationHelper_SaveState; // Setup the logical page navigation components that allow // the page to only show one pane at a time. this.navigationHelper.GoBackCommand = new RelayCommand(() => this.GoBack(), () => this.CanGoBack()); this.itemListView.SelectionChanged += ItemListView_SelectionChanged; // Start listening for Window size changes // to change from showing two panes to showing a single pane Window.Current.SizeChanged += Window_SizeChanged; this.InvalidateVisualState(); }
public Profesori() { this.InitializeComponent(); this.navigationHelper = new NavigationHelper(this); this.navigationHelper.LoadState += navigationHelper_LoadState; this.navigationHelper.SaveState += navigationHelper_SaveState; baza = new Baza(); using (reader = baza.izvrsiUpit(upit)) { while (reader.Read()) { profesori.Add(new ProfesorC(reader.GetString("idProfesor"), reader.GetString("imePrezime"), reader.GetString("titula"), reader.GetString("zvanje"), reader.GetString("slika"), reader.GetString("konsultacije"), reader.GetString("kabinet"), reader.GetString("mail"), reader.GetString("biografija"), reader.GetString("aktivnost"))); } } spProfesori.Margin = new Thickness(100, 50, 100, 100); lvProfesori.Tapped += lvProfesori_Tapped; lvProfesori.Width = 500; lvProfesori.HorizontalAlignment = HorizontalAlignment.Left; lvProfesori.IsSwipeEnabled = false; spProfesori.Children.Add(lvProfesori); StackPanel sp1 = new StackPanel(); TextBlock tbSlovo = new TextBlock(); tbSlovo.Text = "А"; tbSlovo.FontSize = 60; tbSlovo.Margin = new Thickness(5, 0, 0, 0); sp1.Background = new SolidColorBrush(Colors.RoyalBlue); sp1.Width = 500; sp1.Children.Add(tbSlovo); lvProfesori.Items.Add(sp1); foreach(ProfesorC p in profesori) { if (lvProfesori.Items.Count == maxCnt) { lvProfesori = new ListView(); lvProfesori.IsSwipeEnabled = false; lvProfesori.Width = 500; lvProfesori.HorizontalAlignment = HorizontalAlignment.Left; lvProfesori.Tapped += lvProfesori_Tapped; spProfesori.Children.Add(lvProfesori); } if (tbSlovo.Text.Equals(p.imePrezime.Substring(0, 1))) { dodajStavkuListe(p); } else { tbSlovo = new TextBlock(); tbSlovo.FontSize = 60; tbSlovo.Margin = new Thickness(5, 0, 0, 0); tbSlovo.Text = p.imePrezime.Substring(0, 1); if (lvProfesori.Items.Count == maxCnt) { lvProfesori = new ListView(); lvProfesori.Width = 500; lvProfesori.HorizontalAlignment = HorizontalAlignment.Left; lvProfesori.Tapped += lvProfesori_Tapped; spProfesori.Children.Add(lvProfesori); } sp1 = new StackPanel(); sp1.Background = new SolidColorBrush(Colors.RoyalBlue); sp1.Width = 500; sp1.Children.Add(tbSlovo); lvProfesori.Items.Add(sp1); dodajStavkuListe(p); } } }