RobotView.xaml.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System.ComponentModel.Composition;
  2. using System.Windows;
  3. using Infrastructure;
  4. namespace Modules.Robot
  5. {
  6. /// <summary>
  7. /// RobotView.xaml 的交互逻辑
  8. /// </summary>
  9. [ViewExport(RegionName = "RobotRegion"), PartCreationPolicy(CreationPolicy.NonShared)]
  10. public partial class RobotView
  11. {
  12. public RobotView()
  13. {
  14. this.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 menuReload_Click(object sender, RoutedEventArgs e)
  29. {
  30. this.ViewModel.Reload();
  31. }
  32. private void btnFind_Click(object sender, RoutedEventArgs e)
  33. {
  34. this.ViewModel.Find();
  35. }
  36. private void menuLogin_Click(object sender, RoutedEventArgs e)
  37. {
  38. }
  39. private void menuServers_Click(object sender, RoutedEventArgs e)
  40. {
  41. this.ViewModel.Servers();
  42. }
  43. private void btnForbiddenBuy_Click(object sender, RoutedEventArgs e)
  44. {
  45. this.ViewModel.ForbiddenBuy();
  46. }
  47. private void btnAllowBuy_Click(object sender, RoutedEventArgs e)
  48. {
  49. this.ViewModel.AllowBuy();
  50. }
  51. }
  52. }