Esempio n. 1
0
        private void Btn_Add_Click(object sender, RoutedEventArgs e)
        {
            var wndw = new AddTimeWindow();

            if (!wndw.ShowDialog().Value)
            {
                return;
            }

            lb_times.Items.Add(new ListViewItem()
            {
                Content = wndw.TIME
            });
        }
Esempio n. 2
0
        /// <summary>
        /// Prompt user for new time to add
        /// </summary>
        private void Btn_Add_Click(object sender, RoutedEventArgs e)
        {
            var wndw = new AddTimeWindow();

            if (!wndw.ShowDialog().Value)
            {
                return;
            }

            if (times.Count == 0)
            {
                ErrorCnt--;
                Validation.ClearInvalid(lb_times.GetBindingExpression(ListBox.ItemsSourceProperty));
            }

            times.Add(wndw.time);
        }