I can create an array of buttons in Windows Form but how can i do that in WPF(xaml) ? thanks in advance!
相关问题
- VNC control for WPF application
- WPF Binding from System.Windows.SystemParameters.P
- Xamarin. The name 'authorEntry does not exist
- XAML: Applying styles to nested controls
- How can I add a horizontal line (“goal line”) for
You can't do it directly in XAML (though you can do it in code, in exactly the same way as in Windows Forms). What you can do instead is use data binding and ItemsControl to create the buttons for you. You don't say what you need the control array for, but suppose you want a button for each Person in a collection:
You can actually set up the whole thing in XAML using the ObjectDataProvider and CollectionViewSource, but this should be enough to get you started. And obviously the source can be something other than business data depending on what you need the "array" for.