This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed
GitHub.VisualStudio/Views/GitHubPane Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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>
Original file line number Diff line number Diff line change 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" >
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" >
You can’t perform that action at this time.
0 commit comments