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