Skip to content

Commit 9494f3d

Browse files
committed
Continue With #5451
Refactors Xamls
1 parent d843415 commit 9494f3d

File tree

11 files changed

+69
-69
lines changed

11 files changed

+69
-69
lines changed

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@
2626
<Grid>
2727
<Grid.Resources>
2828
<DataTemplate DataType="{x:Type local:IAnnotationArgumentViewModel}" x:Key="ArgumentSingleTypeTemplate">
29-
<TextBlock Text="{Binding ArgumentType, Converter={StaticResource AnnotationArgumentTypeToStringConverter}}"/>
29+
<TextBlock Text="{Binding ArgumentType, Converter={DynamicResource AnnotationArgumentTypeToStringConverter}}"/>
3030
</DataTemplate>
3131
<DataTemplate DataType="{x:Type local:IAnnotationArgumentViewModel}" x:Key="ArgumentMultiTypeTemplate">
3232
<ComboBox ItemsSource="{Binding Path=ApplicableArgumentTypes}"
3333
SelectedItem="{Binding Path=ArgumentType, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
3434
IsSynchronizedWithCurrentItem="True">
3535
<ComboBox.ItemTemplate>
3636
<DataTemplate DataType="{x:Type annotations:AnnotationArgumentType}">
37-
<TextBlock Text="{Binding Path=., Converter={StaticResource AnnotationArgumentTypeToStringConverter}}"/>
37+
<TextBlock Text="{Binding Path=., Converter={DynamicResource AnnotationArgumentTypeToStringConverter}}"/>
3838
</DataTemplate>
3939
</ComboBox.ItemTemplate>
4040
</ComboBox>
@@ -43,29 +43,29 @@
4343
<annotations:AnnotationArgumentType>Boolean</annotations:AnnotationArgumentType>
4444
<annotations:AnnotationArgumentType>Inspection</annotations:AnnotationArgumentType>
4545
</x:Array>
46-
<converters:SpecificValuesToVisibilityConverter SpecialValues="{StaticResource NonDefaultInputArgumentTypes}" CollapseSpecialValues="True" x:Key="DefaultArgumentVisibilityConverter"/>
46+
<converters:SpecificValuesToVisibilityConverter SpecialValues="{DynamicResource NonDefaultInputArgumentTypes}" CollapseSpecialValues="True" x:Key="DefaultArgumentVisibilityConverter"/>
4747
<converters:SpecificValueToVisibilityConverter SpecialValue="{x:Static annotations:AnnotationArgumentType.Boolean}" CollapseSpecialValue="False" x:Key="BooleanArgumentVisibilityConverter"/>
4848
<converters:SpecificValueToVisibilityConverter SpecialValue="{x:Static annotations:AnnotationArgumentType.Inspection}" CollapseSpecialValue="False" x:Key="InspectionArgumentVisibilityConverter"/>
4949
<DataTemplate DataType="{x:Type local:IAnnotationArgumentViewModel}" x:Key="ArgumentValueTemplate">
5050
<StackPanel VerticalAlignment="Center">
5151
<TextBox Text="{Binding ArgumentValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"
52-
Style="{StaticResource TextBoxErrorStyle}"
52+
Style="{DynamicResource TextBoxErrorStyle}"
5353
HorizontalAlignment="Stretch"
5454
VerticalAlignment="Stretch"
55-
Visibility="{Binding ArgumentType, Converter={StaticResource DefaultArgumentVisibilityConverter}}">
55+
Visibility="{Binding ArgumentType, Converter={DynamicResource DefaultArgumentVisibilityConverter}}">
5656
</TextBox>
57-
<ComboBox Visibility="{Binding ArgumentType, Converter={StaticResource BooleanArgumentVisibilityConverter}}"
57+
<ComboBox Visibility="{Binding ArgumentType, Converter={DynamicResource BooleanArgumentVisibilityConverter}}"
5858
ItemsSource="{Binding Path=BooleanValues}"
5959
SelectedItem="{Binding Path=ArgumentValue, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"
6060
HorizontalAlignment="Stretch"
6161
VerticalAlignment="Stretch">
6262
</ComboBox>
63-
<ComboBox Visibility="{Binding ArgumentType, Converter={StaticResource InspectionArgumentVisibilityConverter}}"
63+
<ComboBox Visibility="{Binding ArgumentType, Converter={DynamicResource InspectionArgumentVisibilityConverter}}"
6464
ItemsSource="{Binding Path=InspectionNames}"
6565
SelectedItem="{Binding Path=ArgumentValue, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}">
6666
<ComboBox.ItemTemplate>
6767
<DataTemplate>
68-
<TextBlock Text="{Binding Path=., Converter={StaticResource InspectionToLocalizedNameConverter}, UpdateSourceTrigger=PropertyChanged}"
68+
<TextBlock Text="{Binding Path=., Converter={DynamicResource InspectionToLocalizedNameConverter}, UpdateSourceTrigger=PropertyChanged}"
6969
HorizontalAlignment="Stretch"
7070
VerticalAlignment="Stretch"/>
7171
</DataTemplate>
@@ -82,27 +82,27 @@
8282
<RowDefinition Height="*" />
8383
<RowDefinition Height="40" />
8484
</Grid.RowDefinitions>
85-
<StackPanel Background="{StaticResource BackgroundLightBrush}">
85+
<StackPanel Background="{DynamicResource BackgroundLightBrush}">
8686
<Label Content="{Resx ResxName=Rubberduck.Refactorings.RefactoringsUI, Key=AnnotateDeclarationDialog_TitleText}" FontWeight="Bold"/>
8787
<TextBlock Text="{Resx ResxName=Rubberduck.Refactorings.RefactoringsUI, Key=AnnotateDeclarationDialog_Instructions}" Margin="5,0,0,10" TextWrapping="Wrap" />
8888
</StackPanel>
8989
<StackPanel Grid.Row="1">
9090
<Label Content="{Resx ResxName=Rubberduck.Refactorings.RefactoringsUI, Key=AnnotateDeclarationDialog_DeclarationLabel}" FontWeight="DemiBold" />
91-
<TextBlock Text="{Binding Model.Target, Converter={StaticResource DeclarationToQualifiedNameConverter}}" Margin="5,0,0,5" FontWeight="Regular" />
91+
<TextBlock Text="{Binding Model.Target, Converter={DynamicResource DeclarationToQualifiedNameConverter}}" Margin="5,0,0,5" FontWeight="Regular" />
9292
<Label Content="{Resx ResxName=Rubberduck.Refactorings.RefactoringsUI, Key=AnnotateDeclarationDialog_AnnotationLabel}" FontWeight="DemiBold" />
9393
<ComboBox ItemsSource="{Binding ApplicableAnnotations}"
9494
SelectedItem="{Binding Annotation}"
9595
IsSynchronizedWithCurrentItem="True"
9696
Margin="5,0,5,5">
9797
<ComboBox.ItemTemplate>
9898
<DataTemplate DataType="{x:Type annotations:IAnnotation}">
99-
<TextBlock Text="{Binding Path=., Converter={StaticResource AnnotationToCodeStringConverter}}"/>
99+
<TextBlock Text="{Binding Path=., Converter={DynamicResource AnnotationToCodeStringConverter}}"/>
100100
</DataTemplate>
101101
</ComboBox.ItemTemplate>
102102
</ComboBox>
103103
<CheckBox Content="{Resx ResxName=Rubberduck.Refactorings.RefactoringsUI, Key=AnnotateDeclarationDialog_AdjustAttributeLabel}"
104104
IsChecked="{Binding AdjustAttribute}"
105-
Visibility="{Binding ShowAdjustAttributeOption, Converter={StaticResource AdjustAttributeVisibilityConverter}}"
105+
Visibility="{Binding ShowAdjustAttributeOption, Converter={DynamicResource AdjustAttributeVisibilityConverter}}"
106106
Margin="10,0,10,-5"
107107
VerticalContentAlignment="Center">
108108
<CheckBox.LayoutTransform>
@@ -141,12 +141,12 @@
141141
Margin="5,0,5,5">
142142
<DataGrid.Columns>
143143
<DataGridTemplateColumn Header="{Resx ResxName=Rubberduck.Refactorings.RefactoringsUI, Key=AnnotateDeclarationDialog_ArgumentTypeHeader}"
144-
CellTemplateSelector="{StaticResource AnnotationArgumentTypeCellDataTemplateSelector}"
145-
CellEditingTemplateSelector="{StaticResource AnnotationArgumentTypeCellDataTemplateSelector}"
144+
CellTemplateSelector="{DynamicResource AnnotationArgumentTypeCellDataTemplateSelector}"
145+
CellEditingTemplateSelector="{DynamicResource AnnotationArgumentTypeCellDataTemplateSelector}"
146146
Width="Auto"/>
147147
<DataGridTemplateColumn Header="{Resx ResxName=Rubberduck.Refactorings.RefactoringsUI, Key=AnnotateDeclarationDialog_ArgumentValueHeader}"
148-
CellTemplate="{StaticResource ArgumentValueTemplate}"
149-
CellEditingTemplate="{StaticResource ArgumentValueTemplate}"
148+
CellTemplate="{DynamicResource ArgumentValueTemplate}"
149+
CellEditingTemplate="{DynamicResource ArgumentValueTemplate}"
150150
Width="*"/>
151151
</DataGrid.Columns>
152152
</DataGrid>

