public static void Olustur(Grid g) { g.Children.Clear(); g.ColumnDefinitions.Clear(); g.RowDefinitions.Clear(); Islemler.RowOlustur(g, 0.5, 1, 1, 1, 6, 1, 1); Islemler.ColumnOlustur(g, 1, 8, 1); SATSLabel lbl_konu = new SATSLabel(); lbl_konu.Content = "Konu:"; lbl_konu.HorizontalAlignment = HorizontalAlignment.Left; Grid.SetRow(lbl_konu, 1); Grid.SetColumn(lbl_konu, 1); SATSTextBox txt_konu = new SATSTextBox { Margin = new Thickness(10), Uid = "txt_konu" }; Grid.SetRow(txt_konu, 2); Grid.SetColumn(txt_konu, 1); SATSLabel lbl_mesaj = new SATSLabel(); lbl_mesaj.Content = "Mesaj:"; lbl_mesaj.HorizontalAlignment = HorizontalAlignment.Left; Grid.SetRow(lbl_mesaj, 3); Grid.SetColumn(lbl_mesaj, 1); SATSTextBox txt_mesaj = new SATSTextBox { Margin = new Thickness(10), TextWrapping = TextWrapping.Wrap, AcceptsReturn = true, Uid = "txt_mesaj" }; Grid.SetRow(txt_mesaj, 4); Grid.SetColumn(txt_mesaj, 1); SATSButton btn_gonder = new SATSButton { Content = "Gönder", Margin = new Thickness(10) }; Grid.SetRow(btn_gonder, 5); Grid.SetColumn(btn_gonder, 1); btn_gonder.Click += Btn_gonder_Click; g.Children.Add(lbl_konu); g.Children.Add(txt_konu); g.Children.Add(lbl_mesaj); g.Children.Add(txt_mesaj); g.Children.Add(btn_gonder); }
public static void Olustur(Grid g) { List <UIElement> olayEkle = new List <UIElement>(); foreach (UIElement element in g.Children) { if (element.Uid == "lw_magdur") { magdurCollection = ((SATSListView)element).Items; } olayEkle.Add(element); } g.Tag = olayEkle; g.Children.Clear(); g.ColumnDefinitions.Clear(); g.RowDefinitions.Clear(); Islemler.ColumnOlustur(g, 0.1, 1, 1, 1, 0.1, 0.7); Islemler.RowOlustur(g, 0.5, 0.1, 0.4, 0.3, 0.3, 0.3, 0.3, 0.5, 0.5); SATSLabel lbl_TC = new SATSLabel(); lbl_TC.Content = "TC Kimlik No:"; Grid.SetRow(lbl_TC, 3); Grid.SetColumn(lbl_TC, 1); SATSLabel lbl_isim = new SATSLabel(); lbl_isim.Content = "İsim:"; Grid.SetRow(lbl_isim, 4); Grid.SetColumn(lbl_isim, 1); SATSLabel lbl_soyisim = new SATSLabel(); lbl_soyisim.Content = "Soyisim"; Grid.SetRow(lbl_soyisim, 5); Grid.SetColumn(lbl_soyisim, 1); SATSTextBox txt_TC = new SATSTextBox { TextAlignment = TextAlignment.Center, Margin = new Thickness(15), Uid = "magdurEkle_txtTC" }; Grid.SetRow(txt_TC, 3); Grid.SetColumn(txt_TC, 2); SATSTextBox txt_isim = new SATSTextBox { TextAlignment = TextAlignment.Center, Margin = new Thickness(15), Uid = "magdurEkle_txtIsim" }; Grid.SetRow(txt_isim, 4); Grid.SetColumn(txt_isim, 2); SATSTextBox txt_soyisim = new SATSTextBox { TextAlignment = TextAlignment.Center, Margin = new Thickness(15), Uid = "magdurEkle_txtSoyisim" }; Grid.SetRow(txt_soyisim, 5); Grid.SetColumn(txt_soyisim, 2); SATSListView lw_liste = new SATSListView { Background = Ayarlar.GriRenk, Foreground = Ayarlar.BeyazRenk, Uid = "magdurEkle_lwListe" }; Grid.SetRowSpan(lw_liste, 6); Grid.SetRow(lw_liste, 1); Grid.SetColumn(lw_liste, 3); if (magdurCollection != null) { foreach (Magdur item in magdurCollection) { lw_liste.Items.Add(item); } } SATSButton btn_ekle = new SATSButton { Content = "Ekle", Margin = new Thickness(15) }; Grid.SetRow(btn_ekle, 6); Grid.SetColumn(btn_ekle, 2); SATSButton btn_cikar = new SATSButton { Content = "-", VerticalContentAlignment = VerticalAlignment.Top, Margin = new Thickness(2, 0, 0, 0) }; Grid.SetRow(btn_cikar, 1); Grid.SetColumn(btn_cikar, 4); SATSButton btn_tamam = new SATSButton { Content = "Tamam", Margin = new Thickness(0, 15, 0, 15) }; Grid.SetRow(btn_tamam, 7); Grid.SetColumn(btn_tamam, 3); txt_TC.PreviewTextInput += Txt_TC_PreviewTextInput; txt_TC.IsKeyboardFocusedChanged += Txt_TC_IsKeyboardFocusedChanged; btn_ekle.Click += Btn_ekle_Click; btn_cikar.Click += Btn_cikar_Click; btn_tamam.Click += Btn_tamam_Click; g.Children.Add(lbl_TC); g.Children.Add(lbl_isim); g.Children.Add(lbl_soyisim); g.Children.Add(txt_TC); g.Children.Add(txt_isim); g.Children.Add(txt_soyisim); g.Children.Add(lw_liste); g.Children.Add(btn_ekle); g.Children.Add(btn_cikar); g.Children.Add(btn_tamam); }
public static void Olustur(Grid g) { List <UIElement> olayEkle = new List <UIElement>(); foreach (UIElement element in g.Children) { if (element.Uid == "lw_supheli") { supheliCollection = ((SATSListView)element).Items; } olayEkle.Add(element); } g.Children.Clear(); g.ColumnDefinitions.Clear(); g.RowDefinitions.Clear(); Islemler.ColumnOlustur(g, 0.1, 1, 1, 1, 0.1, 0.7); Islemler.RowOlustur(g, 0.5, 0.1, 0.1, 0.3, 0.3, 0.3, 0.3, 0.3, 0.5, 0.5); SATSLabel lbl_TC = new SATSLabel(); lbl_TC.Content = "TC Kimlik No:"; Grid.SetRow(lbl_TC, 3); Grid.SetColumn(lbl_TC, 1); SATSLabel lbl_isim = new SATSLabel(); lbl_isim.Content = "İsim:"; Grid.SetRow(lbl_isim, 4); Grid.SetColumn(lbl_isim, 1); SATSLabel lbl_soyisim = new SATSLabel(); lbl_soyisim.Content = "Soyisim:"; Grid.SetRow(lbl_soyisim, 5); Grid.SetColumn(lbl_soyisim, 1); SATSTextBox txt_TC = new SATSTextBox { TextAlignment = TextAlignment.Center, Margin = new Thickness(15), Uid = "supheliEkle_txtTC" }; Grid.SetRow(txt_TC, 3); Grid.SetColumn(txt_TC, 2); SATSTextBox txt_isim = new SATSTextBox { TextAlignment = TextAlignment.Center, Margin = new Thickness(15), Uid = "supheliEkle_txtIsim" }; Grid.SetRow(txt_isim, 4); Grid.SetColumn(txt_isim, 2); SATSTextBox txt_soyisim = new SATSTextBox { TextAlignment = TextAlignment.Center, Margin = new Thickness(15), Uid = "supheliEkle_txtSoyisim" }; Grid.SetRow(txt_soyisim, 5); Grid.SetColumn(txt_soyisim, 2); SATSLabel lbl_supheliDurum = new SATSLabel(); lbl_supheliDurum.Content = "Şüpheli Durumu:"; Grid.SetRow(lbl_supheliDurum, 6); Grid.SetColumn(lbl_supheliDurum, 1); SATSComboBox cb_supheliDurum = new SATSComboBox { Margin = new Thickness(15), SelectedValuePath = "ID", DisplayMemberPath = "adi", Uid = "cb_supheliDurum" }; Grid.SetRow(cb_supheliDurum, 6); Grid.SetColumn(cb_supheliDurum, 2); SATSListView lw_liste = new SATSListView(); lw_liste.Uid = "supheliEkle_lwListe"; Grid.SetRowSpan(lw_liste, 6); Grid.SetRow(lw_liste, 2); Grid.SetColumn(lw_liste, 3); if (supheliCollection != null) { foreach (Supheli item in supheliCollection) { lw_liste.Items.Add(item); } } SATSButton btn_ekle = new SATSButton { Content = "Ekle", Margin = new Thickness(15) }; Grid.SetRow(btn_ekle, 7); Grid.SetColumn(btn_ekle, 2); SATSButton btn_cikar = new SATSButton { Content = "-", VerticalContentAlignment = VerticalAlignment.Top, Margin = new Thickness(2, 0, 0, 0) }; Grid.SetRow(btn_cikar, 2); Grid.SetColumn(btn_cikar, 4); SATSButton btn_tamam = new SATSButton { Content = "Tamam", Margin = new Thickness(0, 15, 0, 15) }; Grid.SetRow(btn_tamam, 8); Grid.SetColumn(btn_tamam, 3); /*using (var db = new Context()) * { * var durum = (from f in db.supheliDurumlari select f).ToList(); * cb_supheliDurum.ItemsSource = durum; * }*/ g.Tag = olayEkle; txt_TC.PreviewTextInput += Txt_TC_PreviewTextInput; txt_TC.IsKeyboardFocusedChanged += Txt_TC_IsKeyboardFocusedChanged; btn_ekle.Click += Btn_ekle_Click; btn_cikar.Click += Btn_cikar_Click; btn_tamam.Click += Btn_tamam_Click; g.Children.Add(lbl_TC); g.Children.Add(lbl_isim); g.Children.Add(lbl_soyisim); g.Children.Add(txt_TC); g.Children.Add(txt_isim); g.Children.Add(txt_soyisim); g.Children.Add(lw_liste); g.Children.Add(btn_ekle); g.Children.Add(btn_cikar); g.Children.Add(btn_tamam); g.Children.Add(lbl_supheliDurum); g.Children.Add(cb_supheliDurum); }