private void AddRecordInResultGrid(ViewModelVaccine vaccine, Grid unitGrid, int nUnitGridRowTracker) { unitGrid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); var border = new Border() { Background = new SolidColorBrush(vaccine.Color) }; var textBlock = new TextBlock() { Text = vaccine.VaccineName + " " + vaccine.DoseDetail, FontSize= 26, TextWrapping = TextWrapping.Wrap, DataContext = vaccine }; textBlock.Tap += new EventHandler<System.Windows.Input.GestureEventArgs>(textBlock_Tap); border.Child = textBlock; unitGrid.Children.Add(border); Grid.SetRow(border, nUnitGridRowTracker); }
private void AddRecordInResultGrid(ViewModelVaccine vaccine, Grid unitGrid, int nUnitGridRowTracker) { unitGrid.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); var border = new Border() { Background = new SolidColorBrush(vaccine.Color) }; var textBlock = new TextBlock() { Text = vaccine.VaccineName + " " + vaccine.DoseDetail, FontSize = 26, TextWrapping = TextWrapping.Wrap, DataContext = vaccine }; textBlock.Tap += new EventHandler <System.Windows.Input.GestureEventArgs>(textBlock_Tap); border.Child = textBlock; unitGrid.Children.Add(border); Grid.SetRow(border, nUnitGridRowTracker); }