Esempio n. 1
0
        private void ContextMenuAddClicked(object sender, RoutedEventArgs e)
        {
            Dialogs.AddEditQuoteDialog aeqd = new Dialogs.AddEditQuoteDialog();
            var result = aeqd.ShowDialog();

            if (result != null && result == true)
            {
                Quotes.QuotesList.Add(aeqd.ReturnedQuote);
                ListView_Quotes.Items.Refresh();
            }
        }
Esempio n. 2
0
 private void ContextMenuEditClicked(object sender, RoutedEventArgs e)
 {
     if (ListView_Quotes.SelectedItem != null)
     {
         var id       = ListView_Quotes.SelectedIndex;
         var tmpQuote = (SuiBot_Core.Storage.Quote)ListView_Quotes.Items[id];
         Dialogs.AddEditQuoteDialog aeqd = new Dialogs.AddEditQuoteDialog(tmpQuote);
         var result = aeqd.ShowDialog();
         if (result != null && result == true)
         {
             Quotes.QuotesList[id] = aeqd.ReturnedQuote;
             ListView_Quotes.Items.Refresh();
         }
     }
 }