终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

35 line
1023 B

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using BPASmartClient.Helper;
  7. using Microsoft.Toolkit.Mvvm.ComponentModel;
  8. using System.Collections.ObjectModel;
  9. using Microsoft.Toolkit.Mvvm.Input;
  10. namespace WPFDemo
  11. {
  12. public class Class1 : ObservableObject
  13. {
  14. public Class1()
  15. {
  16. AddCommand = new RelayCommand(() =>
  17. {
  18. dataTests.Add(new DataTest()
  19. {
  20. data1 = new Random().Next(0, 100),
  21. data2 = new Random().Next(200, 300),
  22. data3 = new Random().Next(400, 500).ToString(),
  23. data4 = Convert.ToBoolean(new Random().Next(0, 1)),
  24. data5 = new Random().Next(600, 700)
  25. });
  26. });
  27. }
  28. public ObservableCollection<DataTest> dataTests { get; set; } = new ObservableCollection<DataTest>();
  29. public RelayCommand AddCommand { get; set; }
  30. }
  31. }