Click here to Skip to main content
15,881,882 members
Home / Discussions / C#
   

C#

 
GeneralRe: Get csv outputfil from file.msg Pin
Member 1092249815-Jul-14 12:09
Member 1092249815-Jul-14 12:09 
GeneralRe: Get csv outputfil from file.msg Pin
Rob Philpott15-Jul-14 20:30
Rob Philpott15-Jul-14 20:30 
GeneralRe: Get csv outputfil from file.msg Pin
Member 1092249821-Jul-14 23:04
Member 1092249821-Jul-14 23:04 
QuestionINotifyPropertyChanged binding label problem during update in function Pin
massisoda15-Jul-14 4:42
massisoda15-Jul-14 4:42 
AnswerRe: INotifyPropertyChanged binding label problem during update in function Pin
Pete O'Hanlon15-Jul-14 5:18
mvePete O'Hanlon15-Jul-14 5:18 
GeneralRe: INotifyPropertyChanged binding label problem during update in function Pin
massisoda15-Jul-14 5:21
massisoda15-Jul-14 5:21 
GeneralRe: INotifyPropertyChanged binding label problem during update in function Pin
Pete O'Hanlon15-Jul-14 5:24
mvePete O'Hanlon15-Jul-14 5:24 
GeneralRe: INotifyPropertyChanged binding label problem during update in function Pin
massisoda16-Jul-14 1:48
massisoda16-Jul-14 1:48 
I have tried but unfortunately using task don't solve my problem...
Because my code is a little bit different of what i wrote...

With this code the update of the label start only when all the iterations of the for (for (int j = 0; j < 10; j++)) are completed

C#
public partial class frTest : INotifyPropertyChanged
  {
    private string _message;
    public string Message
    {
      private set
      {
        _message = value;
        OnPropertyChanged("Message");
      }
      get
      {
        return _message;
      }
    }

    public event PropertyChangedEventHandler PropertyChanged;

    protected virtual void OnPropertyChanged(string propertyName = null)
    {
      PropertyChangedEventHandler handler = PropertyChanged;
      if (handler != null)
      {
        handler(this, new PropertyChangedEventArgs(propertyName));
      }
    }

    public frTest()
    {
      InitializeComponent();
      DataContext = this;
    }

    private void WindowLoaded(object sender, RoutedEventArgs e)
    {
      Message = "test";
      txtDevQty.Text = "1000";
      txtDevQty.TextAlignment = TextAlignment.Center;
      txtDevQty.IsEnabled = false;
    }

    public void DoSomething()
    {
      var a = 0;

      for (int i = 0; i < 2000000; i++)
      {
        a++;
      }
    }    

    private void BtnNextClick(object sender, RoutedEventArgs e)
    {
        for (int j = 0; j < 10; j++)
        {
          DoSomething();

          Task.Factory.StartNew(() =>
          {

            try
            {
              for (int i = 0; i < 1000; i++)
              {
                Message = string.Format("Tested {0} of {1}", i, 1000);
                Thread.Sleep(10);
              }
            }
            catch (Exception ex)
            {

            }
          });
        }
    }
  }

GeneralRe: INotifyPropertyChanged binding label problem during update in function Pin
Pete O'Hanlon16-Jul-14 1:53
mvePete O'Hanlon16-Jul-14 1:53 
GeneralRe: INotifyPropertyChanged binding label problem during update in function Pin
massisoda16-Jul-14 2:00
massisoda16-Jul-14 2:00 
GeneralRe: INotifyPropertyChanged binding label problem during update in function Pin
Pete O'Hanlon16-Jul-14 2:22
mvePete O'Hanlon16-Jul-14 2:22 
QuestionShowDialog doesn't make form modal Pin
Don Guy15-Jul-14 4:34
Don Guy15-Jul-14 4:34 
AnswerRe: ShowDialog doesn't make form modal Pin
Eddy Vluggen15-Jul-14 5:28
professionalEddy Vluggen15-Jul-14 5:28 
QuestionTo create reports Pin
stokkee15-Jul-14 2:19
stokkee15-Jul-14 2:19 
AnswerRe: To create reports Pin
Simon_Whale15-Jul-14 3:22
Simon_Whale15-Jul-14 3:22 
AnswerRe: To create reports Pin
deenn22-Jul-14 2:26
deenn22-Jul-14 2:26 
Questionreading magnetic card stripe Pin
Jassim Rahma15-Jul-14 1:22
Jassim Rahma15-Jul-14 1:22 
AnswerRe: reading magnetic card stripe Pin
OriginalGriff15-Jul-14 1:31
mveOriginalGriff15-Jul-14 1:31 
GeneralRe: reading magnetic card stripe Pin
Jassim Rahma15-Jul-14 1:35
Jassim Rahma15-Jul-14 1:35 
GeneralRe: reading magnetic card stripe Pin
OriginalGriff15-Jul-14 1:38
mveOriginalGriff15-Jul-14 1:38 
GeneralRe: reading magnetic card stripe Pin
Jassim Rahma15-Jul-14 1:39
Jassim Rahma15-Jul-14 1:39 
GeneralRe: reading magnetic card stripe Pin
Pete O'Hanlon15-Jul-14 1:49
mvePete O'Hanlon15-Jul-14 1:49 
AnswerRe: reading magnetic card stripe Pin
Gerry Schmitz15-Jul-14 9:18
mveGerry Schmitz15-Jul-14 9:18 
QuestionC# , Websocket -HTTPS Pin
sgeorge10615-Jul-14 0:49
sgeorge10615-Jul-14 0:49 
AnswerRe: C# , Websocket -HTTPS Pin
Pete O'Hanlon15-Jul-14 1:45
mvePete O'Hanlon15-Jul-14 1:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.