Click here to Skip to main content
15,885,767 members
Articles / Programming Languages / C# 3.5

Silverlight Application with Dispatcher and asynchronous WCF service

Rate me:
Please Sign up or sign in to vote.
4.85/5 (6 votes)
8 Jan 2013CPOL4 min read 33.1K   738   8  
Silverlight Application with Dispatcher and asynchronous WCF Service
  • DispatherWithBusyIndicator.zip
    • Dispather
      • Test
        • BusinessApplication1.Web
        • BusinessApplication1
          • App.xaml
          • App.xaml.cs
          • Assets
          • Bin
            • Debug
              • AppManifest.xaml
              • ar
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • bg
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • BusinessApplication1.dll
              • BusinessApplication1.xap
              • ca
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • cs
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • da
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • de
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
                • System.Windows.Data.resources.dll
              • el
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • es
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
                • System.Windows.Data.resources.dll
              • et
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • eu
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • fi
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • fr
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
                • System.Windows.Data.resources.dll
              • he
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • hr
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • hu
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • id
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • it
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
                • System.Windows.Data.resources.dll
              • ja
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
                • System.Windows.Data.resources.dll
              • ko
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
                • System.Windows.Data.resources.dll
              • lt
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • lv
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • ms
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • nl
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • no
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • pl
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • pt
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • pt-BR
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • ro
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • ru
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
                • System.Windows.Data.resources.dll
              • sk
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • sl
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • sr-Cyrl-CS
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • sr-Latn-CS
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • sv
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • System.ComponentModel.DataAnnotations.dll
              • System.ComponentModel.DataAnnotations.xml
              • System.ServiceModel.DomainServices.Client.dll
              • System.ServiceModel.DomainServices.Client.Web.dll
              • System.ServiceModel.DomainServices.Client.Web.xml
              • System.ServiceModel.DomainServices.Client.xml
              • System.ServiceModel.Web.Extensions.dll
              • System.ServiceModel.Web.Extensions.xml
              • System.Windows.Controls.Data.DataForm.Toolkit.dll
              • System.Windows.Controls.Data.dll
              • System.Windows.Controls.Data.Input.dll
              • System.Windows.Controls.Data.Input.xml
              • System.Windows.Controls.Data.Toolkit.dll
              • System.Windows.Controls.Data.Toolkit.xml
              • System.Windows.Controls.Data.xml
              • System.Windows.Controls.dll
              • System.Windows.Controls.Navigation.dll
              • System.Windows.Controls.Navigation.xml
              • System.Windows.Controls.Toolkit.dll
              • System.Windows.Controls.Toolkit.Internals.dll
              • System.Windows.Controls.Toolkit.xml
              • System.Windows.Controls.xml
              • System.Windows.Data.dll
              • System.Windows.Data.xml
              • TestPage.html
              • th
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • tr
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • uk
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • vi
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.resources.dll
              • zh-Hans
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
                • System.Windows.Data.resources.dll
              • zh-Hant
                • System.ComponentModel.DataAnnotations.resources.dll
                • System.ServiceModel.DomainServices.Client.resources.dll
                • System.ServiceModel.DomainServices.Client.Web.resources.dll
                • System.ServiceModel.Web.Extensions.resources.dll
                • System.Windows.Controls.Data.Input.resources.dll
                • System.Windows.Controls.Data.resources.dll
                • System.Windows.Controls.Navigation.resources.dll
                • System.Windows.Controls.resources.dll
                • System.Windows.Data.resources.dll
          • BusinessApplication1.csproj
          • BusinessApplication1.csproj.user
          • GlobalSuppressions.cs
          • Helpers
          • Libs
            • System.Windows.Controls.Data.DataForm.Toolkit.dll
          • MainPage.xaml
          • MainPage.xaml.cs
          • obj
          • Properties
          • Service References
          • ServiceReferences.ClientConfig
        • DataServicwe
        • Test.sln
        • Test.suo
  • Dispatcher.zip
    • Dispatcher
      • BusinessApplication1.Web
      • BusinessApplication1
        • App.xaml
        • App.xaml.cs
        • Assets
        • Bin
          • Debug
            • AppManifest.xaml
            • ar
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • bg
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • BusinessApplication1.dll
            • BusinessApplication1.pdb
            • BusinessApplication1.xap
            • ca
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • cs
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • da
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • de
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.ServiceModel.DomainServices.Client.resources.dll
              • System.ServiceModel.DomainServices.Client.Web.resources.dll
              • System.ServiceModel.Web.Extensions.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Navigation.resources.dll
              • System.Windows.Controls.resources.dll
            • el
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • es
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.ServiceModel.DomainServices.Client.resources.dll
              • System.ServiceModel.DomainServices.Client.Web.resources.dll
              • System.ServiceModel.Web.Extensions.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Navigation.resources.dll
              • System.Windows.Controls.resources.dll
            • et
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • eu
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • fi
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • fr
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.ServiceModel.DomainServices.Client.resources.dll
              • System.ServiceModel.DomainServices.Client.Web.resources.dll
              • System.ServiceModel.Web.Extensions.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Navigation.resources.dll
              • System.Windows.Controls.resources.dll
            • he
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • hr
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • hu
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • id
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • it
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.ServiceModel.DomainServices.Client.resources.dll
              • System.ServiceModel.DomainServices.Client.Web.resources.dll
              • System.ServiceModel.Web.Extensions.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Navigation.resources.dll
              • System.Windows.Controls.resources.dll
            • ja
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.ServiceModel.DomainServices.Client.resources.dll
              • System.ServiceModel.DomainServices.Client.Web.resources.dll
              • System.ServiceModel.Web.Extensions.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Navigation.resources.dll
              • System.Windows.Controls.resources.dll
            • ko
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.ServiceModel.DomainServices.Client.resources.dll
              • System.ServiceModel.DomainServices.Client.Web.resources.dll
              • System.ServiceModel.Web.Extensions.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Navigation.resources.dll
              • System.Windows.Controls.resources.dll
            • lt
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • lv
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • ms
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • nl
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • no
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • pl
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • pt
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • pt-BR
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • ro
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • ru
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.ServiceModel.DomainServices.Client.resources.dll
              • System.ServiceModel.DomainServices.Client.Web.resources.dll
              • System.ServiceModel.Web.Extensions.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Navigation.resources.dll
              • System.Windows.Controls.resources.dll
            • sk
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • sl
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • sr-Cyrl-CS
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • sr-Latn-CS
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • sv
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • System.ComponentModel.DataAnnotations.dll
            • System.ComponentModel.DataAnnotations.xml
            • System.ServiceModel.DomainServices.Client.dll
            • System.ServiceModel.DomainServices.Client.Web.dll
            • System.ServiceModel.DomainServices.Client.Web.xml
            • System.ServiceModel.DomainServices.Client.xml
            • System.ServiceModel.Web.Extensions.dll
            • System.ServiceModel.Web.Extensions.xml
            • System.Windows.Controls.Data.DataForm.Toolkit.dll
            • System.Windows.Controls.Data.Input.dll
            • System.Windows.Controls.Data.Input.xml
            • System.Windows.Controls.dll
            • System.Windows.Controls.Navigation.dll
            • System.Windows.Controls.Navigation.xml
            • System.Windows.Controls.xml
            • TestPage.html
            • th
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • tr
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • uk
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • vi
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.resources.dll
            • zh-Hans
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.ServiceModel.DomainServices.Client.resources.dll
              • System.ServiceModel.DomainServices.Client.Web.resources.dll
              • System.ServiceModel.Web.Extensions.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Navigation.resources.dll
              • System.Windows.Controls.resources.dll
            • zh-Hant
              • System.ComponentModel.DataAnnotations.resources.dll
              • System.ServiceModel.DomainServices.Client.resources.dll
              • System.ServiceModel.DomainServices.Client.Web.resources.dll
              • System.ServiceModel.Web.Extensions.resources.dll
              • System.Windows.Controls.Data.Input.resources.dll
              • System.Windows.Controls.Navigation.resources.dll
              • System.Windows.Controls.resources.dll
          • Release
        • BusinessApplication1.csproj
        • BusinessApplication1.csproj.user
        • GlobalSuppressions.cs
        • Helpers
        • Libs
          • System.Windows.Controls.Data.DataForm.Toolkit.dll
        • MainPage.xaml
        • MainPage.xaml.cs
        • obj
        • Properties
        • Service References
        • ServiceReferences.ClientConfig
      • DataServicwe
      • Test.sln
      • Test.suo
  • Dispatcher-noexe.zip
  • DispatherWithBusyIndicator-noexe.zip
