Inheritance: INotifyPropertyChanged
示例#1
0
        public Vm()
        {
            Data2D = new[,] { { 1, 2 }, { 3, 4 }, { 5, 6 } };
            ColumnHeaders = new[] { "Col1", "Col2" };
            JaggedRows = new int[3][];
            JaggedRows[0] = new[] { 1, 2 };
            JaggedRows[1] = new[] { 3, 4 };
            JaggedRows[2] = new[] { 5, 6 };

            int count = 1;
            ListOfListsOfItems = new List<List<ItemVm>>();
            RowVms = new List<RowVm>();
            AllRowsItems = new List<ItemVm>();
            for (int i = 0; i < 3; i++)
            {
                var row = new List<ItemVm>();
                ListOfListsOfItems.Add(row);

                var rowVm = new RowVm("Row" + i);
                RowVms.Add(rowVm);
                for (int j = 0; j < 2; j++)
                {
                    row.Add(new ItemVm(count));
                    var itemVm = new ItemVm(count);
                    rowVm.Add(itemVm);
                    AllRowsItems.Add(itemVm);
                    count++;
                }
            }

            ColumnItemHeaders = Enumerable.Range(0, 2)
                                          .Select(x => new ItemVm(x))
                                          .ToArray();
            RowHeaders = Enumerable.Range(0, 3).Select(x => "Row" + x).ToArray();
        }
示例#2
0
        public SelectedVm()
        {
            var rowVms = new List<RowVm>();
            int count = 1;

            for (int i = 0; i < 3; i++)
            {
                var rowVm = new RowVm("Row" + i);
                rowVms.Add(rowVm);
                for (int j = 0; j < 2; j++)
                {
                    var itemVm = new ItemVm(count);
                    rowVm.Add(itemVm);
                    count++;
                }
            }

            this.RowVms = rowVms;
            this.AllRowsItems = rowVms.SelectMany(x => x).ToList();
        }
示例#3
0
        public SelectedVm()
        {
            var rowVms = new List <RowVm>();
            int count  = 1;

            for (int i = 0; i < 3; i++)
            {
                var rowVm = new RowVm("Row" + i);
                rowVms.Add(rowVm);
                for (int j = 0; j < 2; j++)
                {
                    var itemVm = new ItemVm(count);
                    rowVm.Add(itemVm);
                    count++;
                }
            }

            this.RowVms       = rowVms;
            this.AllRowsItems = rowVms.SelectMany(x => x).ToList();
        }
 public ObservableVm()
 {
     this.RowHeaders = new ObservableCollection<string>(new[] { "1", "2", "3" });
     this.ColumnHeaders = new ObservableCollection<string>(new[] { "A", "B", "C" });
     this.ListOfListsOfItems = new ObservableCollection<ObservableCollection<ItemVm>>();
     this.ListOfListsOfInts = new ObservableCollection<ObservableCollection<int>>();
     var count = 1;
     for (int i = 0; i < 3; i++)
     {
         var itemRow = new ObservableCollection<ItemVm>();
         var intRow = new ObservableCollection<int>();
         this.ListOfListsOfItems.Add(itemRow);
         this.ListOfListsOfInts.Add(intRow);
         for (int j = 0; j < 2; j++)
         {
             var itemVm = new ItemVm(count);
             itemRow.Add(itemVm);
             intRow.Add(count);
             count++;
         }
     }
 }
示例#5
0
        public Vm()
        {
            Data2D = new[, ] {
                { 1, 2 }, { 3, 4 }, { 5, 6 }
            };
            ColumnHeaders = new[] { "Col1", "Col2" };
            JaggedRows    = new int[3][];
            JaggedRows[0] = new[] { 1, 2 };
            JaggedRows[1] = new[] { 3, 4 };
            JaggedRows[2] = new[] { 5, 6 };

            int count = 1;

            ListOfListsOfItems = new List <List <ItemVm> >();
            RowVms             = new List <RowVm>();
            AllRowsItems       = new List <ItemVm>();
            for (int i = 0; i < 3; i++)
            {
                var row = new List <ItemVm>();
                ListOfListsOfItems.Add(row);

                var rowVm = new RowVm("Row" + i);
                RowVms.Add(rowVm);
                for (int j = 0; j < 2; j++)
                {
                    row.Add(new ItemVm(count));
                    var itemVm = new ItemVm(count);
                    rowVm.Add(itemVm);
                    AllRowsItems.Add(itemVm);
                    count++;
                }
            }

            ColumnItemHeaders = Enumerable.Range(0, 2)
                                .Select(x => new ItemVm(x))
                                .ToArray();
            RowHeaders = Enumerable.Range(0, 3).Select(x => "Row" + x).ToArray();
        }
示例#6
0
        public ObservableVm()
        {
            this.RowHeaders         = new ObservableCollection <string>(new[] { "1", "2", "3" });
            this.ColumnHeaders      = new ObservableCollection <string>(new[] { "A", "B", "C" });
            this.ListOfListsOfItems = new ObservableCollection <ObservableCollection <ItemVm> >();
            this.ListOfListsOfInts  = new ObservableCollection <ObservableCollection <int> >();
            var count = 1;

            for (int i = 0; i < 3; i++)
            {
                var itemRow = new ObservableCollection <ItemVm>();
                var intRow  = new ObservableCollection <int>();
                this.ListOfListsOfItems.Add(itemRow);
                this.ListOfListsOfInts.Add(intRow);
                for (int j = 0; j < 2; j++)
                {
                    var itemVm = new ItemVm(count);
                    itemRow.Add(itemVm);
                    intRow.Add(count);
                    count++;
                }
            }
        }