Hello,
I need to control the number of rows in a grid. Without using the MVVM pattern, I achieved this with code-behind, this way :
<UserControl>
<Grid x:Name="PART_Host" />
</UserControl>
private void UpdateHost(int rowCount) {
PART_Host.RowDefinitions.Clear();
PART_Host.Children.Clear();
for (int i = 1; i <= rowCount; i++) {
PART_Host.RowDefinitions.Add(new RowDefinition());
Grid.SetRow(PART_Host.Children[index], i - 1);
}
}
Now, I need to do this using the MVVM pattern. I can access the required rowCount property in my ViewModel, but how can I update the View when this property changes ?
Thanks !