This question is locked. New answers and comments are not allowed.
Hello!
I found one strange behavior connected with RadDataBoundListBox (WP7). In my project I have bound ViewModel to the View (using MVVMLight). This listbox has set DataVirtualization to OnDemandAutomatic. The DataRequest event is send to VM via EventToCommand behavior. I found that this event is called even from the old instance of listbox (?).
Here is an example:
MainPage
ListBoxPage
here the navigation:
MainPage -> ListBoxPage -> back to MainPage -> go to ListBoxPage ...
and here I found that DataRequested event is fired from the new and old instances.
Some Logs from output:
ListBoxPage Constructor!
Got Tag = 1
ListBoxPage Constructor!
Got Tag = 1
Got Tag = 2
ListBoxPage Constructor!
Got Tag = 3
Got Tag = 1
Got Tag = 2
Right now I solved it this way:
protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
{
if (e.NavigationMode == System.Windows.Navigation.NavigationMode.Back)
FriendsList.DataVirtualizationMode = DataVirtualizationMode.None;
base.OnNavigatedFrom(e);
}
but this solution is not satisfying me. Any help will be appreciated.
Kind regards,
Karol
I found one strange behavior connected with RadDataBoundListBox (WP7). In my project I have bound ViewModel to the View (using MVVMLight). This listbox has set DataVirtualization to OnDemandAutomatic. The DataRequest event is send to VM via EventToCommand behavior. I found that this event is called even from the old instance of listbox (?).
Here is an example:
MainPage
ListBoxPage
here the navigation:
MainPage -> ListBoxPage -> back to MainPage -> go to ListBoxPage ...
and here I found that DataRequested event is fired from the new and old instances.
Some Logs from output:
ListBoxPage Constructor!
Got Tag = 1
ListBoxPage Constructor!
Got Tag = 1
Got Tag = 2
ListBoxPage Constructor!
Got Tag = 3
Got Tag = 1
Got Tag = 2
Right now I solved it this way:
protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
{
if (e.NavigationMode == System.Windows.Navigation.NavigationMode.Back)
FriendsList.DataVirtualizationMode = DataVirtualizationMode.None;
base.OnNavigatedFrom(e);
}
but this solution is not satisfying me. Any help will be appreciated.
Kind regards,
Karol