Skip to content

Commit 672ae5d

Browse files
committed
Move TextBoxErrorStyle to DefaultStyle.xaml
Also moves the error icon and reuses it in the rename and folder related dialogs.
1 parent ea22e58 commit 672ae5d

File tree

5 files changed

+30
-36
lines changed

5 files changed

+30
-36
lines changed

Rubberduck.Core/UI/Refactorings/AnnotateDeclaration/AnnotateDeclarationView.xaml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6-
xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
76
xmlns:converters="clr-namespace:Rubberduck.UI.Converters"
87
xmlns:local="clr-namespace:Rubberduck.UI.Refactorings.AnnotateDeclaration"
98
xmlns:annotations="clr-namespace:Rubberduck.Parsing.Annotations;assembly=Rubberduck.Parsing"
@@ -20,32 +19,6 @@
2019
<converters:DeclarationToQualifiedNameConverter x:Key="DeclarationToQualifiedNameConverter"/>
2120
<converters:AnnotationToCodeStringConverter x:Key="AnnotationToCodeStringConverter"/>
2221

23-
<BitmapImage x:Key="InvalidTextImage" UriSource="pack://application:,,,/Rubberduck.Resources;component/Icons/Fugue/cross-circle.png" />
24-
<Style x:Key="TextBoxErrorStyle" TargetType="{x:Type TextBox}">
25-
<Setter Property="Validation.ErrorTemplate">
26-
<Setter.Value>
27-
<ControlTemplate x:Name="TextBoxErrorTemplate">
28-
<Grid>
29-
<AdornedElementPlaceholder Grid.Row="0"/>
30-
<Image Source="{StaticResource InvalidTextImage}"
31-
Height="16"
32-
Margin="0,-8,-8,0"
33-
HorizontalAlignment="Right"
34-
VerticalAlignment="Top"/>
35-
</Grid>
36-
</ControlTemplate>
37-
</Setter.Value>
38-
</Setter>
39-
<Style.Triggers>
40-
<Trigger Property="Validation.HasError"
41-
Value="True">
42-
<Setter Property="ToolTip"
43-
Value="{Binding RelativeSource={x:Static RelativeSource.Self},
44-
Path=(Validation.Errors)[0].ErrorContent}">
45-
</Setter>
46-
</Trigger>
47-
</Style.Triggers>
48-
</Style>
4922
</ResourceDictionary>
5023
</UserControl.Resources>
5124

Rubberduck.Core/UI/Refactorings/MoveFolder/MoveMultipleFoldersView.xaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
<ResourceDictionary.MergedDictionaries>
1212
<ResourceDictionary Source="../../Controls/ToolBar.xaml"/>
1313
</ResourceDictionary.MergedDictionaries>
14-
15-
<BitmapImage x:Key="InvalidFolderImage" UriSource="pack://application:,,,/Rubberduck.Resources;component/Icons/Fugue/cross-circle.png" />
1614
</ResourceDictionary>
1715
</UserControl.Resources>
1816
<Grid>
@@ -41,7 +39,7 @@
4139
VerticalContentAlignment="Center"
4240
HorizontalAlignment="Stretch" />
4341
<Image Grid.Column="1"
44-
Source="{StaticResource InvalidFolderImage}"
42+
Source="{StaticResource InvalidTextImage}"
4543
Height="16"
4644
Margin="0,-8,-8,0"
4745
HorizontalAlignment="Right"

Rubberduck.Core/UI/Refactorings/MoveToFolder/MoveMultipleToFolderView.xaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
<ResourceDictionary.MergedDictionaries>
1212
<ResourceDictionary Source="../../Controls/ToolBar.xaml"/>
1313
</ResourceDictionary.MergedDictionaries>
14-
15-
<BitmapImage x:Key="InvalidFolderImage" UriSource="pack://application:,,,/Rubberduck.Resources;component/Icons/Fugue/cross-circle.png" />
1614
</ResourceDictionary>
1715
</UserControl.Resources>
1816
<Grid>
@@ -41,7 +39,7 @@
4139
VerticalContentAlignment="Center"
4240
HorizontalAlignment="Stretch" />
4341
<Image Grid.Column="1"
44-
Source="{StaticResource InvalidFolderImage}"
42+
Source="{StaticResource InvalidTextImage}"
4543
Height="16"
4644
Margin="0,-8,-8,0"
4745
HorizontalAlignment="Right"

Rubberduck.Core/UI/Refactorings/Rename/RenameView.xaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
<ResourceDictionary.MergedDictionaries>
1212
<ResourceDictionary Source="../../Controls/ToolBar.xaml"/>
1313
</ResourceDictionary.MergedDictionaries>
14-
15-
<BitmapImage x:Key="InvalidNameImage" UriSource="pack://application:,,,/Rubberduck.Resources;component/Icons/Fugue/cross-circle.png" />
1614
</ResourceDictionary>
1715
</UserControl.Resources>
1816
<Grid>
@@ -41,7 +39,7 @@
4139
VerticalContentAlignment="Center"
4240
HorizontalAlignment="Stretch" />
4341
<Image Grid.Column="1"
44-
Source="{StaticResource InvalidNameImage}"
42+
Source="{StaticResource InvalidTextImage}"
4543
Height="16"
4644
Margin="0,-8,-8,0"
4745
HorizontalAlignment="Right"

Rubberduck.Core/UI/Styles/DefaultStyle.xaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,33 @@
119119
</Style.Setters>
120120
</Style>
121121

122+
<BitmapImage x:Key="InvalidTextImage" UriSource="pack://application:,,,/Rubberduck.Resources;component/Icons/Fugue/cross-circle.png" />
123+
<Style x:Key="TextBoxErrorStyle" TargetType="{x:Type TextBox}">
124+
<Setter Property="Validation.ErrorTemplate">
125+
<Setter.Value>
126+
<ControlTemplate x:Name="TextBoxErrorTemplate">
127+
<Grid>
128+
<AdornedElementPlaceholder Grid.Row="0"/>
129+
<Image Source="{StaticResource InvalidTextImage}"
130+
Height="16"
131+
Margin="0,-8,-8,0"
132+
HorizontalAlignment="Right"
133+
VerticalAlignment="Top"/>
134+
</Grid>
135+
</ControlTemplate>
136+
</Setter.Value>
137+
</Setter>
138+
<Style.Triggers>
139+
<Trigger Property="Validation.HasError"
140+
Value="True">
141+
<Setter Property="ToolTip"
142+
Value="{Binding RelativeSource={x:Static RelativeSource.Self},
143+
Path=(Validation.Errors)[0].ErrorContent}">
144+
</Setter>
145+
</Trigger>
146+
</Style.Triggers>
147+
</Style>
148+
122149
<BooleanToVisibilityConverter x:Key="BoolToVisibility"/>
123150
<converters:BoolToHiddenVisibilityConverter x:Key="BoolToHiddenVisibility" />
124151
<settingsConverters:SelectedItemToBooleanConverter x:Key="HasSelectedItems"/>

0 commit comments

Comments
 (0)