private async void ButtonRemoveClick(object sender, RoutedEventArgs e)
        {
            var group = (StiReportData.StiGroupInfoList)cvs1.Source;
            var item  = itemsGrid.SelectedItem as StiReportData.StiReportItem;

            group.Remove(item);

            await StiCustomReportsHelper.SaveDataAsync(groups);

            cvs1.Source           = null;
            itemsGrid.ItemsSource = null;

            cvs1.Source = group;
        }
Exemplo n.º 2
0
        private async void ButtonDeleteCategoryClick(object sender, RoutedEventArgs e)
        {
            int index = itemsGrid.Items.IndexOf(itemsGrid.SelectedItem);

            if (index == -1)
            {
                return;
            }

            var groups = ((List <StiReportData.StiGroupInfoList>)cvs1.Source);

            groups.RemoveAt(index);

            await StiCustomReportsHelper.SaveDataAsync(groups);

            cvs1.Source           = null;
            itemsGrid.ItemsSource = null;

            cvs1.Source           = groups;
            itemsGrid.ItemsSource = cvs1.View.CollectionGroups;
        }