Exemplo n.º 1
0
 private void OnQuerying(object sender, EntityQueryingEventArgs args)
 {
     // In design mode all queries must be forced to execute against the cache.
     if (DesignTime.InDesignMode())
     {
         args.Query = args.Query.With(QueryStrategy.CacheOnly);
     }
 }
        /// <summary>
        ///   Initializes the application object.
        /// </summary>
        /// <param name="rootViewModelType"> The application's default view model type. An instance of this type is active if the user launched the app or tapped a content tile. </param>
        protected CocktailWindowsStoreApplication(Type rootViewModelType)
        {
            _rootViewModelType = rootViewModelType;

            if (DesignTime.InDesignMode())
            {
                InitializeDesignTime();
            }
        }
        public void BuildUp(object instance)
        {
            // Skip if in design mode.
            if (DesignTime.InDesignMode())
            {
                return;
            }

            Container.SatisfyImports(instance);
        }
Exemplo n.º 4
0
        /// <summary>
        ///   Enables full design time support for the specified EntityManager type.
        /// </summary>
        /// <typeparam name="T"> The type of EntityManager needing design time support. </typeparam>
        /// <remarks>
        ///   This method must be called as early as possible, usually in the bootstrapper's static constructor.
        /// </remarks>
        public static void EnableDesignTimeSupport <T>() where T : EntityManager
        {
            if (DesignTime.InDesignMode())
            {
                var assemblyName = typeof(T).GetAssembly().FullName;
                if (IdeaBladeConfig.Instance.ProbeAssemblyNames.Contains(assemblyName))
                {
                    return;
                }

                IdeaBladeConfig.Instance.ProbeAssemblyNames.Add(assemblyName);
            }
        }