public static void RegisterViewModel <TViewModel>(this IUFrameContainer container, TViewModel viewModel,
                                                   string identifier) where TViewModel : ViewModel
 {
     container.Register <TViewModel, TViewModel>();
     container.RegisterInstance <ViewModel>(viewModel, identifier);
     container.RegisterInstance(typeof(TViewModel), viewModel, identifier);
 }
示例#2
0
 public static NodeConfig <TGraphNode> AddGraph <TGraphType, TGraphNode>(this IUFrameContainer container, string name)
     where TGraphType : IGraphData
     where TGraphNode : GenericNode, new()
 {
     container.Register <IGraphData, TGraphType>(name);
     return(AddNode <TGraphNode>(container, name));
 }