RobotView.xaml.cs 666 B

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