コード例 #1
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     IOservice = new JsonIOservice();
     try
     {
         tasksClasses = IOservice.LoadTasks();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         Close();
     }
     AddTasksDate();
     tasksClasses.CollectionChanged += Collection_Changed;
     MainDataGrid.ItemsSource        = tasksClasses;
 }
コード例 #2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                contacts = jsonIO.LoadContacts();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Close();
            }
            contacts.CollectionChanged += Collection_Changed;

            if (contacts.Count <= 0)
            {
                AddContactRange(CreateRandomContacts.GetContacts(new Random().Next(1, 100)));
            }
            DataGridInfo.ItemsSource = contacts;
        }