示例#1
0
 private static void EnsureContainer()
 {
     //CAS - We have to rebuild the ViewModelRepository everytime when in design mode to ensure we have the correct assemblies
     if (instance == null || Designer.IsInDesignMode)
     {
         instance = new ViewModelRepository();
     }
 }
 private static void EnsureContainer()
 {
     //CAS - We have to rebuild the ViewModelRepository everytime when in design mode to ensure we have the correct assemblies
     if (instance == null || Designer.IsInDesignMode)
     {
         instance = new ViewModelRepository();
     }
 }
示例#3
0
        private static void AttachViewModel(FrameworkElement element, string vmContractName, CreationPolicy policy)
        {
            if (element == null)
            {
                throw new ArgumentException(InvalidElementForAttachedProperty);
            }

            try
            {
                if (!String.IsNullOrEmpty(vmContractName))
                {
                    ViewModelRepository.AttachViewModelToView(vmContractName, element, policy);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Error while resolving ViewModel. " + ex);
            }
        }