public WindowClosingGuard(Window window, IValidationStatusProvider validator)
 {
     Debug.Assert(window != null);
     Debug.Assert(validator != null);
     _validator = validator;
     window.Closing += new CancelEventHandler(window_Closing);
 }
        public RegistrationWnd(RegistrationService service, IValidationStatusProvider vsp)
        {
            InitializeComponent();

            this.DataContext = service.Registration;
            this.status.DataContext = vsp;

            this.GotFocus += new RoutedEventHandler(RegistrationWnd_GotFocus);
        }
 public WordWnd(WordEditModel word, IValidationStatusProvider vsp)
 {
     Debug.Assert(word != null);
     Debug.Assert(vsp != null);
     InitializeComponent();
     this.DataContext = word;
     this.status.DataContext = vsp;
     this.GotFocus += new RoutedEventHandler(WordWnd_GotFocus);
 }
        public ProfileWnd(ProfileModel model, IValidationStatusProvider vsp)
        {
            Debug.Assert(model != null);
            Debug.Assert(vsp != null);

            InitializeComponent();

            this.DataContext = model;
            this.status.DataContext = vsp;

            this.GotFocus += new RoutedEventHandler(ProfileWnd_GotFocus);
        }
        public TextWnd(TextModel text, IValidationStatusProvider vsp)
        {
            Debug.Assert(text != null);
            Debug.Assert(vsp != null);

            InitializeComponent();

            this.DataContext = text;
            this.status.DataContext = vsp;

            this.GotFocus += new RoutedEventHandler(TextWnd_GotFocus);
        }
        public MeaningFindWnd(MeaningFinderModel model, IValidationStatusProvider validator)
        {
            Debug.Assert(model != null);
            Debug.Assert(validator != null);

            InitializeComponent();

            this.DataContext = model;
            this.status.DataContext = validator;

            this.GotFocus += new RoutedEventHandler(MeaningFindWnd_GotFocus);
        }
        public WordFindWnd(Object model, IValidationStatusProvider validator)
        {
            Debug.Assert(model != null);
            Debug.Assert(validator != null);

            InitializeComponent();

            this.listWords.SelectionChanged += new SelectionChangedEventHandler(listWords_SelectionChanged);

            this.DataContext = model;
            this.status.DataContext = validator;

            this.GotFocus += new RoutedEventHandler(WordFindWnd_GotFocus);
        }
        public MeaningWnd(MeaningEditModel model, IValidationStatusProvider validator)
        {
            Debug.Assert(model != null);
            Debug.Assert(validator != null);
            InitializeComponent();
            this.DataContext = model;
            this.status.DataContext = validator;

            INotifyPropertyChanged npc = (INotifyPropertyChanged)validator;
            npc.PropertyChanged += new PropertyChangedEventHandler(OnPropertyChanged);

            this.listTranslations.MouseDoubleClick += new MouseButtonEventHandler(list_MouseDoubleClick);
            this.listSynonyms.MouseDoubleClick += new MouseButtonEventHandler(list_MouseDoubleClick);
            this.listAntonyms.MouseDoubleClick += new MouseButtonEventHandler(list_MouseDoubleClick);

            this.Closing += new CancelEventHandler(OnClosing);
            this.GotFocus += new RoutedEventHandler(MeaningWnd_GotFocus);
        }