Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Samir Ibrahim
  Where is Samir Ibrahim?
 Chekka
 Lebanon
 Samir Ibrahim
 To: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 Tags
Subject: RE: VFP Wait Window in .NET
Thread ID: 415928 Message ID: 416064 # Views: 39 # Ratings: 0
Version: Unknown Category: .NET
Date: Saturday, December 20, 2014 9:46:52 AM         
   


> > Hi Stefan
> >
> > I did not hit Async / Await during my search, and as I read fastly about it, it could be the answer
> >
> > When you asked me if my project is WPF or Winform, that gives me an idea of trying to make the WaitWindow in WPF and call it in Winform.
> >
> > Actually your answer open the doors for multiple solutions.
> >
> > If I came up with something, I will post here
> >
> > Thanks for your help.
>
>
> Hi Samir,
>
> Agreed, I also like Async / Await much better than the older threading approaches.
>
> FWIW, in WPF I'm often using a "BusyIndicator" element directly integrated in the UI instead of having a separate "WaitWindow" Form/Window.
> Like the one that ships with the free "Extended WPF ToolkitCommunity Edition"
> https://wpftoolkit.codeplex.com/wikipage?title=BusyIndicator
>
> That BusyIndicator would be on top of its UI area, i.e. on top of the entire Window/Form or a TabItem/Pageframe.Page or UserControl/Container respectively, or perhaps even a single control like a ComboBox.
>
> Its IsVisible property would be bound to a boolean ViewModel property "IsBusy" or similar.
> As soon as the ViewModel is being asked for something like retrieving more or less big data, it starts by changing IsBusy=true and raises the PropertyChangedEvent("IsBusy").
>
> That way, all UIElement properties being bound to ViewModel.IsBusy automatically receive the event, "to whom it may concern", the BusyIndicator gets visible, slight delay and transparency animation, and starts doing something like starting an indeterminate ProgressBar or a little green turning wheel and showing some "Please wait..." content.
>
> In the same moment the async / await procedure starts, and when it's finished, the IsBusy property is being reset.
> That way, the UI "View" is aware of the ViewModel, but the ViewModel does not need to "know" anything about the "View"
>
>
> Regards
> -Stefan
>
>
>
>     public abstract class ViewModelBase : INotifyPropertyChanged
>     {
> ...
> 
>         #region INotifyPropertyChanged
> 
>         /// <summary>
>         /// NotifyPropertyChanged
>         /// </summary>
>         /// 
>         protected void raisePropertyChanged(string propertyName)
>         {
>             if (PropertyChanged != null)
>                 PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
>         }
> 
>         public event PropertyChangedEventHandler PropertyChanged;
> 
>         #endregion INotifyPropertyChanged
> 
>         #region IsBusy
> 
>         public bool IsBusy { get; private set; }
> 
>         protected void setBusyMode(bool busy)
>         {
>             IsBusy = busy;
>             raisePropertyChanged("IsBusy");
>         }
> 
>         #endregion IsBusy
> 


Sorry for the late to answer, I was busy converting VFP code to VB.NET and finally I managed to made Locate() Continue() work in vb.net.

As usual, the good thing it works, the bad thing I did not like it (lol)

Thank you Stefan for this. I will try this weekend your approach and I will post back where I reach.


Samir Ibrahim

ENTIRE THREAD

VFP Wait Window in .NET Posted by Samir Ibrahim @ 12/16/2014 6:00:28 PM
RE: VFP Wait Window in .NET Posted by Stefan Wuebbe @ 12/16/2014 8:28:03 PM
RE: VFP Wait Window in .NET Posted by Samir Ibrahim @ 12/17/2014 9:11:05 AM
RE: VFP Wait Window in .NET Posted by Stefan Wuebbe @ 12/17/2014 5:34:18 PM
RE: VFP Wait Window in .NET Posted by Samir Ibrahim @ 12/20/2014 9:46:52 AM
RE: VFP Wait Window in .NET Posted by Stefan Wuebbe @ 12/21/2014 7:38:52 AM
RE: VFP Wait Window in .NET Posted by Samir Ibrahim @ 12/21/2014 7:49:51 PM
RE: VFP Wait Window in .NET Posted by Stefan Wuebbe @ 12/22/2014 10:55:35 AM