Skip to content

Commit

Permalink
Add apply and copy buttons to dbstringer
Browse files Browse the repository at this point in the history
  • Loading branch information
nh43de committed Jan 10, 2023
1 parent 9d1e9ca commit 192ed49
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
8 changes: 7 additions & 1 deletion DataToolChain.Ui/DbStringer/DbStringer.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<Grid.RowDefinitions>
<RowDefinition Height="300"/>
<RowDefinition Height="410*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Background="Beige">
<ScrollViewer CanContentScroll="True" >
Expand All @@ -31,11 +32,16 @@
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="424*"/>
</Grid.ColumnDefinitions>
<TextBox AcceptsReturn="True" AcceptsTab="True" TextWrapping="NoWrap" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Text="{Binding Path=InputText, Mode=OneWayToSource, UpdateSourceTrigger=PropertyChanged}"></TextBox>
<TextBox AcceptsReturn="True" AcceptsTab="True" TextWrapping="NoWrap" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Text="{Binding Path=InputText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></TextBox>
<GridSplitter Grid.Column="1" Background="Gray" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"></GridSplitter>
<TextBox Grid.Column="2" TextWrapping="NoWrap" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Text="{Binding Path=OutputText, Mode=OneWay}"></TextBox>
</Grid>

<Grid Grid.Row="2">
<Button Height="32px" Width="60px" Margin="8px" HorizontalAlignment="Left" Click="Apply_Click">Apply</Button>
<Button Height="32px" Width="60px" Margin="8px" HorizontalAlignment="Right" Click="Copy_Click">Copy</Button>
</Grid>

</Grid>


Expand Down
10 changes: 10 additions & 0 deletions DataToolChain.Ui/DbStringer/DbStringer.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,15 @@ private void SelectedRegexChanged(object sender, RoutedEventArgs e)
{
_viewModel.UpdateOutputText();
}

private void Apply_Click(object sender, RoutedEventArgs e)
{
_viewModel.InputText = _viewModel.OutputText;
}

private void Copy_Click(object sender, RoutedEventArgs e)
{
Clipboard.SetText(_viewModel.OutputText);
}
}
}
1 change: 1 addition & 0 deletions DataToolChain.Ui/DbStringer/DbStringerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public string InputText
{
_inputText = value;
UpdateOutputText();
OnPropertyChanged();
}
}

Expand Down

0 comments on commit 192ed49

Please sign in to comment.