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