I've programmatically generated buttons in a UniformGrid i.e. 4 rows and 4 columns, so 16 buttons.
I want to be able to click and drag to create a rectangle box to select a box of buttons.
Is this possible?
Trying to use this example currently but not seeing the drag box appear
Click and drag selection box in WPF
Currently, since it's all programmatic, the UniformGrid code in XAML is this:
<Canvas DockPanel.Dock="Top" Name="buttonCanvas" Width="800" Height="400">
<Rectangle x:Name="selectionBox" Visibility="Collapsed" Stroke="White" StrokeThickness="4" />
<UniformGrid DockPanel.Dock="Top" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" x:Name="uniformGrid" Grid.Row="1" Width="800" Height="400"
Rows="{Binding RowNums}"
Columns="{Binding ColumnNums}" MouseDown="uniformGrid_MouseDown" MouseUp="uniformGrid_MouseUp" MouseMove="uniformGrid_MouseMove" Background="Transparent">
</UniformGrid>
<!-- This canvas contains elements that are to be selected -->
</Canvas>