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

WPF

 
GeneralRe: WPF - Bind IsEnabled To Method On VM Pin
Kevin Marois20-Jan-13 8:47
professionalKevin Marois20-Jan-13 8:47 
QuestionWPF - Sync Combox Pin
Kevin Marois12-Jan-13 15:19
professionalKevin Marois12-Jan-13 15:19 
AnswerRe: WPF - Sync Combox Pin
Mycroft Holmes13-Jan-13 0:50
professionalMycroft Holmes13-Jan-13 0:50 
GeneralRe: WPF - Sync Combox Pin
Kevin Marois13-Jan-13 17:24
professionalKevin Marois13-Jan-13 17:24 
GeneralRe: WPF - Sync Combox Pin
Mycroft Holmes14-Jan-13 0:11
professionalMycroft Holmes14-Jan-13 0:11 
GeneralRe: WPF - Sync Combox Pin
Kevin Marois14-Jan-13 5:25
professionalKevin Marois14-Jan-13 5:25 
GeneralRe: WPF - Sync Combox Pin
SledgeHammer0114-Jan-13 9:34
SledgeHammer0114-Jan-13 9:34 
GeneralRe: WPF - Sync Combox Pin
Kevin Marois23-Jan-13 17:41
professionalKevin Marois23-Jan-13 17:41 
Ok, I don't know what's wrong, but I still cannot get this to work...

My combo is bound to an ObservableCollection<lookupmodel>, as in:

private ObservableCollection<LookupModel> _Departments;
public ObservableCollection<LookupModel> Departments
{
    get { return _Departments; }
    set
    {
        if (_Departments != value)
        {
            _Departments = value;
            RaisePropertyChanged("Departments");
        }
    }
}

private LookupModel _SelectedDepartment;
public LookupModel SelectedDepartment
{
    get { return _SelectedDepartment; }
    set
    {
        if (_SelectedDepartment != value)
        {
            _SelectedDepartment = value;
            RaisePropertyChanged("SelectedDepartment");
        }
    }
}


Here is the lookup model:

public class LookupModel : _BaseModel
{
    private int _Id = 0;
    public int Id
    {
        get { return _Id; }
        set
        {
            if (_Id != value)
            {
                _Id = value;
                RaisePropertyChanged("Id");
            }
        }
    }

    private string _Caption = string.Empty;
    public string Caption 
    {
        get { return _Caption; }
        set
        {
            if (_Caption != value)
            {
                _Caption = value;
                RaisePropertyChanged("Caption");
            }
        }
    }
}


And in the vie model I have:

SelectedDepartment = Job.Department;


Job.Department is an instance of a lookup model with the selected department in it.

When I run this, the department is not selected in the combo.

What am I doing wrong here???

Thanks
If it's not broken, fix it until it is

QuestionStyle From Resource File Not Being Applied Pin
Kevin Marois12-Jan-13 10:20
professionalKevin Marois12-Jan-13 10:20 
AnswerRe: Style From Resource File Not Being Applied Pin
Richard MacCutchan12-Jan-13 23:44
mveRichard MacCutchan12-Jan-13 23:44 
GeneralRe: Style From Resource File Not Being Applied Pin
Mycroft Holmes13-Jan-13 0:45
professionalMycroft Holmes13-Jan-13 0:45 
GeneralRe: Style From Resource File Not Being Applied Pin
Richard MacCutchan13-Jan-13 1:24
mveRichard MacCutchan13-Jan-13 1:24 
GeneralRe: Style From Resource File Not Being Applied Pin
Kevin Marois13-Jan-13 10:58
professionalKevin Marois13-Jan-13 10:58 
QuestionRoutedEvent vs AttachedEvent - Syntax difference only? Confused Pin
devvvy9-Jan-13 20:05
devvvy9-Jan-13 20:05 
QuestionHow to play an Audio File After another has Finished in WPF MediaElement Pin
Vimalsoft(Pty) Ltd4-Jan-13 3:58
professionalVimalsoft(Pty) Ltd4-Jan-13 3:58 
AnswerRe: How to play an Audio File After another has Finished in WPF MediaElement Pin
Pete O'Hanlon4-Jan-13 4:13
mvePete O'Hanlon4-Jan-13 4:13 
GeneralRe: How to play an Audio File After another has Finished in WPF MediaElement Pin
Vimalsoft(Pty) Ltd4-Jan-13 6:08
professionalVimalsoft(Pty) Ltd4-Jan-13 6:08 
QuestionWPF tutorial book website pdf Pin
David C# Hobbyist.1-Jan-13 10:44
professionalDavid C# Hobbyist.1-Jan-13 10:44 
AnswerRe: WPF tutorial book website pdf Pin
Richard MacCutchan1-Jan-13 22:31
mveRichard MacCutchan1-Jan-13 22:31 
GeneralRe: WPF tutorial book website pdf Pin
David C# Hobbyist.2-Jan-13 1:47
professionalDavid C# Hobbyist.2-Jan-13 1:47 
GeneralRe: WPF tutorial book website pdf Pin
Pete O'Hanlon2-Jan-13 5:48
mvePete O'Hanlon2-Jan-13 5:48 
GeneralRe: WPF tutorial book website pdf Pin
Richard MacCutchan2-Jan-13 6:09
mveRichard MacCutchan2-Jan-13 6:09 
GeneralRe: WPF tutorial book website pdf Pin
Pete O'Hanlon2-Jan-13 6:10
mvePete O'Hanlon2-Jan-13 6:10 
AnswerRe: WPF tutorial book website pdf Pin
Abhinav S2-Jan-13 2:21
Abhinav S2-Jan-13 2:21 
GeneralRe: WPF tutorial book website pdf Pin
David C# Hobbyist.2-Jan-13 7:08
professionalDavid C# Hobbyist.2-Jan-13 7:08 

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.