|
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Microsoft.Toolkit.Mvvm.ComponentModel;
- using System.Collections.ObjectModel;
- namespace WPFDemo.Bb
- {
- public class ViewModel : ObservableObject
- {
- public ViewModel()
- {
- for (int i = 0; i < 30; i++)
- {
- class1s.Add(new Class1()
- {
- data1 = new Random().Next(1000, 2000),
- data2 = (byte)new Random().Next(0, 240),
- data3 = Convert.ToBoolean(new Random().Next(0, 1)),
- data4 = new Random().Next(3000, 4000).ToString(),
- data5 = (float)new Random().NextDouble() * 100,
- data6 = (ushort)new Random().Next(5000, 6000)
- });
- }
- }
-
- public ObservableCollection<Class1> class1s { get; set; } = new ObservableCollection<Class1>();
- }
- }
|