Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit e5a67eb

Browse files
committed
Make sure our assembly resolver always runs
Fixes #267 For some reason, the xaml loader fails miserably when trying to resolve where to load our DLLs from if they're not yet in the process. The directories it's scanning don't include the extension installation path, so it can't find any assemblies that are referenced directly from xaml (using types from other assemblies in code works fine, using them in xaml doesn't). We have an assembly resolver code path as part of our ResourceDictionary implementation (SharedDictionaryManager), so every xaml user control needs to have at least one include that uses SharedDictionaryManager in order to trigger the assembly resolver hook up and ensure that libraries are found.
1 parent 4009782 commit e5a67eb

File tree

3 files changed

+68
-52
lines changed

3 files changed

+68
-52
lines changed

src/GitHub.VisualStudio/GitHub.VisualStudio.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,10 @@
375375
<Generator>MSBuild:Compile</Generator>
376376
<CustomToolNamespace>GitHub.VisualStudio.UI</CustomToolNamespace>
377377
</Page>
378+
<Page Include="UI\Settings\OptionsStyles.xaml">
379+
<SubType>Designer</SubType>
380+
<Generator>MSBuild:Compile</Generator>
381+
</Page>
378382
<Page Include="UI\Views\Controls\ActionLinkButton.xaml">
379383
<SubType>Designer</SubType>
380384
<Generator>MSBuild:Compile</Generator>

src/GitHub.VisualStudio/UI/Settings/OptionsControl.xaml

Lines changed: 6 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,61 +5,15 @@
55
xmlns:local="clr-namespace:GitHub.VisualStudio.UI"
66
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
77
xmlns:prop="clr-namespace:GitHub.VisualStudio.UI;assembly=GitHub.VisualStudio.UI"
8+
xmlns:cache="clr-namespace:GitHub.VisualStudio.Helpers"
89
d:DesignHeight="200"
910
mc:Ignorable="d">
1011
<UserControl.Resources>
11-
<BorderGapMaskConverter x:Key="BorderGapMaskConverter" />
12-
<Style x:Key="GroupBoxFlat" TargetType="{x:Type GroupBox}">
13-
<Setter Property="BorderBrush" Value="#D5DFE5" />
14-
<Setter Property="BorderThickness" Value="1" />
15-
<Setter Property="Template">
16-
<Setter.Value>
17-
<ControlTemplate TargetType="{x:Type GroupBox}">
18-
<Grid SnapsToDevicePixels="true">
19-
<Grid.ColumnDefinitions>
20-
<ColumnDefinition Width="6" />
21-
<ColumnDefinition Width="Auto" />
22-
<ColumnDefinition Width="*" />
23-
<ColumnDefinition Width="6" />
24-
</Grid.ColumnDefinitions>
25-
<Grid.RowDefinitions>
26-
<RowDefinition Height="Auto" />
27-
<RowDefinition Height="Auto" />
28-
<RowDefinition Height="*" />
29-
<RowDefinition Height="6" />
30-
</Grid.RowDefinitions>
31-
<Border x:Name="Header"
32-
Grid.Row="0"
33-
Grid.RowSpan="2"
34-
Grid.Column="1"
35-
Padding="3,1,3,0">
36-
<ContentPresenter ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
37-
</Border>
38-
<Border Grid.Row="1"
39-
Grid.RowSpan="3"
40-
Grid.ColumnSpan="4"
41-
BorderBrush="Transparent"
42-
BorderThickness="{TemplateBinding BorderThickness}"
43-
CornerRadius="4">
44-
<Border.OpacityMask>
45-
<MultiBinding Converter="{StaticResource BorderGapMaskConverter}" ConverterParameter="7">
46-
<Binding ElementName="Header" Path="ActualWidth" />
47-
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}" />
48-
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}" />
49-
</MultiBinding>
50-
</Border.OpacityMask>
51-
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" />
52-
</Border>
53-
<ContentPresenter Grid.Row="2"
54-
Grid.Column="1"
55-
Grid.ColumnSpan="2"
56-
Margin="{TemplateBinding Padding}"
57-
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
58-
</Grid>
59-
</ControlTemplate>
60-
</Setter.Value>
61-
</Setter>
62-
</Style>
12+
<ResourceDictionary>
13+
<ResourceDictionary.MergedDictionaries>
14+
<cache:SharedDictionaryManager Source="pack://application:,,,/GitHub.VisualStudio;component/UI/Settings/OptionsStyles.xaml" />
15+
</ResourceDictionary.MergedDictionaries>
16+
</ResourceDictionary>
6317
</UserControl.Resources>
6418
<GroupBox Height="85"
6519
Margin="8,0,8,0"
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<ResourceDictionary
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options">
5+
6+
<BorderGapMaskConverter x:Key="BorderGapMaskConverter" />
7+
<Style x:Key="GroupBoxFlat" TargetType="{x:Type GroupBox}">
8+
<Setter Property="BorderBrush" Value="#D5DFE5" />
9+
<Setter Property="BorderThickness" Value="1" />
10+
<Setter Property="Template">
11+
<Setter.Value>
12+
<ControlTemplate TargetType="{x:Type GroupBox}">
13+
<Grid SnapsToDevicePixels="true">
14+
<Grid.ColumnDefinitions>
15+
<ColumnDefinition Width="6" />
16+
<ColumnDefinition Width="Auto" />
17+
<ColumnDefinition Width="*" />
18+
<ColumnDefinition Width="6" />
19+
</Grid.ColumnDefinitions>
20+
<Grid.RowDefinitions>
21+
<RowDefinition Height="Auto" />
22+
<RowDefinition Height="Auto" />
23+
<RowDefinition Height="*" />
24+
<RowDefinition Height="6" />
25+
</Grid.RowDefinitions>
26+
<Border x:Name="Header"
27+
Grid.Row="0"
28+
Grid.RowSpan="2"
29+
Grid.Column="1"
30+
Padding="3,1,3,0">
31+
<ContentPresenter ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
32+
</Border>
33+
<Border Grid.Row="1"
34+
Grid.RowSpan="3"
35+
Grid.ColumnSpan="4"
36+
BorderBrush="Transparent"
37+
BorderThickness="{TemplateBinding BorderThickness}"
38+
CornerRadius="4">
39+
<Border.OpacityMask>
40+
<MultiBinding Converter="{StaticResource BorderGapMaskConverter}" ConverterParameter="7">
41+
<Binding ElementName="Header" Path="ActualWidth" />
42+
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}" />
43+
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}" />
44+
</MultiBinding>
45+
</Border.OpacityMask>
46+
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" />
47+
</Border>
48+
<ContentPresenter Grid.Row="2"
49+
Grid.Column="1"
50+
Grid.ColumnSpan="2"
51+
Margin="{TemplateBinding Padding}"
52+
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
53+
</Grid>
54+
</ControlTemplate>
55+
</Setter.Value>
56+
</Setter>
57+
</Style>
58+
</ResourceDictionary>

0 commit comments

Comments
 (0)