Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8046709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:52:40+00:00 2026-06-05T05:52:40+00:00

I need to show Splash Screen with Image & progress bar. In my application

  • 0

I need to show Splash Screen with Image & progress bar.

  1. In my application start up i have the code as below to show the main window.

         SplashScreenWindowViewModel vm = new SplashScreenWindowViewModel(); 
         AutoResetEvent ev = new AutoResetEvent(false); 
          Thread uiThread = new Thread(() =>
         {
            vm.Dispatcher = Dispatcher.CurrentDispatcher;
            ev.Set();
    
            Dispatcher.CurrentDispatcher.BeginInvoke((Action)delegate()
            {
                SplashScreenWindow splashScreenWindow = new SplashScreenWindow();
                splashScreenWindow = new SplashScreenWindow();
                splashScreenWindow.Show();
                splashScreenWindow.DataContext = vm;
                vm.InstigateWorkCommand.Execute(null);
    
            });
    
            Dispatcher.Run();
        });
          uiThread.SetApartmentState(ApartmentState.STA);
          uiThread.IsBackground = true;
          uiThread.Start();
          ev.WaitOne();
    
  2. In my main viewmodel i have code as below

    class MainviewModel : viewmodelbase
    {
    rivate string _message;
    private object content;
    private readonly BackgroundWorker worker;
    private readonly ICommand instigateWorkCommand;

        public SplashScreenWindowViewModel()
        {
    
            this.instigateWorkCommand = new
             RelayCommand(() => this.worker.RunWorkerAsync(), () => !this.worker.IsBusy);
            this.worker = new BackgroundWorker { WorkerReportsProgress = true };           
            this.worker.DoWork += this.DoWork;
            this.worker.ProgressChanged += this.ProgressChanged;
            _message = "0 % completed";
    
        }
    
    
    
        public ICommand InstigateWorkCommand
        {
    
            get { return this.instigateWorkCommand; }
        }
    
        private double _currentProgress;
        public double CurrentProgress        
        {
            get { return this._currentProgress; }
            set
            {
                if (this._currentProgress != value)
                {
    
                    this._currentProgress = value;                   
                    RaisePropertyChanged("CurrentProgress");
                }
            }
        }
        private int _progressMax;
        public int ProgressMax
        {
            get { return this._progressMax; }
    
            set
            {
                if(this._progressMax != value)
                {
                  this._progressMax = value;
                  RaisePropertyChanged("ProgressMax");
                }
    
            }
        }
    
        private void ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
          this.CurrentProgress = e.ProgressPercentage;
    
    
        }
    
        private void DoWork(object sender, DoWorkEventArgs e)
        {
    
           // calling my long running operation
           DAL.dotimeconsumingcode();
           worker.ReportProgress((int)e.argument);
    
        }
    
    
    
    
        public string Message
        {
            get
            {
                return _message;
            }
            set
            {
                if (Message == value) return;
                _message = value;
                RaisePropertyChanged("Message");
            }
        }
    
    
        public object Content
        {
            get
            {
                return content;
            }
            set
            {
                if (Content == value) return;
                content = value;
    
                RaisePropertyChanged("Content");
            }
        }
    
        public Dispatcher Dispatcher
        {
            get;
            set;
        }
    

    }

    MY UI has one user control with progress bar and one splash main window.
    when my long running operation is completed , my Main window(main application) is opened.
    //User Control

            <ProgressBar Height="27" Value="{Binding CurrentProgress, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"  Margin="53,162,57,0" Name="progressBar"  Grid.Row="1"
                 Maximum="{Binding Path=ProgressMax, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"    Visibility="{Binding ProgressVisibility}"  />
    

    //SplashWindow

      <localView:usercontrol/>
    

My Problem is

ProgressChangedevent is not firing and % completion is not showing up in the text block either. Please help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:52:43+00:00Added an answer on June 5, 2026 at 5:52 am

    You have not registered a complete handler and you are not calling progress properly.
    This sample from MSDN covers it all.

    BackGroundWorker

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to show splash screen on my application start for few seconds. Does
I want to make a splash screen in my application, for that i need
I need to show timestamp as shown below in my .Net application: 13/12/2007 5:04
I'm using WindowsFormsApplicationBase to show a splash screen. Now, when the main form is
I need show a notication modal window.. But since its a fluid layout the
I need to show a popup window before a query execution, show the time
I created my splash screen using the method mentioned here: http://delphi.about.com/od/formsdialogs/a/splashscreen.htm I need to
I actually try to add a Splash Screen to my WPF application. It is
I need to replace : with double backslash \\ but the code below is
I need show record from database. But I have a error: 'object' does not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.