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

WPF

 
QuestionChange application language at Runtime Pin
sifi mohamed amine15-Apr-14 5:40
sifi mohamed amine15-Apr-14 5:40 
SuggestionRe: Change application language at Runtime Pin
Richard Deeming15-Apr-14 5:53
mveRichard Deeming15-Apr-14 5:53 
AnswerRe: Change application language at Runtime Pin
Andy41119-May-14 2:56
Andy41119-May-14 2:56 
QuestionLocalization in WPF MVVM Pin
sifi mohamed amine14-Apr-14 23:42
sifi mohamed amine14-Apr-14 23:42 
AnswerRe: Localization in WPF MVVM Pin
Vincent Beek16-Apr-14 6:57
Vincent Beek16-Apr-14 6:57 
QuestionUpdating Composition Tree from Visual Tree Pin
Ronald M. Martin14-Apr-14 12:18
Ronald M. Martin14-Apr-14 12:18 
QuestionHow to add all recommended icon sizes to WPF desktop application? Pin
Matt T Heffron14-Apr-14 11:49
professionalMatt T Heffron14-Apr-14 11:49 
AnswerRe: How to add all recommended icon sizes to WPF desktop application? Pin
Matt T Heffron14-Apr-14 13:44
professionalMatt T Heffron14-Apr-14 13:44 
QuestionHow to get TreeView SelectedItem/Value? Pin
BeeDev11-Apr-14 10:52
BeeDev11-Apr-14 10:52 
AnswerRe: How to get TreeView SelectedItem/Value? Pin
SledgeHammer0111-Apr-14 12:14
SledgeHammer0111-Apr-14 12:14 
GeneralRe: How to get TreeView SelectedItem/Value? Pin
BeeDev14-Apr-14 3:48
BeeDev14-Apr-14 3:48 
GeneralRe: How to get TreeView SelectedItem/Value? Pin
SledgeHammer0114-Apr-14 4:53
SledgeHammer0114-Apr-14 4:53 
AnswerRe: How to get TreeView SelectedItem/Value? Pin
Mycroft Holmes11-Apr-14 13:41
professionalMycroft Holmes11-Apr-14 13:41 
AnswerRe: How to get TreeView SelectedItem/Value? Pin
USAFHokie8016-Apr-14 8:55
USAFHokie8016-Apr-14 8:55 
AnswerRe: Overlay Tree view expander icon on the content Pin
SledgeHammer018-Apr-14 13:26
SledgeHammer018-Apr-14 13:26 
GeneralRe: Overlay Tree view expander icon on the content Pin
SledgeHammer019-Apr-14 4:02
SledgeHammer019-Apr-14 4:02 
GeneralRe: Overlay Tree view expander icon on the content Pin
SledgeHammer019-Apr-14 4:04
SledgeHammer019-Apr-14 4:04 
QuestionSetting BitmapImage.UriSource in a XAML file read with XamlReader [VB][WPF] Pin
Jayme655-Apr-14 22:08
Jayme655-Apr-14 22:08 
QuestionHow can we integrate HTML Help files with Table Of Contents into an WPF application developing (C#.NET.) Pin
Adarsh Balachandran4-Apr-14 23:15
Adarsh Balachandran4-Apr-14 23: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 12:04
mveGerry Schmitz7-Apr-14 12:04 
AnswerRe: DataTemplate selection using a property Pure XAML Pin
SledgeHammer013-Apr-14 13:13
SledgeHammer013-Apr-14 13:13 
QuestionUser Control Confusion Pin
Kevin Marois3-Apr-14 8:25
professionalKevin Marois3-Apr-14 8:25 
AnswerRe: User Control Confusion Pin
Richard Deeming3-Apr-14 10:23
mveRichard Deeming3-Apr-14 10: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 11:14
professionalKevin Marois3-Apr-14 11:14 
QuestionWPF Ribbon Control Pin
Sujit Keng2-Apr-14 21:51
Sujit Keng2-Apr-14 21:51 

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.