コード例 #1
0
        //--------------------------------------------------------------------------------------
        /// <summary>
        /// ctor
        /// </summary>
        //--------------------------------------------------------------------------------------
        public VarmintWidgetSpace(IVarmintWidgetInjector injector, object bindingContext = null)
        {
            _injector = injector;
            var assembly = injector.GetType().GetTypeInfo().Assembly;

            VarmintWidget.DeclareAssembly(assembly);

            // automatically add embedded resources
            foreach (var resourceName in assembly.GetManifestResourceNames())
            {
                if (resourceName.ToLower().EndsWith(".vwml"))
                {
                    System.Diagnostics.Debug.WriteLine("---- " + resourceName);

                    var nameParts   = resourceName.Split('.');
                    var defaultName = nameParts[nameParts.Length - 2];
                    AddContent(defaultName, assembly.GetManifestResourceStream(resourceName), bindingContext);
                }
            }
        }
コード例 #2
0
        //--------------------------------------------------------------------------------------
        /// <summary>
        /// ctor
        /// </summary>
        //--------------------------------------------------------------------------------------
        public VarmintWidgetSpace(IVarmintWidgetInjector injector)
        {
            _injector = injector;
            var assembly = injector.GetType().GetTypeInfo().Assembly;

            VarmintWidget.DeclareAssembly(assembly);

            // automatically add embedded layout by preloading the raw layout without hydrating it
            foreach (var resourceName in assembly.GetManifestResourceNames())
            {
                if (resourceName.ToLower().EndsWith(".vwml"))
                {
                    Debug.WriteLine("---- Injesting " + resourceName);

                    var nameParts   = resourceName.Split('.');
                    var defaultName = nameParts[nameParts.Length - 2];
                    AddContent(defaultName, assembly.GetManifestResourceStream(resourceName));
                }
            }
        }