Rubberduck.Core/UI/Refactorings/EncapsulateField/EncapsulateFieldView.xaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<converters:BoolToVisibleVisibilityConverter x:Key="BoolToVisibleVisibility" />
1818
<BitmapImage x:Key="InvalidNameImage" UriSource="pack://application:,,,/Rubberduck.Resources;component/Icons/Fugue/cross-circle.png" />
1919
<Style TargetType="Image" x:Key="InvalidNameIconStyle">
20-
<Setter Property="Source" Value="{StaticResource InvalidNameImage}" />
20+
<Setter Property="Source" Value="{DynamicResource InvalidNameImage}" />
2121
<Setter Property="Height" Value="16" />
2222
<Setter Property="Margin" Value="0,0,-8,0" />
2323
<Setter Property="HorizontalAlignment" Value="Right" />
@@ -36,7 +36,7 @@
3636
<RowDefinition Height="*" />
3737
<RowDefinition Height="40" />
3838
</Grid.RowDefinitions>
39-
<StackPanel Grid.Row="0" Background="{StaticResource BackgroundLightBrush}">
39+
<StackPanel Grid.Row="0" Background="{DynamicResource BackgroundLightBrush}">
4040
<Label Content="{Resx ResxName=Rubberduck.Refactorings.RefactoringsUI, Key=EncapsulateField_TitleText}"
4141
FontWeight="Bold" />
4242
<TextBlock Text="{Resx ResxName=Rubberduck.Refactorings.RefactoringsUI, Key=EncapsulateField_InstructionText}"
@@ -67,7 +67,7 @@
6767
HorizontalAlignment="Left"
6868
DisplayMemberPath="FieldDeclarationBlock"
6969
SelectedItem="{Binding SelectedObjectStateUDT, Mode=TwoWay}"
70-
Visibility="{Binding ShowStateUDTSelections, Converter={StaticResource BoolToVisibleVisibility}}">
70+
Visibility="{Binding ShowStateUDTSelections, Converter={DynamicResource BoolToVisibleVisibility}}">
7171
</ComboBox>
7272
</StackPanel>
7373
<Grid Grid.Row="1" Margin="5">
@@ -84,10 +84,10 @@
8484
<TextBlock Grid.Column="0" Margin="0,5"
8585
Text="{Resx ResxName=Rubberduck.Refactorings.RefactoringsUI, Key=ExtractInterface_MembersGroupBox}" />
8686
<StackPanel Grid.Column="1" Margin="5" Orientation="Horizontal">
87-
<Button Style="{StaticResource CommandButtonStyle}" TabIndex="2"
87+
<Button Style="{DynamicResource CommandButtonStyle}" TabIndex="2"
8888
Content="{Resx ResxName=Rubberduck.Resources.RubberduckUI, Key=SelectAll_Button}"
8989
Command="{Binding SelectAllCommand}" />
90-
<Button Style="{StaticResource CommandButtonStyle}" TabIndex="3"
90+
<Button Style="{DynamicResource CommandButtonStyle}" TabIndex="3"
9191
Content="{Resx ResxName=Rubberduck.Resources.RubberduckUI, Key=DeselectAll_Button}"
9292
Command="{Binding DeselectAllCommand}">
9393
</Button>
@@ -112,21 +112,21 @@
112112
Text="{Binding TargetDeclarationExpression, Mode=OneWay}"
113113
FontWeight="Bold">
114114
</TextBlock>
115-
<Image Style="{StaticResource InvalidNameIconStyle}"
116-
Visibility="{Binding Path=HasValidEncapsulationAttributes, Converter={StaticResource BoolToHiddenVisibility}}" />
115+
<Image Style="{DynamicResource InvalidNameIconStyle}"
116+
Visibility="{Binding Path=HasValidEncapsulationAttributes, Converter={DynamicResource BoolToHiddenVisibility}}" />
117117
</StackPanel>
118118
</DataTemplate>
119119
</ListBox.ItemTemplate>
120120
</ListBox>
121121
</StackPanel>
122122
</Grid>
123-
<Grid Grid.Row="2" Margin="5" Visibility="{Binding Path=SelectedFieldIsNotFlagged, Converter={StaticResource BoolToHiddenVisibility}}">
123+
<Grid Grid.Row="2" Margin="5" Visibility="{Binding Path=SelectedFieldIsNotFlagged, Converter={DynamicResource BoolToHiddenVisibility}}">
124124
<Grid.ColumnDefinitions>
125125
<ColumnDefinition Width="Auto" />
126126
<ColumnDefinition Width="*" />
127127
</Grid.ColumnDefinitions>
128128
<StackPanel>
129-
<GroupBox Visibility="{Binding Path=IsEmptyList, Converter={StaticResource BoolToHiddenVisibility}}"
129+
<GroupBox Visibility="{Binding Path=IsEmptyList, Converter={DynamicResource BoolToHiddenVisibility}}"
130130
Margin="5">
131131
<GroupBox.Header>
132132
<TextBlock Text="{Binding Path=GroupBoxHeaderContent}" FontWeight="Bold" />
@@ -137,17 +137,17 @@
137137
<RowDefinition Height="Auto"/>
138138
<RowDefinition Height="Auto"/>
139139
</Grid.RowDefinitions>
140-
<TextBlock Grid.Row="0" Visibility="{Binding Path=SelectedFieldIsPrivateUDT, Converter={StaticResource BoolToVisibleVisibility}}"
140+
<TextBlock Grid.Row="0" Visibility="{Binding Path=SelectedFieldIsPrivateUDT, Converter={DynamicResource BoolToVisibleVisibility}}"
141141
Text="{Resx ResxName=Rubberduck.Refactorings.RefactoringsUI, Key=EncapsulateField_PrivateUDTPropertyText}"
142142
Margin="10,5" />
143-
<TextBox Grid.Row="1" Visibility="{Binding Path=SelectedFieldHasEditablePropertyName, Converter={StaticResource BoolToVisibleVisibility}}"
143+
<TextBox Grid.Row="1" Visibility="{Binding Path=SelectedFieldHasEditablePropertyName, Converter={DynamicResource BoolToVisibleVisibility}}"
144144
Text="{Binding Path=PropertyName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
145145
TabIndex="1" Margin="10,5"
146146
VerticalAlignment="Center"
147147
VerticalContentAlignment="Center"
148148
Height="22" />
149-
<Image Grid.Row="1" Style="{StaticResource InvalidNameIconStyle}"
150-
Visibility="{Binding Path=SelectionHasValidEncapsulationAttributes, Converter={StaticResource BoolToHiddenVisibility}}" />
149+
<Image Grid.Row="1" Style="{DynamicResource InvalidNameIconStyle}"
150+
Visibility="{Binding Path=SelectionHasValidEncapsulationAttributes, Converter={DynamicResource BoolToHiddenVisibility}}" />
151151
</Grid>
152152
<CheckBox IsChecked="{Binding Path=IsReadOnly, Mode=TwoWay}"
153153
IsEnabled="{Binding Path=EnableReadOnlyOption}"
@@ -168,8 +168,8 @@
168168
<StackPanel Grid.Row="3" Margin="10,5" Orientation="Horizontal">
169169
<TextBlock Text="{Resx ResxName=Rubberduck.Refactorings.RefactoringsUI, Key=EncapsulateField_Preview}"
170170
FontSize="14" FontWeight="Bold" />
171-
<Image Style="{StaticResource InvalidNameIconStyle}" Margin="0,-4"
172-
Visibility="{Binding Path=HasValidNames, Converter={StaticResource BoolToHiddenVisibility}}" />
171+
<Image Style="{DynamicResource InvalidNameIconStyle}" Margin="0,-4"
172+
Visibility="{Binding Path=HasValidNames, Converter={DynamicResource BoolToHiddenVisibility}}" />
173173
</StackPanel>
174174
<controls:BindableTextEditor Grid.Row="4" Margin="10" BorderThickness="1"
175175
FontFamily="Courier New "
@@ -188,12 +188,12 @@
188188
</Grid.ColumnDefinitions>
189189
<Button Content="{Resx ResxName=Rubberduck.Resources.RubberduckUI, Key=OK}"
190190
Grid.Column="0"
191-
Style="{StaticResource CommandButtonStyle}"
191+
Style="{DynamicResource CommandButtonStyle}"
192192
IsEnabled="{Binding IsValidInterfaceName}"
193193
Command="{Binding OkButtonCommand}" />
194194
<Button Content="{Resx ResxName=Rubberduck.Resources.RubberduckUI, Key=CancelButtonText}"
195195
Grid.Column="1"
196-
Style="{StaticResource CommandButtonStyle}"
196+
Style="{DynamicResource CommandButtonStyle}"
197197
Command="{Binding CancelButtonCommand}"/>
198198
</Grid>
199199
</Grid>

0 commit comments

Comments
 (0)