/// <summary> /// init services, caricamento categorie /// </summary> void Init() { // init services categoriaService = new CategorieService(); linksService = new LinksService(); // load elementi LoadCategorie(categoriaService.GetAll()); //ui this.Title = "Gestione link - " + new ConfigManager().GetKey("FileName"); // TODO //txbCount.Text = ""; }
private void MiCategorieInserisci_Click(object sender, RoutedEventArgs e) { bool result = new WindowFormCategoria().ShowDialog().Value; if (result) { LoadCategorie(categoriaService.GetAll()); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { //load categorie cmbCategoria.ItemsSource = categorieService.GetAll(); cmbCategoria.DisplayMemberPath = "Nome"; //caricamento elementi form txtTitolo.Text = (_link.IdLink > 0) ? _link.Titolo : ""; txtDescrizione.Text = (_link.IdLink > 0) ? _link.Descrizione : ""; txtUrl.Text = (_link.IdLink > 0) ? _link.URL : ""; foreach (Categoria c in cmbCategoria.Items) { if (c.IdCategoria == _link.IdCategoria) { cmbCategoria.SelectedItem = c; } } //preload clipboard if (_link.IdLink == 0 && Uri.IsWellFormedUriString(Clipboard.GetText(), UriKind.RelativeOrAbsolute)) { txtUrl.Text = Clipboard.GetText(); } }