Hi,
thank's for all xour help my listbox ist fine, but one more question. I have a EventSetter on my ListBoxItem
Code:
But how do i get the ViewModel? I tried Contact myContact = e.OriginalSource as Contact, but myContact is null? How do i get Values of my doubleclicked ListboxItem as my ViewModel?
Thanks
Regards
Rene
thank's for all xour help my listbox ist fine, but one more question. I have a EventSetter on my ListBoxItem
<
EventSetter
Event
=
"MouseDoubleClick"
Handler
=
"ListBoxItem_MouseDoubleClick"
/>
Code:
void ListBoxItem_MouseDoubleClick(object sender, RoutedEventArgs e)
{
Frame pageFrame = null;
pageFrame = helper.FindChild<
Frame
>(Application.Current.MainWindow, "MainFrame");
if (pageFrame != null)
{
var content = pageFrame.Content as Page;
var targetPage = content is Trichter1 ? new KontaktDetailAnsicht(myContact) as Page : new Trichter1() as Page;
pageFrame.NavigateToExample(targetPage);
}
}
But how do i get the ViewModel? I tried Contact myContact = e.OriginalSource as Contact, but myContact is null? How do i get Values of my doubleclicked ListboxItem as my ViewModel?
Thanks
Regards
Rene