Pass Parameter for Dynamic Buttons - MVVM Light
问题 The following code successfully creates two buttons dynamically, what I can not figure out is how to make the buttons open a different files when clicked. What am I missing? XAML: <ItemsControl ItemsSource="{Binding DataButtons}"> <ItemsControl.ItemTemplate> <DataTemplate> <Button Content="{Binding ButtonName}" Command="{Binding ButtonCommand}" CommandParameter="{Binding FilePath}"/> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> ViewModel: namespace DynamicControlsMvvmLight