namespace BusinessApplication1
{
    using System;
    using System.Runtime.Serialization;
    using System.ServiceModel.DomainServices.Client.ApplicationServices;
    using System.Windows;
    using System.Windows.Controls;

    /// <summary>
    /// Main <see cref="Application"/> class.
    /// </summary>
    public partial class App : Application
    {
        /// <summary>
        /// Creates a new <see cref="App"/> instance.
        /// </summary>
        public App()
        {
            InitializeComponent();

            // Create a WebContext and add it to the ApplicationLifetimeObjects collection.
            // This will then be available as WebContext.Current.
            //WebContext webContext = new WebContext();
            //webContext.Authentication = new FormsAuthentication();
            ////webContext.Authentication = new WindowsAuthentication();
            //this.ApplicationLifetimeObjects.Add(webContext);
        }

        private void Application_Startup(object sender, StartupEventArgs e)
        {
            // This will enable you to bind controls in XAML to WebContext.Current properties.
            //this.Resources.Add("WebContext", WebContext.Current);

            //// This will automatically authenticate a user when using Windows authentication or when the user chose "Keep me signed in" on a previous login attempt.
            //WebContext.Current.Authentication.LoadUser(this.Application_UserLoaded, null);

            // Show some UI to the user while LoadUser is in progress
            this.InitializeRootVisual();
        }

