Click here to Skip to main content
15,910,083 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Required field Validation in WPF Pin
Unnikrishnan_S_N3-Jul-12 2:44
Unnikrishnan_S_N3-Jul-12 2:44 
QuestionNot able to drag and drop WPF controls on to window in Visual Studio 2008 Pin
Anurag Sinha V4-Jun-12 0:25
Anurag Sinha V4-Jun-12 0:25 
AnswerRe: Not able to drag and drop WPF controls on to window in Visual Studio 2008 Pin
Abhinav S5-Jun-12 0:47
Abhinav S5-Jun-12 0:47 
GeneralRe: Not able to drag and drop WPF controls on to window in Visual Studio 2008 Pin
Anurag Sinha V5-Jun-12 2:56
Anurag Sinha V5-Jun-12 2:56 
QuestionSilverlight client 4.0 application listboxs not working with the new Sliverlight 5.1 client Pin
Steve Holdorf3-Jun-12 12:21
Steve Holdorf3-Jun-12 12:21 
AnswerRe: Silverlight client 4.0 application listboxs not working with the new Sliverlight 5.1 client Pin
vinodkrebc7-Jun-12 0:04
vinodkrebc7-Jun-12 0:04 
QuestionWhich platform for a simple platform game to play by web rend erer ? Pin
EternallyConfuzzled31-May-12 22:28
EternallyConfuzzled31-May-12 22:28 
AnswerRe: Which platform for a simple platform game to play by web rend erer ? Pin
Abhinav S3-Jun-12 19:33
Abhinav S3-Jun-12 19:33 
QuestionComboBox MVVM Issue Pin
wasimsharp31-May-12 21:29
wasimsharp31-May-12 21:29 
AnswerRe: ComboBox MVVM Issue Pin
Alisaunder2-Jun-12 6:24
Alisaunder2-Jun-12 6:24 
QuestionWPF TreeView jumps up Pin
Mc_Topaz30-May-12 1:09
Mc_Topaz30-May-12 1:09 
AnswerRe: WPF TreeView jumps up Pin
Gerry Schmitz30-May-12 8:21
mveGerry Schmitz30-May-12 8:21 
QuestionSet webcam brightness in Silverlight Pin
ebrahim rajabloo29-May-12 19:28
ebrahim rajabloo29-May-12 19:28 
QuestionINotifyPropertyChanged on Interface class property? Pin
Adam_Dev29-May-12 1:02
Adam_Dev29-May-12 1:02 
AnswerRe: INotifyPropertyChanged on Interface class property? Pin
Pete O'Hanlon29-May-12 2:26
mvePete O'Hanlon29-May-12 2:26 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Adam_Dev29-May-12 2:35
Adam_Dev29-May-12 2:35 
Hi Pete

In my ViewModelBase I have an instance of the interface, called MyService.

So then in my actual ViewModel I have the property, ErrorStatus which is what I am binding to in XAML:
C#
private ErrorStatus _errorStatus;
public ErrorStatus ErrorStatus
{
    get { return _errorStatus; }
    set
    {
        if (_errorStatus != value)
        {
            _errorStatus = value;
            RaisePropertyChanged("ErrorStatus");
        }
    }
}


I am also creating an event handler in my viewmodel for property changes in the interface.

C#
MyService.PropertyChanged += MyService_PropertyChanged;


C#
private void MyService_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
            switch (e.PropertyName)
            {
                case "ServiceStatus":
                    ErrorStatus = MyService.ServiceStatus;
                    break;
            }
}


Would this be the correct approach or should I just create a public property for the viewmodelbase interface instance and bind to the properties through that?

modified 29-May-12 8:52am.

GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Pete O'Hanlon29-May-12 2:49
mvePete O'Hanlon29-May-12 2:49 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Adam_Dev29-May-12 2:51
Adam_Dev29-May-12 2:51 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Pete O'Hanlon29-May-12 3:10
mvePete O'Hanlon29-May-12 3:10 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Adam_Dev29-May-12 3:21
Adam_Dev29-May-12 3:21 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Pete O'Hanlon29-May-12 3:30
mvePete O'Hanlon29-May-12 3:30 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Adam_Dev29-May-12 3:46
Adam_Dev29-May-12 3:46 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Pete O'Hanlon29-May-12 4:00
mvePete O'Hanlon29-May-12 4:00 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Adam_Dev29-May-12 4:22
Adam_Dev29-May-12 4:22 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Pete O'Hanlon29-May-12 22:03
mvePete O'Hanlon29-May-12 22:03 

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.