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

Commit cda98c5

Browse files
authored
Merge branch 'master' into fixes/1385-checked-isloggedin
2 parents 24309ef + b486f1c commit cda98c5

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/GitHub.App/Factories/ViewViewModelFactory.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@ public class ViewViewModelFactory : IViewViewModelFactory
2020

2121
[ImportingConstructor]
2222
public ViewViewModelFactory(
23-
IGitHubServiceProvider serviceProvider,
24-
ICompositionService cc)
23+
IGitHubServiceProvider serviceProvider)
2524
{
2625
this.serviceProvider = serviceProvider;
27-
cc.SatisfyImportsOnce(this);
2826
}
2927

30-
[ImportMany(AllowRecomposition = true)]
28+
[ImportMany]
3129
IEnumerable<ExportFactory<FrameworkElement, IViewModelMetadata>> Views { get; set; }
3230

3331
/// <inheritdoc/>
@@ -45,7 +43,7 @@ public FrameworkElement CreateView<TViewModel>() where TViewModel : IViewModel
4543
/// <inheritdoc/>
4644
public FrameworkElement CreateView(Type viewModel)
4745
{
48-
var f = Views.FirstOrDefault(x => x.Metadata.ViewModelType.Contains(viewModel));
46+
var f = Views.FirstOrDefault(x => x.Metadata.ViewModelType.Contains(viewModel.FullName));
4947
return f?.CreateExport().Value;
5048
}
5149
}

src/GitHub.Exports/Exports/ExportMetadata.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,17 @@ public enum LinkType
3232
/// </summary>
3333
[MetadataAttribute]
3434
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
35+
[SuppressMessage("Microsoft.Design", "CA1019:DefineAccessorsForAttributeArguments",
36+
Justification = "Store string rather than Type as metadata")]
3537
public sealed class ExportViewForAttribute : ExportAttribute
3638
{
3739
public ExportViewForAttribute(Type viewModelType)
3840
: base(typeof(FrameworkElement))
3941
{
40-
ViewModelType = viewModelType;
42+
ViewModelType = viewModelType.FullName;
4143
}
4244

43-
public Type ViewModelType { get; }
45+
public string ViewModelType { get; }
4446
}
4547

4648
/// <summary>
@@ -69,7 +71,7 @@ public ExportMenuAttribute() : base(typeof(IMenuHandler))
6971
public interface IViewModelMetadata
7072
{
7173
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
72-
Type[] ViewModelType { get; }
74+
string[] ViewModelType { get; }
7375
}
7476

7577
/// <summary>

src/GitHub.VisualStudio/Views/GitHubPane/GitHubPaneView.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
xmlns:uc="clr-namespace:GitHub.UI.Controls;assembly=GitHub.UI"
1111
xmlns:vuc="clr-namespace:GitHub.VisualStudio.UI.Controls;assembly=GitHub.VisualStudio.UI"
1212
xmlns:views="clr-namespace:GitHub.VisualStudio.Views"
13+
Foreground="{DynamicResource GitHubVsWindowText}"
1314
d:DesignHeight="300"
1415
d:DesignWidth="300"
1516
mc:Ignorable="d">
@@ -82,8 +83,7 @@
8283
HorizontalAlignment="Center"
8384
VerticalAlignment="Center"
8485
Visibility="{Binding ContentOverride, Converter={u:EqualsToVisibilityConverter Spinner}, FallbackValue=Collapsed}"/>
85-
<Border Background="White"
86-
HorizontalAlignment="Stretch"
86+
<Border HorizontalAlignment="Stretch"
8787
VerticalAlignment="Stretch"
8888
Visibility="{Binding ContentOverride, Converter={u:EqualsToVisibilityConverter Error}, FallbackValue=Collapsed}">
8989
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">

0 commit comments

Comments
 (0)