示例#1
0
 public static void LoadComponent(object component, Uri resourceLocator)
 {
     XamlLoader.Load(component, XamlParser.Parse(Granular.Compatibility.String.FromByteArray(EmbeddedResourceLoader.LoadResourceData(resourceLocator)), resourceLocator));
 }
示例#2
0
        private void LoadStartupUri()
        {
            if (StartupUri == null)
            {
                return;
            }

            Uri         uri            = StartupUri.ResolveAbsoluteUri(BaseUri);
            XamlElement rootElement    = XamlParser.Parse(Granular.Compatibility.String.FromByteArray(EmbeddedResourceLoader.LoadResourceData(uri)), uri);
            XamlMember  classDirective = rootElement.Directives.FirstOrDefault(directive => directive.Name == XamlLanguage.ClassDirective);

            Window window = Activator.CreateInstance(Type.GetType(String.Format("{0}, {1}", classDirective.GetSingleValue(), GetType().Assembly.GetName().Name))) as Window;

            if (window != null)
            {
                window.Show();
            }
        }
示例#3
0
 public static void LoadComponent(object target, string resourceUri)
 {
     XamlLoader.Load(target, XamlParser.Parse(Granular.Compatibility.String.FromByteArray(EmbeddedResourceLoader.LoadResourceData(resourceUri))));
 }