LoginView.xaml.cs 667 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System.ComponentModel.Composition;
  2. using System.Windows;
  3. using Infrastructure;
  4. namespace Modules.Robot
  5. {
  6. /// <summary>
  7. /// LoginView.xaml 的交互逻辑
  8. /// </summary>
  9. // [ViewExport(RegionName = "RobotRegion"), PartCreationPolicy(CreationPolicy.Shared)]
  10. public partial class LoginView
  11. {
  12. public LoginView()
  13. {
  14. InitializeComponent();
  15. }
  16. [Import]
  17. private RobotViewModel ViewModel
  18. {
  19. get
  20. {
  21. return this.DataContext as RobotViewModel;
  22. }
  23. set
  24. {
  25. this.DataContext = value;
  26. }
  27. }
  28. private void btnLogin_Click(object sender, RoutedEventArgs e)
  29. {
  30. this.ViewModel.Login();
  31. }
  32. }
  33. }