2020-07-26 01:59:52 +00:00
|
|
|
<UserControl
|
2019-10-30 19:39:12 +00:00
|
|
|
x:Class="Wabbajack.FilePicker"
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
xmlns:icon="http://metro.mahapps.com/winfx/xaml/iconpacks"
|
|
|
|
xmlns:local="clr-namespace:Wabbajack"
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
d:DesignHeight="35"
|
|
|
|
d:DesignWidth="400"
|
|
|
|
BorderBrush="{StaticResource DarkBackgroundBrush}"
|
|
|
|
mc:Ignorable="d">
|
2020-07-26 01:59:52 +00:00
|
|
|
<Grid>
|
2019-10-30 19:39:12 +00:00
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
<ColumnDefinition Width="*" />
|
2019-11-17 06:34:43 +00:00
|
|
|
<ColumnDefinition Width="36" />
|
2019-10-30 19:39:12 +00:00
|
|
|
</Grid.ColumnDefinitions>
|
2020-07-26 01:59:52 +00:00
|
|
|
<Rectangle Grid.Column="0" Grid.ColumnSpan="2"
|
|
|
|
x:Name="ErrorGlow"
|
|
|
|
Fill="{StaticResource WarningBrush}"
|
|
|
|
Opacity="0.3"
|
|
|
|
Visibility="{Binding PickerVM.InError, Converter={StaticResource bool2VisibilityConverter}, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}">
|
|
|
|
<Rectangle.Effect>
|
|
|
|
<BlurEffect Radius="15" />
|
|
|
|
</Rectangle.Effect>
|
|
|
|
<Rectangle.Style>
|
|
|
|
<Style TargetType="Rectangle">
|
|
|
|
<Style.Triggers>
|
|
|
|
<DataTrigger Binding="{Binding PickerVM.InError, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" Value="True">
|
|
|
|
<DataTrigger.EnterActions>
|
|
|
|
<BeginStoryboard>
|
|
|
|
<Storyboard>
|
|
|
|
<ColorAnimation
|
|
|
|
AutoReverse="True"
|
|
|
|
RepeatBehavior="Forever"
|
|
|
|
Storyboard.TargetProperty="(Rectangle.Fill).(SolidColorBrush.Color)"
|
|
|
|
To="{StaticResource YellowDark}"
|
|
|
|
Duration="0:0:0.8" />
|
|
|
|
</Storyboard>
|
|
|
|
</BeginStoryboard>
|
|
|
|
</DataTrigger.EnterActions>
|
|
|
|
</DataTrigger>
|
|
|
|
</Style.Triggers>
|
|
|
|
</Style>
|
|
|
|
</Rectangle.Style>
|
|
|
|
</Rectangle>
|
2020-07-25 22:15:26 +00:00
|
|
|
<Border Grid.Column="0" Grid.ColumnSpan="2"
|
2019-11-17 06:34:43 +00:00
|
|
|
x:Name="BackgroundCornerFillIn"
|
|
|
|
Margin="0,0,5,0"
|
|
|
|
Background="{StaticResource TextBoxBackground}"
|
|
|
|
CornerRadius="3" />
|
2020-07-25 22:15:26 +00:00
|
|
|
<TextBox Grid.Column="0"
|
2019-11-17 07:28:33 +00:00
|
|
|
Margin="5,1,-2,1"
|
2019-11-02 00:17:23 +00:00
|
|
|
VerticalContentAlignment="Center"
|
2019-10-30 19:39:12 +00:00
|
|
|
Background="{StaticResource DarkBackgroundBrush}"
|
2020-04-01 20:25:22 +00:00
|
|
|
Text="{Binding PickerVM.TargetPath, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Converter={StaticResource AbsolutePathToStringConverter}}"
|
2019-12-15 06:20:28 +00:00
|
|
|
Visibility="{Binding PickerVM.ShowTextBoxInput, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" />
|
2020-07-26 01:59:52 +00:00
|
|
|
<Grid Grid.Column="1"
|
|
|
|
HorizontalAlignment="Right"
|
|
|
|
ClipToBounds="True">
|
2019-11-17 06:34:43 +00:00
|
|
|
<Border
|
|
|
|
Margin="3,1,0,1"
|
|
|
|
HorizontalAlignment="Right"
|
|
|
|
Background="{StaticResource WarningBrush}"
|
|
|
|
CornerRadius="3"
|
2019-12-15 06:20:28 +00:00
|
|
|
ToolTip="{Binding PickerVM.ErrorTooltip, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}">
|
2019-11-17 06:34:43 +00:00
|
|
|
<Border.Style>
|
|
|
|
<Style TargetType="Border">
|
|
|
|
<Setter Property="Width" Value="25" />
|
|
|
|
<Style.Triggers>
|
2019-12-15 06:20:28 +00:00
|
|
|
<DataTrigger Binding="{Binding PickerVM.InError, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" Value="True">
|
2019-11-17 06:34:43 +00:00
|
|
|
<DataTrigger.EnterActions>
|
|
|
|
<BeginStoryboard>
|
|
|
|
<Storyboard>
|
|
|
|
<DoubleAnimation
|
|
|
|
Storyboard.TargetProperty="Width"
|
|
|
|
To="33"
|
|
|
|
Duration="0:0:0.1">
|
|
|
|
<DoubleAnimation.EasingFunction>
|
|
|
|
<ExponentialEase EasingMode="EaseOut" />
|
|
|
|
</DoubleAnimation.EasingFunction>
|
|
|
|
</DoubleAnimation>
|
|
|
|
</Storyboard>
|
|
|
|
</BeginStoryboard>
|
|
|
|
</DataTrigger.EnterActions>
|
|
|
|
<DataTrigger.ExitActions>
|
|
|
|
<BeginStoryboard>
|
|
|
|
<Storyboard>
|
|
|
|
<DoubleAnimation
|
|
|
|
Storyboard.TargetProperty="Width"
|
|
|
|
To="25"
|
|
|
|
Duration="0:0:0.1">
|
|
|
|
<DoubleAnimation.EasingFunction>
|
|
|
|
<ExponentialEase EasingMode="EaseOut" />
|
|
|
|
</DoubleAnimation.EasingFunction>
|
|
|
|
</DoubleAnimation>
|
|
|
|
</Storyboard>
|
|
|
|
</BeginStoryboard>
|
|
|
|
</DataTrigger.ExitActions>
|
|
|
|
</DataTrigger>
|
|
|
|
</Style.Triggers>
|
|
|
|
</Style>
|
|
|
|
</Border.Style>
|
|
|
|
</Border>
|
|
|
|
<Border
|
|
|
|
Width="30"
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
Background="{StaticResource TextBoxBackground}"
|
|
|
|
CornerRadius="3">
|
2019-12-15 06:20:28 +00:00
|
|
|
<Button Command="{Binding PickerVM.SetTargetPathCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" ToolTip="Set target path">
|
2019-11-17 06:34:43 +00:00
|
|
|
<icon:PackIconMaterial
|
|
|
|
Width="16"
|
|
|
|
Height="12"
|
|
|
|
Margin="4"
|
|
|
|
Kind="DotsHorizontal" />
|
|
|
|
</Button>
|
|
|
|
<Border.Effect>
|
|
|
|
<DropShadowEffect
|
|
|
|
BlurRadius="3"
|
|
|
|
Direction="0"
|
|
|
|
Opacity="0.5"
|
|
|
|
ShadowDepth="2" />
|
|
|
|
</Border.Effect>
|
|
|
|
</Border>
|
|
|
|
</Grid>
|
2020-07-26 01:59:52 +00:00
|
|
|
<Border Grid.Column="0" Grid.ColumnSpan="2"
|
|
|
|
x:Name="ErrorBorder"
|
|
|
|
Background="Transparent"
|
|
|
|
BorderBrush="{StaticResource WarningBrush}"
|
|
|
|
BorderThickness="1"
|
|
|
|
CornerRadius="3"
|
|
|
|
IsHitTestVisible="False"
|
|
|
|
Visibility="{Binding PickerVM.InError, Converter={StaticResource bool2VisibilityConverter}, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}">
|
|
|
|
<Border.Style>
|
|
|
|
<Style TargetType="Border">
|
|
|
|
<Style.Triggers>
|
|
|
|
<DataTrigger Binding="{Binding PickerVM.InError, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" Value="True">
|
|
|
|
<DataTrigger.EnterActions>
|
|
|
|
<BeginStoryboard>
|
|
|
|
<Storyboard>
|
|
|
|
<ColorAnimation
|
|
|
|
AutoReverse="True"
|
|
|
|
RepeatBehavior="Forever"
|
|
|
|
Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
|
|
|
|
To="{StaticResource YellowDark}"
|
|
|
|
Duration="0:0:0.8" />
|
|
|
|
</Storyboard>
|
|
|
|
</BeginStoryboard>
|
|
|
|
</DataTrigger.EnterActions>
|
|
|
|
</DataTrigger>
|
|
|
|
</Style.Triggers>
|
|
|
|
</Style>
|
|
|
|
</Border.Style>
|
|
|
|
</Border>
|
2019-10-30 19:39:12 +00:00
|
|
|
</Grid>
|
2019-11-09 20:20:32 +00:00
|
|
|
</UserControl>
|