Exemplo n.º 1
0
 void XapLoader_LoadCompleted(object sender, EventArgs e)
 {
     if (XapLoader.Contains(typeof(CharacterHostAttribute)))
     {
         tabItem1.Content = XapLoader.Get(typeof(CharacterHostAttribute));
     }
 }
Exemplo n.º 2
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            //if (Application.Current.IsRunningOutOfBrowser)
            //{
            string absolutePath = Application.Current.Host.Source.AbsoluteUri.Remove(
                Application.Current.Host.Source.AbsoluteUri.LastIndexOf('/') + 1);
            Uri uiApp = new Uri(absolutePath + "MajorMudX.UI.xap", UriKind.Absolute);

            XapLoader.LoadCompleted += new EventHandler(XapLoader_LoadCompleted);
            XapLoader.LoadXap(uiApp);
            //}
        }
Exemplo n.º 3
0
        /// <summary>
        /// Loads any external resources that might be included
        /// </summary>
        private static void LoadExternalResources(IEnumerable <ExternalResource> externalResources)
        {
            if (externalResources != null && externalResources.Count() > 0)
            {
                XapLoader loader = new XapLoader();

                loader.XapLoaded += (s, e) =>
                {
                    RaiseSnaglLoadedEvent();
                };

                // Load the external resources
                loader.BeginLoadXap(externalResources.ToArray(), true);
            }
            else
            {
                RaiseSnaglLoadedEvent();
            }
        }