コード例 #1
0
        private void newButton_Click(object sender, RoutedEventArgs e)
        {
            addEdit = new AddEditResourceView(types: types.getAll().ToArray());

            NavigationService.Navigate(addEdit);

            if (addEdit.ResourceChanged)
            {
                resources.addSingle(addEdit.BoundResource);
                updateDataGrid();
            }
        }
コード例 #2
0
        private void editButton_Click(object sender, RoutedEventArgs e)
        {
            Resource toEdit = null;

            if (resourcesDataGrid.SelectedItem != null)
            {
                toEdit = resourcesDataGrid.SelectedItem as Resource;
            }
            addEdit = new AddEditResourceView(toEdit, types.getAll().ToArray(), true);

            NavigationService.Navigate(addEdit);

            if (addEdit.ResourceChanged)
            {
                resources.updateSingle(addEdit.BoundResource);
                updateDataGrid();
            }
        }