Click here to Skip to main content
12,695,624 members (26,784 online)

Silverlight / WPF

 
GeneralRe: How to dynamically load Theme in Application? Pin
Pete O'Hanlon17-Oct-12 4:07
protectorPete O'Hanlon17-Oct-12 4:07 
GeneralRe: How to dynamically load Theme in Application? Pin
Wayne Gaylard17-Oct-12 4:10
mentorWayne Gaylard17-Oct-12 4:10 
QuestionProblem in flow direction when value is right to left in Telerik Pin
Hossein Khalaj3-Oct-12 21:19
memberHossein Khalaj3-Oct-12 21:19 
AnswerRe: Problem in flow direction when value is right to left in Telerik Pin
Pete O'Hanlon3-Oct-12 21:21
protectorPete O'Hanlon3-Oct-12 21:21 
GeneralRe: Problem in flow direction when value is right to left in Telerik Pin
Hossein Khalaj3-Oct-12 21:23
memberHossein Khalaj3-Oct-12 21:23 
GeneralRe: Problem in flow direction when value is right to left in Telerik Pin
Hossein Khalaj4-Oct-12 23:48
memberHossein Khalaj4-Oct-12 23:48 
Questionbinding: not work property Mode=TwoWay and UpdateSourceTrigger Pin
dominioYP3-Oct-12 1:25
memberdominioYP3-Oct-12 1:25 
AnswerRe: binding: not work property Mode=TwoWay and UpdateSourceTrigger Pin
Pete O'Hanlon3-Oct-12 1:54
protectorPete O'Hanlon3-Oct-12 1:54 
The item you are editing has to notify WPF that it has changed. Just because you have an ObservableCollection, it doesn't mean that your application will be able to respond to changed inside the items that make up the collection. To enable this, you need so expose those items to the binding mechanism as well - fortunately, this is incredibly easy to do.

Change your ListBoxData class so that it (or an ancestor that you choose) implements INotifyPropertyChanged. Then, add the ability to raise a change when nome changes. For example:
public class ListBoxData : INotifyPropertyChanged
{
  public event PropertyChangedEventHandler PropertyChanged;
  private string _nome;

  public string nome 
  {
    get { return _nome; }
    set
    {
      if (_nome != value)
      {
        _nome = value;
        OnChanged("nome");
      }
    }
  }

  private void OnChanged(string propertyName)
  {
    PropertyChangedEventHandler handler = PropertyChanged;
    if (handler != null)
    {
      handler(this, new PropertyChangedEventArgs(propertyName));
    }
  }
}
Now, whenever you change nome, the PropertyChanged event is raised - and the WPF binding mechanism knows how to handle that. Changes will be reflected in the UI now.

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos


CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

GeneralRe: binding: not work property Mode=TwoWay and UpdateSourceTrigger Pin
dominioYP3-Oct-12 23:24
memberdominioYP3-Oct-12 23:24 
QuestionHow do I reference embedded resources in Xaml? Pin
Gil Yoder2-Oct-12 19:57
memberGil Yoder2-Oct-12 19:57 
AnswerRe: How do I reference embedded resources in Xaml? Pin
Gil Yoder4-Oct-12 8:52
memberGil Yoder4-Oct-12 8:52 
Questionsilverlight Pin
rameshchetu30-Sep-12 10:12
memberrameshchetu30-Sep-12 10:12 
AnswerRe: silverlight Pin
Pete O'Hanlon30-Sep-12 10:45
protectorPete O'Hanlon30-Sep-12 10:45 
AnswerRe: silverlight Pin
Kenneth Haugland30-Sep-12 23:36
memberKenneth Haugland30-Sep-12 23:36 
AnswerRe: silverlight Pin
Abhinav S3-Oct-12 21:40
mvpAbhinav S3-Oct-12 21:40 
QuestionCheckk For WCF Service Running & Exit Pin
Kevin Marois29-Sep-12 10:51
memberKevin Marois29-Sep-12 10:51 
QuestionSendMessage in C# WPF Pin
dominioYP28-Sep-12 7:11
memberdominioYP28-Sep-12 7:11 
AnswerRe: SendMessage in C# WPF Pin
Pete O'Hanlon29-Sep-12 11:30
protectorPete O'Hanlon29-Sep-12 11:30 
GeneralRe: SendMessage in C# WPF Pin
dominioYP29-Sep-12 13:08
memberdominioYP29-Sep-12 13:08 
GeneralRe: SendMessage in C# WPF Pin
Pete O'Hanlon29-Sep-12 21:45
protectorPete O'Hanlon29-Sep-12 21:45 
QuestionNew to .net/ previous programming background Pin
ljv_az27-Sep-12 9:29
memberljv_az27-Sep-12 9:29 
AnswerRe: New to .net/ previous programming background Pin
Richard MacCutchan27-Sep-12 10:47
mvpRichard MacCutchan27-Sep-12 10:47 
GeneralRe: New to .net/ previous programming background Pin
ljv_az27-Sep-12 11:00
memberljv_az27-Sep-12 11:00 
GeneralRe: New to .net/ previous programming background Pin
Richard MacCutchan27-Sep-12 22:16
mvpRichard MacCutchan27-Sep-12 22:16 
GeneralRe: New to .net/ previous programming background Pin
ljv_az28-Sep-12 9:14
memberljv_az28-Sep-12 9:14 

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.


Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 17 Jan 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid