コード例 #1
0
 //private void AddRow(object _)    引数を使用しない場合は「_」で書くのがお約束
 private void AddRow()
 {
     GridData.Add(new ProviderDataModel()
     {
         ProviderName = "Name", Edition = EditionType.ORiN2SDK, ReleaseYear = 2021
     });
 }
コード例 #2
0
        /// <summary>
        /// Update gridview when foreign key is selected
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="selectionChangedEventArgs"></param>
        private void RelationshipsListBoxOnSelectionChanged(object sender, SelectionChangedEventArgs selectionChangedEventArgs)
        {
            if (selectionChangedEventArgs.AddedItems.Count == 0)
            {
                GridData.Clear();
                return;
            }

            InfoViewModel = selectionChangedEventArgs.AddedItems[0] as ConnectionInfoViewModel;

            if (InfoViewModel?.RelationshipModel != null)
            {
                GridData.Clear();
                foreach (RowModelPair pair in InfoViewModel.RelationshipModel.Attributes)
                {
                    GridData.Add(pair);
                }
            }
        }
コード例 #3
0
 private void UpdateGeometry()
 {
     GridData.Clear();
     RestraintsCollection.Clear();
     for (int i = 0; i < NumberOfSpans + 1; i++)
     {
         RestraintsCollection.Add(new RestraintsModel()
         {
             Id = i + 1,
             SelectedRestraint = Restraints.Fixed,
         });
     }
     for (int i = 0; i < NumberOfSpans; i++)
     {
         GridData.Add(new GridData()
         {
             Id = i + 1,
             SectionProperties = SectionEditorVM.Sections,
             Span = SpanLength,
             //Restrain = Restraints.Fixed,
             SelectedSection = GeometryEditor.SelectedSection
         });
     }
 }
 public static void InsertGrid(GridDataItem item)
 {
     item.ID = GridData.Max(i => i.ID);
     item.ID++;
     GridData.Add(item);
 }