コード例 #1
0
        public Type GetViewModelType()
        {
            string key = $"{AssemblyName},{ViewModelTypeName}";

            if (KnownWidgetModel.ContainsKey(key))
            {
                return(KnownWidgetModel[key]);
            }
            return(null);
        }
コード例 #2
0
        public WidgetBase CreateViewModelInstance(IServiceProvider serviceProvider)
        {
            string key = $"{AssemblyName},{ViewModelTypeName}";

            if (_widgetBase == null && KnownWidgetModel.ContainsKey(key))
            {
                _widgetBase = serviceProvider.GetService(KnownWidgetModel[key]) as WidgetBase;
            }
            return(CopyTo(_widgetBase));
        }