Click here to Skip to main content
15,565,020 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Overlay Tree view expander icon on the content Pin
SledgeHammer019-Apr-14 5:02
SledgeHammer019-Apr-14 5:02 
GeneralRe: Overlay Tree view expander icon on the content Pin
SledgeHammer019-Apr-14 5:04
SledgeHammer019-Apr-14 5:04 
QuestionSetting BitmapImage.UriSource in a XAML file read with XamlReader [VB][WPF] Pin
Jayme655-Apr-14 23:08
Jayme655-Apr-14 23:08 
QuestionHow can we integrate HTML Help files with Table Of Contents into an WPF application developing (C#.NET.) Pin
Adarsh Balachandran5-Apr-14 0:15
Adarsh Balachandran5-Apr-14 0:15 
AnswerRe: How can we integrate HTML Help files with Table Of Contents into an WPF application developing (C#.NET.) Pin
Gerry Schmitz7-Apr-14 13:04
mveGerry Schmitz7-Apr-14 13:04 
AnswerRe: DataTemplate selection using a property Pure XAML Pin
SledgeHammer013-Apr-14 14:13
SledgeHammer013-Apr-14 14:13 
QuestionUser Control Confusion Pin
Kevin Marois3-Apr-14 9:25
professionalKevin Marois3-Apr-14 9:25 
AnswerRe: User Control Confusion Pin
Richard Deeming3-Apr-14 11:23
mveRichard Deeming3-Apr-14 11:23 
OK, there's a couple of problems with your sample code which aren't helping:
  • In LookupComboControlViewModel, the People property passes the wrong property name to the RaisePropertyChanged method;
  • Your category IDs start at zero, which happens to be the default value of the _CategoryId field, so when you select the "Presidents" category, the people won't be loaded;


There might be a more elegant way to make this work, but for a quick hack you can use a property changed callback on your DependencyProperty to manually change the property on your DataContext:
C#
public CategoryModel SelectedCategory
{
    get { return (CategoryModel)GetValue(SelectecCategoryProperty); }
    set { SetValue(SelectecCategoryProperty, value); }
}

public static readonly DependencyProperty SelectedCategoryProperty = DependencyProperty.Register(
    "SelectedCategory", typeof(CategoryModel), typeof(LookupComboControl),
    new UIPropertyMetadata(null, SelectedCategoryChanged));

private static void SelectedCategoryChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
    var view = (LookupComboControl)d;
    var viewModel = (LookupComboControlViewModel)view.DataContext;
    var model = (CategoryModel)e.NewValue;

    viewModel.CategoryId = (model == null) ? 0 : model.Id;
}


I've updated your sample: http://1drv.ms/1j69N0P[^]



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: User Control Confusion Pin
Kevin Marois3-Apr-14 12:14
professionalKevin Marois3-Apr-14 12:14 
QuestionWPF Ribbon Control Pin
Sujit Keng2-Apr-14 22:51
Sujit Keng2-Apr-14 22:51 
AnswerRe: WPF Ribbon Control Pin
Naz_Firdouse8-Apr-14 4:07
Naz_Firdouse8-Apr-14 4:07 
QuestionToolTip is not fully visible Pin
SRKSHOME2-Apr-14 1:42
SRKSHOME2-Apr-14 1:42 
QuestionBind Grid Row's IsExpanded To Row's Data Object Pin
Kevin Marois31-Mar-14 13:41
professionalKevin Marois31-Mar-14 13:41 
QuestionUser Control Question Pin
Kevin Marois25-Mar-14 9:05
professionalKevin Marois25-Mar-14 9:05 
AnswerRe: User Control Question Pin
_Maxxx_2-Apr-14 19:39
professional_Maxxx_2-Apr-14 19:39 
GeneralRe: User Control Question Pin
Kevin Marois2-Apr-14 19:49
professionalKevin Marois2-Apr-14 19:49 
GeneralRe: User Control Question Pin
_Maxxx_2-Apr-14 20:36
professional_Maxxx_2-Apr-14 20:36 
GeneralRe: User Control Question Pin
Kevin Marois3-Apr-14 6:47
professionalKevin Marois3-Apr-14 6:47 
GeneralRe: User Control Question Pin
BubingaMan23-Apr-14 5:13
BubingaMan23-Apr-14 5:13 
QuestionPrefixing ListBoxItem index in DataTemplate Pin
Dominick Marciano22-Mar-14 22:33
professionalDominick Marciano22-Mar-14 22:33 
AnswerRe: Prefixing ListBoxItem index in DataTemplate Pin
SledgeHammer0123-Mar-14 10:22
SledgeHammer0123-Mar-14 10:22 
GeneralRe: Prefixing ListBoxItem index in DataTemplate Pin
Dominick Marciano25-Mar-14 5:42
professionalDominick Marciano25-Mar-14 5:42 
GeneralRe: Prefixing ListBoxItem index in DataTemplate Pin
SledgeHammer0125-Mar-14 5:55
SledgeHammer0125-Mar-14 5:55 
QuestionCustom Window WPF con Vb.Net Pin
Pablo Roberto Cuellar Ribera21-Mar-14 10:59
Pablo Roberto Cuellar Ribera21-Mar-14 10:59 
AnswerRe: Custom Window WPF con Vb.Net Pin
Kenneth Haugland21-Mar-14 11:11
mvaKenneth Haugland21-Mar-14 11:11 

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.