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(); } }
public static void LoadComponent(object component, Uri resourceLocator) { XamlLoader.Load(component, XamlParser.Parse(Granular.Compatibility.String.FromByteArray(EmbeddedResourceLoader.LoadResourceData(resourceLocator)), resourceLocator)); }
public static void LoadComponent(object target, string resourceUri) { XamlLoader.Load(target, XamlParser.Parse(Granular.Compatibility.String.FromByteArray(EmbeddedResourceLoader.LoadResourceData(resourceUri)))); }
public static object LoadComponent(Uri resourceLocator) { return(EmbeddedResourceLoader.LoadResourceElement(resourceLocator)); }
public static object LoadComponent(string resourceUri) { return(EmbeddedResourceLoader.LoadResourceElement(resourceUri)); }