Just Code‎ > ‎

Silverlight - Out Of Browser, automatic installation of updates

posted Apr 8, 2010, 2:25 AM by Peter Henell   [ updated Apr 8, 2010, 4:11 AM ]
        public App()
        {
            this.Startup += this.Application_Startup;
            this.UnhandledException += this.Application_UnhandledException;

            this.CheckAndDownloadUpdateCompleted += new CheckAndDownloadUpdateCompletedEventHandler(App_CheckAndDownloadUpdateCompleted);

            InitializeComponent();
        }

        void App_CheckAndDownloadUpdateCompleted(object sender, CheckAndDownloadUpdateCompletedEventArgs e)
        {
            if (e.UpdateAvailable)
            {
                MessageBox.Show("Uppdatering installerad, var vänlig starta om programmet");
            }
            //else
            //{
            //    MessageBox.Show("No update available");
            //}
        }

        private void Application_Startup(object sender, StartupEventArgs e)
        {
            this.Resources.Add("RiaContext", RiaContext.Current);
            this.CheckAndDownloadUpdateAsync();
            this.RootVisual = new MainPage();
        }
Comments