locked
Clear or Refresh bindings of on combobox?

    Question

  •  private void Combo_Loaded(object sender, RoutedEventArgs e)
            {
                launchCategory();
            }
    
    
    private async void launchCategory()
            {
                try
                {                
                    Category.Source = categoryMusic.Category();
                }
                catch (Exception ex)
                {
                    var Dialog = new MessageDialog(ex.ToString(), "Error");
                    await Dialog.ShowAsync();
                }
            }
    
    
     private async void ListboxCategory_SelectionChanged(object sender, SelectionChangedEventArgs e)
            {
                try
                {
                    var Items = ((ListBox)sender).SelectedItem as ViewModel.CategoryMusic;
                    if(Items!=null)
                    {
                        When listboxCategory.selectedIndex !=-1 then clear item or refresh and loaded again binding of on combobox.
                    }
    
                }
                catch (Exception ex)
                {
                    var Dialog = new MessageDialog(ex.ToString(), "Error");
                    await Dialog.ShowAsync();
                }

    Note: Listbox and Combobox were laying in hub.


    Thursday, May 7, 2015 1:41 AM

All replies

  • Please explain what you'd like to accomplish with this post.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, May 7, 2015 3:05 PM
    Moderator