Click here to Skip to main content
15,887,214 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: WPF Reporting Question Pin
Kevin Marois24-Sep-14 16:00
professionalKevin Marois24-Sep-14 16:00 
QuestionForm with ComboBoxes bound to the same source. Pin
cjb11016-Sep-14 2:45
cjb11016-Sep-14 2:45 
AnswerRe: Form with ComboBoxes bound to the same source. Pin
Pete O'Hanlon16-Sep-14 3:16
mvePete O'Hanlon16-Sep-14 3:16 
GeneralRe: Form with ComboBoxes bound to the same source. Pin
cjb11016-Sep-14 3:37
cjb11016-Sep-14 3:37 
GeneralRe: Form with ComboBoxes bound to the same source. Pin
Pete O'Hanlon16-Sep-14 6:25
mvePete O'Hanlon16-Sep-14 6:25 
GeneralRe: Form with ComboBoxes bound to the same source. Pin
cjb11017-Sep-14 22:05
cjb11017-Sep-14 22:05 
AnswerRe: Form with ComboBoxes bound to the same source. Pin
cjb11022-Sep-14 4:29
cjb11022-Sep-14 4:29 
AnswerSubscribing to the PropertyChangedEventHandler of a class in a List from the class holding the List (solved, sort of...) Pin
GuyThiebaut14-Sep-14 1:25
professionalGuyThiebaut14-Sep-14 1:25 
I have a NotificationInformation class which contains properties together with property changed events:

C#
public string EmailUser
{

    get { return _emailUser; }
    set
    {

        _emailUser = value;
        OnPropertyChanged("EmailUser");

    }

}


The NotificationInformationRepository class contains the NotificationInformation classes in a List of NotificationInformation classes (List<NotificationInformation>)

When OnPropertyChanged fires on a NotificationInformation instance I want to be able to serialize the NotificationInformationRepository data in the List.

I have the serialization working correctly - my question is how do I go about subscribing to or picking up the OnPropertyChanged events from within the NotificationInformationRepository class?
I realise this is a basic WPF question but I am feeling dumb this weekend being unable to code this.


-----------------------------------------------------------------------------------------------------
Solution:

In NotificationInformation I have declared a delegate:
C#
public delegate void ItemChanged();
[field: NonSerialized]
public ItemChanged ItemHasChanged;


public NotificationInformation(ItemChanged _itemChanged)
{

    ItemHasChanged = _itemChanged;

}


public string EmailUser
{

    get { return _emailUser; }
    set
    {

        _emailUser = value;
        OnPropertyChanged("EmailUser");
        ItemHasChanged();

    } 

}


When I add a NotificationInformation to the NotificationInformationRepository List I pass in a reference to a method in NotificationInformationRepository that is used as the delegate.

It's not pretty Frown | :(
“That which can be asserted without evidence, can be dismissed without evidence.”

― Christopher Hitchens

GeneralRe: Subscribing to the PropertyChangedEventHandler of a class in a List from the class holding the List (solved, sort of...) Pin
SledgeHammer0114-Sep-14 9:41
SledgeHammer0114-Sep-14 9:41 
GeneralRe: Subscribing to the PropertyChangedEventHandler of a class in a List from the class holding the List (solved, sort of...) Pin
GuyThiebaut14-Sep-14 10:06
professionalGuyThiebaut14-Sep-14 10:06 
QuestionWPF Reporting Pin
Kevin Marois9-Sep-14 11:21
professionalKevin Marois9-Sep-14 11:21 
AnswerRe: WPF Reporting Pin
Christian Amado10-Sep-14 5:14
professionalChristian Amado10-Sep-14 5:14 
GeneralRe: WPF Reporting Pin
Kevin Marois15-Oct-14 6:26
professionalKevin Marois15-Oct-14 6:26 
AnswerRe: WPF Reporting Pin
Pete O'Hanlon10-Sep-14 5:57
mvePete O'Hanlon10-Sep-14 5:57 
GeneralRe: WPF Reporting Pin
Kevin Marois21-Oct-14 5:56
professionalKevin Marois21-Oct-14 5:56 
GeneralRe: WPF Reporting Pin
Pete O'Hanlon21-Oct-14 6:05
mvePete O'Hanlon21-Oct-14 6:05 
GeneralRe: WPF Reporting Pin
Kevin Marois21-Oct-14 6:16
professionalKevin Marois21-Oct-14 6:16 
GeneralRe: WPF Reporting Pin
Pete O'Hanlon21-Oct-14 6:18
mvePete O'Hanlon21-Oct-14 6:18 
GeneralRe: WPF Reporting Pin
Kevin Marois21-Oct-14 6:20
professionalKevin Marois21-Oct-14 6:20 
AnswerRe: WPF Reporting Pin
Duncan Edwards Jones21-Oct-14 5:59
professionalDuncan Edwards Jones21-Oct-14 5:59 
AnswerRe: WPF Reporting Pin
Pete O'Hanlon21-Oct-14 7:45
mvePete O'Hanlon21-Oct-14 7:45 
AnswerRe: WPF Reporting Pin
Richard J Foster22-Oct-14 5:55
Richard J Foster22-Oct-14 5:55 
AnswerRe: Textblock with autoscrolling Pin
Richard Deeming5-Sep-14 5:24
mveRichard Deeming5-Sep-14 5:24 
QuestionWPF TreeView ToolTip Problems Pin
Kevin Marois4-Sep-14 7:51
professionalKevin Marois4-Sep-14 7:51 
AnswerRe: WPF TreeView ToolTip Problems Pin
SledgeHammer016-Sep-14 9:04
SledgeHammer016-Sep-14 9:04 

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.