2019-11-13 19:26:04 +00:00
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
2019-11-17 01:22:13 +00:00
xmlns:ops="clr-namespace:BFR.Operations;assembly=BFR"
2019-11-13 20:22:36 +00:00
mc:Ignorable="d" MinWidth="720" MinHeight="480"
2019-11-13 19:26:04 +00:00
x:Class="BFR.MainWindow"
Title="BFR">
2019-11-17 15:22:19 +00:00
2019-11-14 16:21:25 +00:00
<Grid RowDefinitions="auto,auto,*" ColumnDefinitions="*,*,*" Classes="StyleBorders">
<!-- Directory Selection + Filters -->
<Border Grid.Row="0" Grid.ColumnSpan="3">
<Grid RowDefinitions="*,auto" ColumnDefinitions="auto,*,auto">
2019-11-24 00:16:34 +00:00
<Expander Grid.Column="0" Name="FilterExpander" Header="Filter" ToolTip.Tip="Various options for filtering the files to be modified."/>
2019-11-14 18:08:21 +00:00
<TextBox Grid.Column="1" IsEnabled="False" Text="{Binding WorkingDirectory}"/>
2019-11-24 00:16:34 +00:00
<Button Grid.Column="2" Content=" ... " Command="{Binding OpenDirectoryButtonClick}" ToolTip.Tip="Loads all files from a specific folder."/>
2019-11-14 16:21:25 +00:00
<!-- Filters -->
<Grid Grid.Row="1" Grid.ColumnSpan="3" ColumnDefinitions="auto,*,auto,*,auto,auto,auto,auto" IsVisible="{Binding #FilterExpander.IsExpanded}">
<TextBlock Grid.Column="0" Text="Extension:"/>
2019-11-24 00:16:34 +00:00
<TextBox Grid.Column="1" Text="{Binding FilterExtension}" PropertyChanged="FilterChanged" ToolTip.Tip="Matches the file extension *exactly*."/>
2019-11-14 16:21:25 +00:00
<TextBlock Grid.Column="2" Text="Name:"/>
2019-11-24 00:16:34 +00:00
<TextBox Grid.Column="3" Text="{Binding FilterPattern}" PropertyChanged="FilterChanged" ToolTip.Tip="Matches against a part of the file name."/>
2019-11-14 16:21:25 +00:00
<TextBlock Grid.Column="4" Text="Full Name:"/>
2019-11-24 00:16:34 +00:00
<CheckBox Grid.Column="5" IsChecked="{Binding FilterFullName}" PropertyChanged="FilterChanged" ToolTip.Tip="Whether to include the file extension."/>
2019-11-14 16:21:25 +00:00
<TextBlock Grid.Column="6" Text="Regex:"/>
2019-11-24 00:16:34 +00:00
<CheckBox Grid.Column="7" IsChecked="{Binding FilterRegex}" PropertyChanged="FilterChanged" Margin="4,4,5,4" ToolTip.Tip="Whether to match using RegEx."/>
2019-11-14 16:21:25 +00:00
</Grid>
</Grid>
</Border>
2019-11-13 20:22:36 +00:00
<!-- ListBox Headers -->
2019-11-13 22:01:08 +00:00
<TextBox Classes="HeaderTextBox" Grid.Row="1" Grid.Column="0" Text="Before"/>
<TextBox Classes="HeaderTextBox" Grid.Row="1" Grid.Column="1" Text="Operations"/>
<TextBox Classes="HeaderTextBox" Grid.Row="1" Grid.Column="2" Text="After"/>
2019-11-13 20:22:36 +00:00
<!-- Current and Preview ListBoxes -->
2019-12-01 13:08:01 +00:00
<ListBox Grid.Row="2" Grid.Column="0" Items="{Binding Files}">
2019-11-14 18:08:21 +00:00
<ListBox.ItemTemplate>
<DataTemplate>
2019-12-01 13:08:01 +00:00
<TextBlock Text="{Binding OldFullName}" ToolTip.Tip="{Binding OldPath}" Background="Transparent"/>
2019-11-14 18:08:21 +00:00
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
2019-12-01 13:08:01 +00:00
<ListBox Grid.Row="2" Grid.Column="2" Items="{Binding Files}">
2019-11-14 18:08:21 +00:00
<ListBox.ItemTemplate>
<DataTemplate>
2019-12-01 13:08:01 +00:00
<TextBlock Text="{Binding FullName}" ToolTip.Tip="{Binding Path}" Background="Transparent"/>
2019-11-14 18:08:21 +00:00
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
2019-11-13 20:22:36 +00:00
<!-- Middle Section (Operations, Controls) -->
2019-11-14 16:21:25 +00:00
<Grid Grid.Row="2" Grid.Column="1" RowDefinitions="*,auto,auto" Classes="StyleBorders">
2019-11-13 20:22:36 +00:00
<!-- Operations ListBox -->
2019-11-17 01:22:13 +00:00
<ListBox Grid.Row="0" Items="{Binding Operations}" Name="OperationsListBox" SelectedIndex="{Binding SelectedOperation}"/>
2019-11-13 20:22:36 +00:00
2019-12-01 13:08:01 +00:00
<!-- Add Operation -->
2019-11-13 22:01:08 +00:00
<Border Grid.Row="1" Classes="ConnectUp">
2019-12-01 13:08:01 +00:00
<Grid ColumnDefinitions="*,auto">
<ComboBox Grid.Column="0" Items="{Binding OperationTypes}" SelectedIndex="{Binding SelectedOperationType}" ToolTip.Tip="The type of the operation to add."/>
<Button Grid.Column="1" Content="Add" Command="{Binding AddOperation}" ToolTip.Tip="Adds a new operation after the one selected (or at the end)."/>
2019-11-13 22:01:08 +00:00
</Grid>
</Border>
2019-11-13 20:22:36 +00:00
<!-- Commit and Undo Buttons -->
2019-11-13 22:01:08 +00:00
<Border Grid.Row="2" Classes="ConnectUp">
<Grid ColumnDefinitions="*,*">
2019-11-24 00:16:34 +00:00
<Button Grid.Column="0" Content="Undo" Command="{Binding Undo}" IsEnabled="{Binding !!UndoCount}" ToolTip.Tip="Undoes the last operation. Works multiple times."/>
<Button Grid.Column="1" Content="Rename All" Command="{Binding Commit}" IsEnabled="{Binding IsCommitButtonEnabled}" ToolTip.Tip="Renames all the files according to the preview. This button is disabled if the preview is invalid."/>
2019-11-13 22:01:08 +00:00
</Grid>
</Border>
2019-11-13 20:22:36 +00:00
</Grid>
</Grid>
2019-11-13 22:01:08 +00:00
<Window.Styles>
2019-11-17 01:22:13 +00:00
<!-- General Styling-->
2019-11-14 16:21:25 +00:00
<Style Selector="Grid > Expander">
<Setter Property="Margin" Value="4"/>
</Style>
2019-11-13 22:01:08 +00:00
<Style Selector="Grid > ListBox">
<Setter Property="Margin" Value="4"/>
</Style>
<Style Selector="Grid > TextBox">
<Setter Property="Margin" Value="4"/>
<Setter Property="Grid.Column" Value="1"/>
</Style>
<Style Selector="Grid > Button">
<Setter Property="Margin" Value="4"/>
<Setter Property="Grid.Column" Value="1"/>
</Style>
<Style Selector="Grid > ButtonSpinner">
<Setter Property="Margin" Value="4"/>
<Setter Property="Grid.Column" Value="1"/>
</Style>
<Style Selector="Grid > ComboBox">
<Setter Property="Margin" Value="4"/>
<Setter Property="Grid.Column" Value="1"/>
</Style>
2019-11-17 15:22:19 +00:00
<Style Selector="Grid > NumericUpDown">
<Setter Property="Margin" Value="4"/>
<Setter Property="Grid.Column" Value="1"/>
</Style>
2019-11-14 16:21:25 +00:00
<Style Selector="Grid > CheckBox">
<Setter Property="Margin" Value="4"/>
<Setter Property="Grid.Column" Value="1"/>
</Style>
2019-11-13 22:01:08 +00:00
<Style Selector="Grid > TextBlock">
<Setter Property="Margin" Value="8"/>
<Setter Property="Grid.Column" Value="0"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style Selector="Grid > TextBox.HeaderTextBox">
<Setter Property="Margin" Value="4,4,4,-5"/>
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="FontWeight" Value="Bold"/>
</Style>
2019-11-14 16:21:25 +00:00
<Style Selector="Grid.StyleBorders > Border">
2019-11-13 22:01:08 +00:00
<Setter Property="Margin" Value="4"/>
<Setter Property="Padding" Value="4"/>
<Setter Property="BorderBrush" Value="Gray"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
2019-11-14 16:21:25 +00:00
<Style Selector="Border.ConnectUp">
2019-11-13 22:01:08 +00:00
<Setter Property="Margin" Value="4,-5,4,4"/>
</Style>
2019-12-01 13:08:01 +00:00
<!-- Expander Fix -->
<Style Selector="Expander /template/ ToggleButton#PART_toggle /template/ Border">
<Setter Property="Background" Value="Transparent"/>
</Style>
2019-11-17 01:22:13 +00:00
2019-12-01 13:08:01 +00:00
<!-- List Destyling -->
<Style Selector="ListBoxItem:not(:pointerover):selected /template/ ContentPresenter">
<Setter Property="Background" Value="Transparent"/>
</Style>
<Style Selector="ListBoxItem:pointerover:selected /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ThemeControlHighlightMidBrush}"/>
</Style>
<!-- Operation Control (Wrapper) -->
<Style Selector="ContentControl.OperationControl">
<Setter Property="Template">
<ControlTemplate>
<Grid ColumnDefinitions="*,auto,auto,auto" RowDefinitions="auto,auto" Name="OperationGrid" Margin="0" Background="Transparent">
<Expander Grid.Column="0" Name="OperationExpander" Margin="0">
<Expander.Header>
<CheckBox Margin="0" Content="{Binding Name}" IsChecked="{Binding IsEnabled}" PropertyChanged="PreviewChanged"/>
</Expander.Header>
</Expander>
<Grid Grid.Column="1" ToolTip.Tip="{Binding Error}" IsVisible="{Binding !!Error.Length}" Background="Transparent">
2019-11-17 01:22:13 +00:00
<Ellipse Width="18" Height="18" Margin="0" Stroke="DarkRed" StrokeThickness="2"/>
<TextBlock Width="18" Height="18" Margin="0" Foreground="DarkRed" Text="!" FontWeight="Black" TextAlignment="Center"/>
</Grid>
2019-12-01 13:08:01 +00:00
<Button Grid.Column="2" Background="Transparent" VerticalAlignment="Center" BorderBrush="Transparent" IsVisible="{Binding $parent.IsPointerOver}" ToolTip.Tip="Click to delete this operation." Padding="0">
<Button.Content>
<Grid Width="16" Height="16" Background="Transparent" PointerReleased="DeleteOperation">
<Path Data="M0,0 L8,8 M0,8 L8,0" Stroke="Black" StrokeThickness="2" Height="8" HorizontalAlignment="Center"/>
</Grid>
</Button.Content>
</Button>
<Grid Grid.Column="3" Background="Transparent" Cursor="SizeAll" IsVisible="{Binding $parent.IsPointerOver}" ToolTip.Tip="Click and drag to move this operation." PointerPressed="StartMoveOperation" PointerReleased="EndMoveOperation">
<Path Data="M0,0 L12,0 M0,4 L12,4 M0,8 L12,8" Height="8" VerticalAlignment="Center" Margin="4" Stroke="Black" StrokeThickness="2"/>
</Grid>
<ContentPresenter Grid.ColumnSpan="4" Grid.Row="1" Content="{TemplateBinding Content}" IsVisible="{Binding #OperationExpander.IsExpanded}"/>
2019-11-17 01:22:13 +00:00
</Grid>
2019-12-01 13:08:01 +00:00
</ControlTemplate>
2019-11-17 01:22:13 +00:00
</Setter>
</Style>
2019-11-13 22:01:08 +00:00
</Window.Styles>
2019-11-17 01:22:13 +00:00
<Window.DataTemplates>
<!-- Operation Type (For the selector) -->
<DataTemplate DataType="{x:Type ops:OperationType}">
2019-11-24 00:16:34 +00:00
<TextBlock Text="{Binding Name}" ToolTip.Tip="{Binding Description}"/>
2019-11-17 01:22:13 +00:00
</DataTemplate>
<!-- Operations -->
<DataTemplate DataType="{x:Type ops:Overwrite}">
2019-12-01 13:08:01 +00:00
<ContentControl Classes="OperationControl">
2019-11-17 01:22:13 +00:00
<Grid ColumnDefinitions="auto,*" RowDefinitions="*,*">
<TextBlock Grid.Row="0" Text="Replacement:"/>
2019-11-24 00:16:34 +00:00
<TextBox Grid.Row="0" Text="{Binding Replacement}" PropertyChanged="PreviewChanged" ToolTip.Tip="The text to overwrite the entire file name with."/>
2019-11-17 01:22:13 +00:00
<TextBlock Grid.Row="1" Text="Full Name:"/>
2019-11-24 00:16:34 +00:00
<CheckBox Grid.Row="1" IsChecked="{Binding FullName}" PropertyChanged="PreviewChanged" ToolTip.Tip="Whether to overwrite the file extension as well."/>
2019-11-17 15:22:19 +00:00
</Grid>
2019-12-01 13:08:01 +00:00
</ContentControl>
2019-11-17 15:22:19 +00:00
</DataTemplate>
2019-11-17 15:27:40 +00:00
<DataTemplate DataType="{x:Type ops:Remove}">
2019-12-01 13:08:01 +00:00
<ContentControl Classes="OperationControl">
2019-11-17 15:27:40 +00:00
<Grid ColumnDefinitions="auto,*" RowDefinitions="auto,auto,auto,auto,auto,auto,auto,auto,auto,auto,auto">
<TextBlock Grid.Row="0" Text="Mode:"/>
2019-11-24 00:16:34 +00:00
<ComboBox Grid.Row="0" Items="{Binding Modes}" Name="ModeSelector" SelectedIndex="{Binding Mode}" PropertyChanged="PreviewChanged" ToolTip.Tip="How to select the parts removed.">
2019-11-17 15:27:40 +00:00
<ComboBox.ItemTemplate>
<DataTemplate>
2019-11-24 00:16:34 +00:00
<TextBlock Text="{Binding Name}" ToolTip.Tip="{Binding Description}"/>
2019-11-17 15:27:40 +00:00
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
2019-11-21 18:07:46 +00:00
<TextBlock Grid.Row="1" Text="Pattern:" IsVisible="{Binding #ModeSelector.SelectedItem.IsPattern}"/>
2019-11-24 00:16:34 +00:00
<TextBox Grid.Row="1" Text="{Binding Pattern}" IsVisible="{Binding #ModeSelector.SelectedItem.IsPattern}" PropertyChanged="PreviewChanged" ToolTip.Tip="The pattern to remove."/>
2019-11-21 18:07:46 +00:00
<TextBlock Grid.Row="2" Text="Characters:" IsVisible="{Binding #ModeSelector.SelectedItem.IsCharacters}"/>
2019-11-24 00:16:34 +00:00
<TextBox Grid.Row="2" Text="{Binding Characters}" IsVisible="{Binding #ModeSelector.SelectedItem.IsCharacters}" PropertyChanged="PreviewChanged" ToolTip.Tip="All the characters to remove."/>
2019-11-21 18:07:46 +00:00
<TextBlock Grid.Row="3" Text="From N:" IsVisible="{Binding #ModeSelector.SelectedItem.IsFromNToN}"/>
2019-11-24 00:16:34 +00:00
<NumericUpDown Grid.Row="3" Value="{Binding FromN}" IsVisible="{Binding #ModeSelector.SelectedItem.IsFromNToN}" PropertyChanged="PreviewChanged" ToolTip.Tip="Zero-based start index for the part to remove."/>
2019-11-21 18:07:46 +00:00
<TextBlock Grid.Row="4" Text="To N:" IsVisible="{Binding #ModeSelector.SelectedItem.IsFromNToN}"/>
2019-11-24 00:16:34 +00:00
<NumericUpDown Grid.Row="4" Value="{Binding ToN}" IsVisible="{Binding #ModeSelector.SelectedItem.IsFromNToN}" PropertyChanged="PreviewChanged" ToolTip.Tip="Zero-based end index for the part to remove."/>
2019-11-21 18:07:46 +00:00
<TextBlock Grid.Row="5" Text="First N:" IsVisible="{Binding #ModeSelector.SelectedItem.IsFirstN}"/>
2019-11-24 00:16:34 +00:00
<NumericUpDown Grid.Row="5" Value="{Binding FirstN}" IsVisible="{Binding #ModeSelector.SelectedItem.IsFirstN}" PropertyChanged="PreviewChanged" ToolTip.Tip="The number of characters to remove at the start of the file name."/>
2019-11-21 18:07:46 +00:00
<TextBlock Grid.Row="6" Text="Last N:" IsVisible="{Binding #ModeSelector.SelectedItem.IsLastN}"/>
2019-11-24 00:16:34 +00:00
<NumericUpDown Grid.Row="6" Value="{Binding LastN}" IsVisible="{Binding #ModeSelector.SelectedItem.IsLastN}" PropertyChanged="PreviewChanged" ToolTip.Tip="The number of characters to remove at the end of the file name."/>
2019-11-21 18:07:46 +00:00
<TextBlock Grid.Row="8" Text="Regex:" IsVisible="{Binding #ModeSelector.SelectedItem.IsPattern}"/>
2019-11-24 00:16:34 +00:00
<CheckBox Grid.Row="8" IsChecked="{Binding UseRegex}" IsVisible="{Binding #ModeSelector.SelectedItem.IsPattern}" PropertyChanged="PreviewChanged" ToolTip.Tip="Whether to match using RegEx."/>
2019-11-17 15:27:40 +00:00
<TextBlock Grid.Row="10" Text="Full Name:"/>
2019-11-24 00:16:34 +00:00
<CheckBox Grid.Row="10" IsChecked="{Binding FullName}" PropertyChanged="PreviewChanged" ToolTip.Tip="Whether to consider the file extension as well."/>
2019-11-17 15:27:40 +00:00
</Grid>
2019-12-01 13:08:01 +00:00
</ContentControl>
2019-11-17 15:27:40 +00:00
</DataTemplate>
2019-11-17 15:22:19 +00:00
<DataTemplate DataType="{x:Type ops:Replace}">
2019-12-01 13:08:01 +00:00
<ContentControl Classes="OperationControl">
2019-11-17 15:22:19 +00:00
<Grid ColumnDefinitions="auto,*" RowDefinitions="auto,auto,auto,auto,auto,auto,auto,auto,auto,auto,auto">
<TextBlock Grid.Row="0" Text="Mode:"/>
2019-11-24 00:16:34 +00:00
<ComboBox Grid.Row="0" Items="{Binding Modes}" Name="ModeSelector" SelectedIndex="{Binding Mode}" PropertyChanged="PreviewChanged" ToolTip.Tip="How to select the parts replaced.">
2019-11-17 15:22:19 +00:00
<ComboBox.ItemTemplate>
<DataTemplate>
2019-11-24 00:16:34 +00:00
<TextBlock Text="{Binding Name}" ToolTip.Tip="{Binding Description}"/>
2019-11-17 15:22:19 +00:00
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
2019-11-21 18:07:46 +00:00
<TextBlock Grid.Row="1" Text="Pattern:" IsVisible="{Binding #ModeSelector.SelectedItem.IsPattern}"/>
2019-11-24 00:16:34 +00:00
<TextBox Grid.Row="1" Text="{Binding Pattern}" IsVisible="{Binding #ModeSelector.SelectedItem.IsPattern}" PropertyChanged="PreviewChanged" ToolTip.Tip="The pattern to replace."/>
2019-11-21 18:07:46 +00:00
<TextBlock Grid.Row="2" Text="Characters:" IsVisible="{Binding #ModeSelector.SelectedItem.IsCharacters}"/>
2019-11-24 00:16:34 +00:00
<TextBox Grid.Row="2" Text="{Binding Characters}" IsVisible="{Binding #ModeSelector.SelectedItem.IsCharacters}" PropertyChanged="PreviewChanged" ToolTip.Tip="All the characters to replace."/>
2019-11-21 18:07:46 +00:00
<TextBlock Grid.Row="3" Text="From N:" IsVisible="{Binding #ModeSelector.SelectedItem.IsFromNToN}"/>
2019-11-24 00:16:34 +00:00
<NumericUpDown Grid.Row="3" Value="{Binding FromN}" IsVisible="{Binding #ModeSelector.SelectedItem.IsFromNToN}" PropertyChanged="PreviewChanged" ToolTip.Tip="Zero-based start index for the part to replace."/>
2019-11-21 18:07:46 +00:00
<TextBlock Grid.Row="4" Text="To N:" IsVisible="{Binding #ModeSelector.SelectedItem.IsFromNToN}"/>
2019-11-24 00:16:34 +00:00
<NumericUpDown Grid.Row="4" Value="{Binding ToN}" IsVisible="{Binding #ModeSelector.SelectedItem.IsFromNToN}" PropertyChanged="PreviewChanged" ToolTip.Tip="Zero-based end index for the part to replace."/>
2019-11-21 18:07:46 +00:00
<TextBlock Grid.Row="5" Text="First N:" IsVisible="{Binding #ModeSelector.SelectedItem.IsFirstN}"/>
2019-11-24 00:16:34 +00:00
<NumericUpDown Grid.Row="5" Value="{Binding FirstN}" IsVisible="{Binding #ModeSelector.SelectedItem.IsFirstN}" PropertyChanged="PreviewChanged" ToolTip.Tip="The number of characters to replace at the start of the file name."/>
2019-11-21 18:07:46 +00:00
<TextBlock Grid.Row="6" Text="Last N:" IsVisible="{Binding #ModeSelector.SelectedItem.IsLastN}"/>
2019-11-24 00:16:34 +00:00
<NumericUpDown Grid.Row="6" Value="{Binding LastN}" IsVisible="{Binding #ModeSelector.SelectedItem.IsLastN}" PropertyChanged="PreviewChanged" ToolTip.Tip="The number of characters to replace at the end of the file name."/>
2019-11-17 15:22:19 +00:00
<TextBlock Grid.Row="7" Text="Replacement:"/>
2019-11-24 00:16:34 +00:00
<TextBox Grid.Row="7" Text="{Binding Replacement}" PropertyChanged="PreviewChanged" ToolTip.Tip="The replacement to insert at the matched position/-s."/>
2019-11-21 18:07:46 +00:00
<TextBlock Grid.Row="8" Text="Regex:" IsVisible="{Binding #ModeSelector.SelectedItem.IsPattern}"/>
2019-11-24 00:16:34 +00:00
<CheckBox Grid.Row="8" IsChecked="{Binding UseRegex}" IsVisible="{Binding #ModeSelector.SelectedItem.IsPattern}" PropertyChanged="PreviewChanged" ToolTip.Tip="Whether to match using RegEx."/>
2019-11-21 18:07:46 +00:00
<TextBlock Grid.Row="9" Text="Replace Regex:" IsVisible="{Binding #ModeSelector.SelectedItem.IsPattern}"/>
2019-11-24 00:16:34 +00:00
<CheckBox Grid.Row="9" IsChecked="{Binding UseRegexReplace}" IsVisible="{Binding #ModeSelector.SelectedItem.IsPattern}" PropertyChanged="PreviewChanged" ToolTip.Tip="Whether to consider Replacement as a RegEx replacement string ($)."/>
2019-11-17 15:22:19 +00:00
<TextBlock Grid.Row="10" Text="Full Name:"/>
2019-11-24 00:16:34 +00:00
<CheckBox Grid.Row="10" IsChecked="{Binding FullName}" PropertyChanged="PreviewChanged" ToolTip.Tip="Whether to consider the file extension as well."/>
2019-11-17 01:22:13 +00:00
</Grid>
2019-12-01 13:08:01 +00:00
</ContentControl>
2019-11-17 01:22:13 +00:00
</DataTemplate>
2019-11-21 18:46:33 +00:00
<DataTemplate DataType="{x:Type ops:Number}">
2019-12-01 13:08:01 +00:00
<ContentControl Classes="OperationControl">
2019-11-21 18:46:33 +00:00
<Grid ColumnDefinitions="auto,*" RowDefinitions="auto,auto,auto,auto,auto,auto,auto,auto,auto">
<TextBlock Grid.Row="0" Text="Mode:"/>
2019-11-24 00:16:34 +00:00
<ComboBox Grid.Row="0" Items="{Binding Modes}" Name="ModeSelector" SelectedIndex="{Binding Mode}" PropertyChanged="PreviewChanged" ToolTip.Tip="Where to insert the numbering.">
2019-11-21 18:46:33 +00:00
<ComboBox.ItemTemplate>
<DataTemplate>
2019-11-24 00:16:34 +00:00
<TextBlock Text="{Binding Name}" ToolTip.Tip="{Binding Description}"/>
2019-11-21 18:46:33 +00:00
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Grid.Row="1" Text="Pattern:" IsVisible="{Binding #ModeSelector.SelectedItem.IsReplace}"/>
2019-11-24 00:16:34 +00:00
<TextBox Grid.Row="1" Text="{Binding Pattern}" IsVisible="{Binding #ModeSelector.SelectedItem.IsReplace}" PropertyChanged="PreviewChanged" ToolTip.Tip="The pattern to replace with the numbering."/>
2019-11-21 18:46:33 +00:00
<TextBlock Grid.Row="2" Text="Position:" IsVisible="{Binding #ModeSelector.SelectedItem.IsInsert}"/>
2019-11-24 00:16:34 +00:00
<NumericUpDown Grid.Row="2" Value="{Binding InsertPosition}" IsVisible="{Binding #ModeSelector.SelectedItem.IsInsert}" PropertyChanged="PreviewChanged" ToolTip.Tip="The zero-based index where to insert the numbering."/>
2019-11-21 18:46:33 +00:00
<TextBlock Grid.Row="3" Text="Start Index:"/>
2019-11-24 00:16:34 +00:00
<NumericUpDown Grid.Row="3" Value="{Binding StartIndex}" PropertyChanged="PreviewChanged" ToolTip.Tip="The number of the first file name."/>
2019-11-21 18:46:33 +00:00
<TextBlock Grid.Row="4" Text="Increment:"/>
2019-11-24 00:16:34 +00:00
<NumericUpDown Grid.Row="4" Value="{Binding Increment}" PropertyChanged="PreviewChanged" ToolTip.Tip="The increment to each successive file name (can be negative)."/>
2019-11-21 18:46:33 +00:00
<TextBlock Grid.Row="5" Text="Padding:"/>
2019-11-24 00:16:34 +00:00
<NumericUpDown Grid.Row="5" Value="{Binding Padding}" PropertyChanged="PreviewChanged" ToolTip.Tip="The minimum number of digits for each number (pads with 0s)."/>
2019-11-21 18:46:33 +00:00
<TextBlock Grid.Row="6" Text="Auto Padding:"/>
2019-11-24 00:16:34 +00:00
<CheckBox Grid.Row="6" IsChecked="{Binding AutoPadding}" PropertyChanged="PreviewChanged" ToolTip.Tip="Whether to automatically apply padding based on the highest number."/>
2019-11-21 18:46:33 +00:00
<TextBlock Grid.Row="7" Text="Regex:" IsVisible="{Binding #ModeSelector.SelectedItem.IsReplace}"/>
2019-11-24 00:16:34 +00:00
<CheckBox Grid.Row="7" IsChecked="{Binding UseRegex}" IsVisible="{Binding #ModeSelector.SelectedItem.IsReplace}" PropertyChanged="PreviewChanged" ToolTip.Tip="Whether to match using RegEx."/>
<TextBlock Grid.Row="8" Text="Full Name:"/>
<CheckBox Grid.Row="8" IsChecked="{Binding FullName}" PropertyChanged="PreviewChanged" ToolTip.Tip="Whether to consider the file extension as well."/>
2019-11-21 18:46:33 +00:00
</Grid>
2019-12-01 13:08:01 +00:00
</ContentControl>
2019-11-21 18:46:33 +00:00
</DataTemplate>
2019-11-22 18:34:21 +00:00
<DataTemplate DataType="{x:Type ops:Add}">
2019-12-01 13:08:01 +00:00
<ContentControl Classes="OperationControl">
2019-11-22 18:34:21 +00:00
<Grid ColumnDefinitions="auto,*" RowDefinitions="auto,auto,auto,auto">
<TextBlock Grid.Row="0" Text="Mode:"/>
2019-11-24 00:16:34 +00:00
<ComboBox Grid.Row="0" Items="{Binding Modes}" Name="ModeSelector" SelectedIndex="{Binding Mode}" PropertyChanged="PreviewChanged" ToolTip.Tip="Where to add the new text.">
2019-11-22 18:34:21 +00:00
<ComboBox.ItemTemplate>
<DataTemplate>
2019-11-24 00:16:34 +00:00
<TextBlock Text="{Binding Name}" ToolTip.Tip="{Binding Description}"/>
2019-11-22 18:34:21 +00:00
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Grid.Row="1" Text="Position:" IsVisible="{Binding #ModeSelector.SelectedItem.IsInsert}"/>
2019-11-24 00:16:34 +00:00
<NumericUpDown Grid.Row="1" Value="{Binding InsertPosition}" IsVisible="{Binding #ModeSelector.SelectedItem.IsInsert}" PropertyChanged="PreviewChanged" ToolTip.Tip="The zero-based index at which to insert the new text."/>
2019-11-22 18:34:21 +00:00
<TextBlock Grid.Row="2" Text="Text:"/>
2019-11-24 00:16:34 +00:00
<TextBox Grid.Row="2" Text="{Binding Text}" PropertyChanged="PreviewChanged" ToolTip.Tip="The text to add to the file name."/>
2019-11-22 18:34:21 +00:00
<TextBlock Grid.Row="3" Text="Full Name:"/>
2019-11-24 00:16:34 +00:00
<CheckBox Grid.Row="3" IsChecked="{Binding FullName}" PropertyChanged="PreviewChanged" ToolTip.Tip="Whether to consider the file extension as well."/>
2019-11-22 18:34:21 +00:00
</Grid>
2019-12-01 13:08:01 +00:00
</ContentControl>
2019-11-22 18:34:21 +00:00
</DataTemplate>
2019-11-23 17:32:10 +00:00
<DataTemplate DataType="{x:Type ops:Sort}">
2019-12-01 13:08:01 +00:00
<ContentControl Classes="OperationControl">
2019-11-23 17:32:10 +00:00
<Grid ColumnDefinitions="auto,*" RowDefinitions="auto,auto,auto">
<TextBlock Grid.Row="0" Text="Mode:"/>
2019-11-24 00:16:34 +00:00
<ComboBox Grid.Row="0" Items="{Binding Modes}" Name="ModeSelector" SelectedIndex="{Binding Mode}" PropertyChanged="PreviewChanged" ToolTip.Tip="The method that is used to compare and sort the file names.">
2019-11-23 17:32:10 +00:00
<ComboBox.ItemTemplate>
<DataTemplate>
2019-11-24 00:16:34 +00:00
<TextBlock Text="{Binding Name}" ToolTip.Tip="{Binding Description}"/>
2019-11-23 17:32:10 +00:00
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Grid.Row="1" Text="Direction:" IsVisible="{Binding !#ModeSelector.SelectedItem.IsReverse}"/>
2019-11-24 00:16:34 +00:00
<ComboBox Grid.Row="1" Items="{Binding Directions}" SelectedIndex="{Binding Direction}" IsVisible="{Binding !#ModeSelector.SelectedItem.IsReverse}" PropertyChanged="PreviewChanged" ToolTip.Tip="Whether to sort in ascending or descending order."/>
2019-11-23 17:32:10 +00:00
<TextBlock Grid.Row="2" Text="Full Name:" IsVisible="{Binding !#ModeSelector.SelectedItem.IsReverse}"/>
2019-11-24 00:16:34 +00:00
<CheckBox Grid.Row="2" IsChecked="{Binding FullName}" IsVisible="{Binding !#ModeSelector.SelectedItem.IsReverse}" PropertyChanged="PreviewChanged" ToolTip.Tip="Whether to consider the file extension as well."/>
2019-11-23 17:32:10 +00:00
</Grid>
2019-12-01 13:08:01 +00:00
</ContentControl>
2019-11-23 17:32:10 +00:00
</DataTemplate>
2019-11-17 01:22:13 +00:00
</Window.DataTemplates>
2019-11-13 19:26:04 +00:00
</Window>