예제 #1
0
        public static bool StartEditing(Window owner, ReportConfig items)
        {
            ReportConfigEditor editor = new ReportConfigEditor();

            editor.Model       = items;
            editor.DataContext = items;
            editor.Owner       = owner;
            editor.ShowDialog();

            return(editor.ApplyChanges);
        }
예제 #2
0
        private void BtnEdit_Click(object sender, RoutedEventArgs e)
        {
            ImageButton  button = (ImageButton)sender;
            ReportConfig config = (ReportConfig)button.DataContext;
            ReportConfig clone  = ReportConfigSerializer.Clone(config);

            if (ReportConfigEditor.StartEditing(this, clone))
            {
                int index = Model.IndexOf(config);
                Model[index] = clone;
            }
        }
예제 #3
0
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            ReportConfig config = new ReportConfig
            {
                Guid        = Guid.NewGuid(),
                Name        = "New report",
                Description = "",
                Type        = ReportType.ListResources,
            };

            if (ReportConfigEditor.StartEditing(this, config))
            {
                Model.Add(config);
            }
        }