forked from tillias/wpFolderPicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FolderPickerDialog.xaml
30 lines (30 loc) · 1.91 KB
/
FolderPickerDialog.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<Window x:Class="FolderPickerLib.FolderPickerDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:FolderPickerLib" xmlns:Converters="clr-namespace:FolderPickerLib.Converters"
Title="Select folder" Height="500" Width="500" WindowStartupLocation="CenterScreen">
<Window.Resources>
<Style x:Key="DialogButtonStyle" TargetType="{x:Type Button}">
<Setter Property="Width" Value="75"/>
<Setter Property="Margin" Value="8"/>
</Style>
<Converters:NullToBoolConverter x:Key="NullToBoolConverter"/>
</Window.Resources>
<Grid x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<local:FolderPickerControl x:Name="FolderPickerControl" Grid.Row="0" Margin="8"/>
<DockPanel Grid.Row="1">
<Button x:Name="CreateButton" Content="New folder" Style="{StaticResource DialogButtonStyle}" Click="CreateButton_Click"
IsEnabled="{Binding ElementName=FolderPickerControl,Path=SelectedItem,Converter={StaticResource NullToBoolConverter}}"/>
<Button x:Name="RefreshButton" Content="Refresh" Style="{StaticResource DialogButtonStyle}" Click="RefreshButton_Click"
ToolTip="Refreshes folders tree (including drives)"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" >
<Button x:Name="OkButton" Content="Ok" Style="{StaticResource DialogButtonStyle}" IsDefault="True" Click="OkButton_Click" />
<Button x:Name="CancelButton" Content="Cancel" Style="{StaticResource DialogButtonStyle}" IsCancel="True" Click="CancelButton_Click" />
</StackPanel>
</DockPanel>
</Grid>
</Window>