Thursday, May 7, 2015

How way to check "SelectionChanged" of listview,... inside hub?

There are listbox and combobox.

Listbox


private async void List_SeletedChanged (object sender, SelectionChangedEventArgs e)
{ var Items = ((ListBox)sender).SelectedItem as ViewModel.CategoryMusic; if(Items!=null) { if (Items.Title != null) { IdAb=Items.IdAlbum;
checkAb=true; } } }
Combobox
private async void Combo_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                var Items = ((ComboBox)sender).SelectedItem as ViewModel.Geners;
                if (Items != null)
                {
                    if (Items.Id != null)
                    {
                        if (checkAb)
                        {
                            Launch.Source = await ProductComand.GetTopProduct(Items.Id, IdAb);
                        }

<ItemsControl x:Name="LstMu"
Background="Transparent" Foreground="Black"
FontFamily="Segoe WP Light" FontSize="15"
ItemsSource="{Binding Source={StaticResource Launch}" >
All code were laying inside hub.
The first on loading on listbox then It be Ok.Because of Listbox will  take seletedItems valueby default and combobox also take seletecItems value by default

I got a problem is that when I changed "SelectedItem" on listbox then it could not access data  to Launch. I must changed value of combobox on xaml then It could access data to Launch.

I want if no change on combobox but changed on listbox then it could access data to Launch( keep seletedItem on combobox on the first  of app are loading.).

I don't understand this part so I can't explain as clearly.





No comments:

Post a Comment