Results 1 to 5 of 5

Thread: [RESOLVED] MVVM: Populate a view (with listbox) when an item from another view (with listbox) is

Threaded View

  1. #1

    Thread Starter
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Resolved [RESOLVED] MVVM: Populate a view (with listbox) when an item from another view (with listbox) is

    I have a list of Topics, and for each topic there are some Examples. What I want to be able to do is that when a topic is selected then I will populate another view with all Examples for that selected topic. I'm still learning MVVM so not sure how to implement such.

    This is what I've got so far but I haven't figured out yet how to receive/set the _exampleViewModel via binding in XAML.
    Code:
    public TopicViewModel SelectedTopic
        {
            get { return _selectedTopic; }
            set
            {
                _selectedTopic = value;
                OnPropertyChanged("SelectedTopic");
    
                //refresh list of exercises
                if (_exampleViewModel != null)
                {
                    _exampleViewModel.RefreshExercises(_selectedTopic.ID);
                }
            }
        }
    Last edited by dee-u; May 14th, 2013 at 04:05 AM.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width