示例#1
0
        internal static Page GetViewForViewModel(Type viewModelType)
        {
            Validate.Begin()
            .ParameterIsNotNull(viewModelType, "viewModelType")
            .Check();

            lock (m_index)
            {
                var tuple = m_index.FirstOrDefault(v => v.Value == viewModelType);

                if (tuple.Equals(default(KeyValuePair <Type, Type>)))
                {
                    return(null);                                                  // not registered - not sure this is a valid compare.  Maybe should check the items in the tuple?
                }
                return(RootWorkItem.Services.Get(tuple.Key) as Page);
            }
        }