示例#1
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            // http://madprops.org/blog/wpf-textbox-selectall-on-focus/
            EventManager.RegisterClassHandler(typeof(TextBox),
                TextBox.GotFocusEvent,
                new RoutedEventHandler(TextBox_GotFocus));
            <<<<<<< HEAD

            DataSource dataSource = new DataSource();
            this.MainWindow = new PersonWindow();
            this.MainWindow.DataContext = new PersonViewModel(dataSource.GetPerson());
            this.MainWindow.Show();
            =======
            >>>>>>> a99901b09612b10e355b6a0a03717e1337a1b6ce
        }
 private void PersonWindow_Loaded(object sender, RoutedEventArgs e)
 {
     DataSource dataSource = new DataSource();
     DataContext = dataSource.GetPerson();
 }