Skip to content

Commit 408959e

Browse files
committed
Simplify binding paths in CE by moving styles closer to scopes, general cleanup.
1 parent 1f8f4df commit 408959e

File tree

7 files changed

+273
-306
lines changed

7 files changed

+273
-306
lines changed

Rubberduck.Core/Navigation/CodeExplorer/CodeExplorerItemViewModel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace Rubberduck.Navigation.CodeExplorer
1010
{
11-
public abstract class CodeExplorerItemViewModel : ViewModelBase //, ICodeExplorerDeclarationViewModel
11+
public abstract class CodeExplorerItemViewModel : ViewModelBase
1212
{
1313
protected CodeExplorerItemViewModel(Declaration declaration)
1414
{
@@ -70,6 +70,8 @@ public bool IsVisible
7070
}
7171
}
7272

73+
public virtual bool IsObsolete => false;
74+
7375
public Declaration Declaration { get; }
7476

7577
public virtual string ToolTip => NameWithSignature;

Rubberduck.Core/Navigation/CodeExplorer/CodeExplorerMemberViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public void ParentComponentHasError()
176176
public override BitmapImage CollapsedIcon => _icon;
177177
public override BitmapImage ExpandedIcon => _icon;
178178

179-
public bool IsObsolete =>
179+
public override bool IsObsolete =>
180180
Declaration.Annotations.Any(annotation => annotation.AnnotationType == AnnotationType.Obsolete);
181181
}
182182
}

Rubberduck.Core/UI/AddRemoveReferences/AddRemoveReferencesWindow.xaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@
4646
UpdateSourceTrigger=PropertyChanged}"
4747
x:Name="textSource"
4848
Background="Transparent"
49-
Panel.ZIndex="2" />
49+
Panel.ZIndex="2"
50+
VerticalContentAlignment="Center" />
5051
<TextBox Text="{TemplateBinding Tag}" Background="{TemplateBinding Background}" Panel.ZIndex="1">
5152
<TextBox.Style>
5253
<Style TargetType="{x:Type TextBox}">
5354
<Setter Property="Foreground" Value="Transparent"/>
55+
<Setter Property="VerticalContentAlignment" Value="Center"/>
5456
<Style.Triggers>
5557
<DataTrigger Binding="{Binding Path=Text, Source={x:Reference textSource}}" Value="">
5658
<Setter Property="Foreground" Value="LightGray"/>

Rubberduck.Core/UI/CodeExplorer/CodeExplorerControl.xaml

Lines changed: 215 additions & 302 deletions
Large diffs are not rendered by default.

Rubberduck.Core/UI/Converters/BooleanToNullableDoubleConverter.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,21 @@ public class BooleanToNullableDoubleConverter : IValueConverter
88
{
99
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
1010
{
11-
throw new InvalidOperationException();
11+
if (!(value is double size) ||
12+
!(parameter is IConvertible input))
13+
{
14+
return false;
15+
}
16+
17+
try
18+
{
19+
// ReSharper disable once CompareOfFloatsByEqualityOperator - these are hard coded values.
20+
return System.Convert.ToDouble(input) == size;
21+
}
22+
catch
23+
{
24+
return false;
25+
}
1226
}
1327

1428
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)

Rubberduck.Resources/RubberduckUI.Designer.cs

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Rubberduck.Resources/RubberduckUI.resx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,4 +1481,13 @@ NOTE: Restart is required for the setting to take effect.</value>
14811481
<data name="References_RemoveToolTip" xml:space="preserve">
14821482
<value>Remove from project</value>
14831483
</data>
1484+
<data name="AllReferences_NoneFoundReference" xml:space="preserve">
1485+
<value>No references were found for project reference '{0}'.</value>
1486+
</data>
1487+
<data name="AllReferences_PerformanceWarning" xml:space="preserve">
1488+
<value>Search for reference '{0}' returned {1} uses. Displaying the references may negatively impact performance. Continue?</value>
1489+
</data>
1490+
<data name="PerformanceWarningCaption" xml:space="preserve">
1491+
<value>Performance Warning</value>
1492+
</data>
14841493
</root>

0 commit comments

Comments
 (0)