Click here to Skip to main content
15,890,185 members
Home / Discussions / WPF
   

WPF

 
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 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Adam_Dev29-May-12 22:10
Adam_Dev29-May-12 22:10 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Pete O'Hanlon29-May-12 22:43
mvePete O'Hanlon29-May-12 22:43 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Adam_Dev30-May-12 0:51
Adam_Dev30-May-12 0:51 
GeneralRe: INotifyPropertyChanged on Interface class property? Pin
Pete O'Hanlon30-May-12 1:17
mvePete O'Hanlon30-May-12 1:17 
Questionthe wpf added winform controls Pin
dengzn28-May-12 22:43
dengzn28-May-12 22:43 
AnswerRe: the wpf added winform controls Pin
Pete O'Hanlon28-May-12 23:01
mvePete O'Hanlon28-May-12 23:01 
AnswerRe: the wpf added winform controls Pin
Cracked-Down29-May-12 0:36
Cracked-Down29-May-12 0:36 
QuestionDirectshow in silverlight Pin
ebrahim rajabloo28-May-12 3:16
ebrahim rajabloo28-May-12 3:16 

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.