        /// <summary>
        /// Invoked when the <see cref="LoadUserOperation"/> completes.
        /// Use this event handler to switch from the "loading UI" you created in <see cref="InitializeRootVisual"/> to the "application UI".
        /// </summary>
        private void Application_UserLoaded(LoadUserOperation operation)
        {
            if (operation.HasError)
            {
                //ErrorWindow.CreateNew(operation.Error);
                operation.MarkErrorAsHandled();
            }
        }

        /// <summary>
        /// Initializes the <see cref="Application.RootVisual"/> property.
        /// The initial UI will be displayed before the LoadUser operation has completed.
        /// The LoadUser operation will cause user to be logged in automatically if using Windows authentication or if the user had selected the "Keep me signed in" option on a previous login.
        /// </summary>
        protected virtual void InitializeRootVisual()
        {
            this.RootVisual = new MainPage();
            //BusinessApplication1.Controls.BusyIndicator busyIndicator = new BusinessApplication1.Controls.BusyIndicator();
            //busyIndicator.Content = new MainPage();
            //busyIndicator.HorizontalContentAlignment = HorizontalAlignment.Stretch;
            //busyIndicator.VerticalContentAlignment = VerticalAlignment.Stretch;

            //this.RootVisual = busyIndicator;
        }

        private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
        {
            // If the app is running outside of the debugger then report the exception using a ChildWindow control.
            if (!System.Diagnostics.Debugger.IsAttached)
            {
                // NOTE: This will allow the application to continue running after an exception has been thrown but not handled. 
                // For production applications this error handling should be replaced with something that will report the error to the website and stop the application.
                e.Handled = true;
                //ErrorWindow.CreateNew(e.ExceptionObject);
            }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
India India

Microsoft C# MVP (12-13)



Hey, I am Pranay Rana, working as a Team Leadin MNC. Web development in Asp.Net with C# and MS sql server are the experience tools that I have had for the past 5.5 years now.

For me def. of programming is : Programming is something that you do once and that get used by multiple for many years

You can visit my blog


StackOverFlow - http://stackoverflow.com/users/314488/pranay
My CV :- http://careers.stackoverflow.com/pranayamr

Awards:



Comments and Discussions