iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
I would like to load a xap to external application when user clicks on navigation link. your docs only show how to load external apps on startup (sample code below)....but your marketing material states you can load on demand. how is this done?
Please note: my defintion of "on-demand" is when a user clicks on a navigation link that references the external xap.
private void Application_Startup(object sender, StartupEventArgs e) { shellManager.RootPage = new MainPage(); this.RootVisual = shellManager.RootPage; //this.RootVisual = new MainPage(); // create a new ApplicationPackage that represents App1 ApplicationPackage app = new ApplicationPackage() { ID = "App1", Name = "App1", Source = new Uri("App1.xap", UriKind.RelativeOrAbsolute), EnableMetadataDiscovery = true, Size = -1 // auto detect the file size at runtime }; // add the application to the UXShell UXShell.Current.Applications.Add(app); // download the application app.Download(false); }
I think i figured it out. I just had to remove the download statement in the application_startup:
app.Download(false);
When i navigate to the external xap, UXShell automatically downloads and initializes the xap. pretty cool.
More composite app questions:
I've got a composite app (ClientUIOutlookNavApp1) with 2 external apps (App1 & App2). In fiddler, the external apps always download each time i run ClientUIOutlookNavApp1 even when they have not changed. Why doesn't UXShell load App1 and App2 from local storage?
here's the startup code in ClientUIOutlookNavApp1. any suggestions much appreciated!
public partial class App : Application {
// define the ApplicationID used to reference this application from UXShell or other containers public static string ApplicationID = "ClientUIOutlookNavApp1"; public static string DataFolder = "/ClientUIOutlookNavApp1;component/Assets/Data/"; public static string ImagesFolder = "/ClientUIOutlookNavApp1;component/Assets/Images/"; public App() { this.Startup += this.Application_Startup; this.Exit += this.Application_Exit; this.UnhandledException += this.Application_UnhandledException; InitializeComponent(); InitializeShell(); } private void InitializeShell() { UXShell shell = new UXShell(); shell.RootApplication = UXShell.CreateApplicationFromType(typeof(App), ApplicationID, ApplicationID); shell.CheckForUpdates = true; shell.AutoInstallOnDownload = true; shell.AutoInstallUpdates = true; //shell.InstallStorageScope = StorageScope.Site; this.ApplicationLifetimeObjects.Add(shell); } private void Application_Startup(object sender, StartupEventArgs e) { // create a new ApplicationPackage that represents App1 ApplicationPackage app1 = new ApplicationPackage() { ID = "App1", Name = "App1", Source = new Uri("App1.xap", UriKind.RelativeOrAbsolute), EnableMetadataDiscovery = true, MainType = "App1.MainPage", VirtualPathIdentity = "/App1", Size = -1 // auto detect the file size at runtime }; // add the application to the UXShell UXShell.Current.Applications.Add(app1); ApplicationPackage app2 = new ApplicationPackage() { ID = "App2", Name = "App2", Source = new Uri("App2.xap", UriKind.RelativeOrAbsolute), EnableMetadataDiscovery = true, Size = -1 // auto detect the file size at runtime }; // add the application to the UXShell UXShell.Current.Applications.Add(app2); this.RootVisual = new MainPage(); } private void Application_Exit(object sender, EventArgs e) { } private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) { // If the app is running outside of the debugger then report the exception using // the browser's exception mechanism. On IE this will display it a yellow alert // icon in the status bar and Firefox will display a script error. if (!System.Diagnostics.Debugger.IsAttached) { e.Handled = true; // Displays a user-friendly error page to the primary navigation (UXFrame) of the application Deployment.Current.Dispatcher.BeginInvoke(delegate { DisplayErrorToNavigationFrame(e); }); } } private void DisplayErrorToNavigationFrame(ApplicationUnhandledExceptionEventArgs e) { UXFrame frame = UXFrame.GetPrimaryNavigator(this.RootVisual); if (frame != null) { frame.Navigate(new Uri("/Error", UriKind.Relative), e); } else { ReportErrorToDOM(e); } } private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e) { try { string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");"); } catch (Exception) { } } }
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname