Click here to Skip to main content
15,893,594 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to convert a .txt file to return an array? c# Pin
Rob Philpott15-Jul-14 20:28
Rob Philpott15-Jul-14 20:28 
AnswerRe: how to convert a .txt file to return an array? c# Pin
OriginalGriff15-Jul-14 20:49
mveOriginalGriff15-Jul-14 20:49 
QuestionGet csv outputfil from file.msg Pin
Member 1092249815-Jul-14 5:32
Member 1092249815-Jul-14 5:32 
AnswerRe: Get csv outputfil from file.msg Pin
Rob Philpott15-Jul-14 6:07
Rob Philpott15-Jul-14 6:07 
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 
Hello I have a problem with update of binding of a label.
I have this simple class:

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;
    }

    private void BtnNextClick(object sender, RoutedEventArgs e)
    {
      for (int i = 0; i < 1000; i++)
      {
        Message = string.Format("Tested {0} of {1}", i, 1000);
        Thread.Sleep(10);
      }
    }
  }


I have in the xaml code a label with content binded to Message value

XML
<Label Name="lblHint" Content="{Binding Message}" HorizontalAlignment="Center" FontFamily="verdana" FontSize="11" FontWeight="Bold" Foreground="Black" Grid.ColumnSpan="2"></Label>



The problem is that when i launch the BtnNextClick function,i see the label updated only at the end of procedure,and what i would like is to see updated in every cycle the content of the label....
How can I do?
I think it's a problem between my form and the ui thread?

Thanks in advance

Best regards
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 
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 

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.