bind destination to ExtractDialog.Destination property.

This commit is contained in:
morkt 2014-07-30 01:12:46 +04:00
parent 9d218a4130
commit bbcc92acb8
5 changed files with 8 additions and 5 deletions

View File

@ -13,7 +13,8 @@
<RowDefinition Height="41*"/> <RowDefinition Height="41*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock x:Name="ExtractLabel" Text="{x:Static s:guiStrings.LabelExtractAllTo}" Margin="10,10,10,0" VerticalAlignment="Top" Height="15"/> <TextBlock x:Name="ExtractLabel" Text="{x:Static s:guiStrings.LabelExtractAllTo}" Margin="10,10,10,0" VerticalAlignment="Top" Height="15"/>
<local:ExtAutoCompleteBox x:Name="DestinationDir" Margin="10,0,41,9" VerticalAlignment="Bottom"/> <local:ExtAutoCompleteBox x:Name="DestinationDir" Margin="10,0,41,9" VerticalAlignment="Bottom"
Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ExtractDialog}}, Path=Destination, Mode=TwoWay}"/>
<Button Margin="0,0,10,9" VerticalAlignment="Bottom" HorizontalAlignment="Right" <Button Margin="0,0,10,9" VerticalAlignment="Bottom" HorizontalAlignment="Right"
Command="{x:Static local:Commands.Browse}"> Command="{x:Static local:Commands.Browse}">
<Image Source="{StaticResource IconSearch}" Stretch="Uniform" UseLayoutRounding="True" SnapsToDevicePixels="True" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center"/> <Image Source="{StaticResource IconSearch}" Stretch="Uniform" UseLayoutRounding="True" SnapsToDevicePixels="True" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>

View File

@ -46,7 +46,7 @@ namespace GARbro.GUI
{ {
InitializeComponent(); InitializeComponent();
ExtractLabel.Text = string.Format (guiStrings.LabelExtractAllTo, filename); ExtractLabel.Text = string.Format (guiStrings.LabelExtractAllTo, filename);
DestinationDir.Text = destination; Destination = destination;
ExtractImages.IsChecked = Settings.Default.appExtractImages; ExtractImages.IsChecked = Settings.Default.appExtractImages;
ExtractText.IsChecked = Settings.Default.appExtractText; ExtractText.IsChecked = Settings.Default.appExtractText;

View File

@ -39,6 +39,8 @@ namespace GARbro.GUI
{ {
public partial class ExtractDialog : Window public partial class ExtractDialog : Window
{ {
public string Destination { get; set; }
public void InitImageFormats (ComboBox image_format) public void InitImageFormats (ComboBox image_format)
{ {
var default_format = Settings.Default.appImageFormat; var default_format = Settings.Default.appImageFormat;

View File

@ -11,8 +11,8 @@
<RowDefinition/> <RowDefinition/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock x:Name="ExtractLabel" Text="{x:Static s:guiStrings.LabelExtractFileTo}" Margin="10,10,9.157,0" VerticalAlignment="Top" Height="15"/> <TextBlock x:Name="ExtractLabel" Text="{x:Static s:guiStrings.LabelExtractFileTo}" Margin="10,10,9.157,0" VerticalAlignment="Top" Height="15"/>
<local:ExtAutoCompleteBox x:Name="DestinationDir" Margin="10,28,0,0" <local:ExtAutoCompleteBox x:Name="DestinationDir" Margin="10,28,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="337"
VerticalAlignment="Top" HorizontalAlignment="Left" Width="337"/> Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ExtractDialog}}, Path=Destination, Mode=TwoWay}"/>
<Button Margin="0,28,10,0" VerticalAlignment="Top" HorizontalAlignment="Right" <Button Margin="0,28,10,0" VerticalAlignment="Top" HorizontalAlignment="Right"
Command="{x:Static local:Commands.Browse}"> Command="{x:Static local:Commands.Browse}">
<Image Source="{StaticResource IconSearch}" Stretch="Uniform" UseLayoutRounding="True" SnapsToDevicePixels="True" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center"/> <Image Source="{StaticResource IconSearch}" Stretch="Uniform" UseLayoutRounding="True" SnapsToDevicePixels="True" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center"/>

View File

@ -44,7 +44,7 @@ namespace GARbro.GUI
{ {
InitializeComponent(); InitializeComponent();
ExtractLabel.Text = string.Format (guiStrings.LabelExtractFileTo, entry.Name); ExtractLabel.Text = string.Format (guiStrings.LabelExtractFileTo, entry.Name);
DestinationDir.Text = destination; Destination = destination;
if ("image" == entry.Type) if ("image" == entry.Type)
{ {
ImageConversionOptions.Visibility = Visibility.Visible; ImageConversionOptions.Visibility = Visibility.Visible;