Пример #1
0
        public Tester(MainWindow mw, String xmlFile)
        {
            InitializeComponent();
            main = mw;

            IDialogService dialogService = new DialogService(mw);

            dialogService.Register <UserInfoDialogViewModel, userInfoPage>();
            dialogService.Register <CommentDialogViewModel, CommentDialog>();

            XmlDocument xml = new XmlDocument();

            try
            {
                xml.Load(xmlFile);
            }
            catch (Exception err)
            {
                throw new ArgumentException(err.ToString());
            }

            MainTesterViewModel test = new MainTesterViewModel(xml, dialogService);

            this.DataContext = test;
        }
        public UserInfoDialogViewModel(MainTesterViewModel procedure)
        {
            _name = procedure.Name ?? String.Empty;
            _softwareLoadVersion = procedure.SoftwareLoadVersion ?? String.Empty;
            _programPhase        = procedure.ProgramPhase ?? String.Empty;
            _programType         = procedure.ProgramType ?? String.Empty;
            _classification      = procedure.Classification ?? String.Empty;

            SubmitCommand = new RelayCommand(p => CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(true)));
            CancelCommand = new RelayCommand(p => CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(false)));
        }