Exemplo n.º 1
0
        public static bool Display(FieldsEditorViewModel context, Window owner = null)
        {
            TextFileReadFieldsEditor window = new TextFileReadFieldsEditor(context);

            window.Owner = owner ?? Application.Current.MainWindow;
            return(window.ShowDialog() ?? false);
        }
Exemplo n.º 2
0
 public TextFileReadFieldsEditor(FieldsEditorViewModel context)
 {
     InitializeComponent();
     DataContext  = context;
     this.context = context;
     SetupDataGrid();
     AddHandler(Validation.ErrorEvent, new RoutedEventHandler(OnErrorEvent));
 }
Exemplo n.º 3
0
        public void EditValue(Property property, object designer)
        {
            var fieldsEditorViewModel = new FieldsEditorViewModel(property.GetValue <TextFileReaderFields>());
            var textFileReadDesigner  = (TextFileReadDesigner)designer;

            fieldsEditorViewModel.SkipHeaderLines = textFileReadDesigner.SkipHeaderLines;
            fieldsEditorViewModel.SkipFooterLines = textFileReadDesigner.SkipFooterLines;

            if (TextFileReadFieldsEditor.Display(fieldsEditorViewModel))
            {
                property.Value = fieldsEditorViewModel.UpdatedFields;
                textFileReadDesigner.SkipHeaderLines = fieldsEditorViewModel.SkipHeaderLines;
                textFileReadDesigner.SkipFooterLines = fieldsEditorViewModel.SkipFooterLines;
            }
        }