Skip to content

Commit

Permalink
Add a button to move cells quickly
Browse files Browse the repository at this point in the history
  • Loading branch information
KanaHayama committed Jan 25, 2023
1 parent 3f5f940 commit 27bb1f5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
31 changes: 22 additions & 9 deletions WpfApplication/Pipeline/GridViewCellControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,28 @@
<DockPanel
Margin="3">

<Button
DockPanel.Dock="Top"
Name="ButtonMoveUp"
Height="16"
MaxWidth="64"
VerticalAlignment="Top"
Click="ButtonMove_Click">
</Button>
<Grid
DockPanel.Dock="Top">

<Button
Name="ButtonMoveUp"
Height="16"
MaxWidth="64"
VerticalAlignment="Top"
Click="ButtonMove_Click">
</Button>

<Button
Name="ButtonMoveTopLeftMost"
Width="16"
Height="16"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Click="ButtonMoveTopLeftMost_Click">
</Button>
</Grid>

<Button
DockPanel.Dock="Bottom"
Expand Down
6 changes: 6 additions & 0 deletions WpfApplication/Pipeline/GridViewCellControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ public GridViewCellControl() {
InitializeComponent();
}

private void ButtonMoveTopLeftMost_Click(object sender, RoutedEventArgs e) {
Grid.SetRow(this, 0);
Grid.SetColumn(this, 0);
AdjustGridDefinitions();
}

private void ButtonMove_Click(object sender, RoutedEventArgs e) {
if (sender == ButtonMoveUp) {
var oldRow = Grid.GetRow(this);
Expand Down

0 comments on commit 27bb1f5

Please sign in to comment.