Asked by:
Button within FlipView Click handler Frame->Navigate Exception

Question
-
Hey there,
I'm getting this odd exception: Within a standard LayoutAwarePage, I'm have a FlipView control that has a Button somewhere inside it. For the Click event, I have an event handler that uses Frame->Navigate() to navigate to a new page. Seems to work fine, until the handler is completed. After that I get an internal exception that I cannot debug. I'm not doing anything fancy either, just strictly navigating.
Event handler:
void MyPage::NewPageClick(Object^ sender, RoutedEventArgs^ e) { TypeName pageType = { NewPage::typeid->FullName, TypeKind::Metadata }; Frame->Navigate(pageType); }
Page XAML:
<common:LayoutAwarePage x:Name="pageRoot" x:Class="TestApp.MyPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:TestApp" xmlns:common="using:TestApp.Common" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">
<Grid>
<FlipView> <FlipViewItem> <Grid> <Button Content="New Page" HorizontalAlignment="Left" VerticalAlignment="Top" Click="NewPageClick"/> </Grid> </FlipViewItem> <FlipViewItem> <Grid /> </FlipViewItem> <FlipView> </Grid> </common:LayoutAwarePage>
Any ideas why this might be happening?
- Edited by _sebastian_b Wednesday, March 14, 2012 7:50 PM
Wednesday, March 14, 2012 7:47 PM
All replies
-
Hello,
As far as I know, we can use Selector.SelectedIndex property
http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.primitives.selector.selectedindex
to navigate the FlipView control.You can get the sample Flopview control sample codes from first,
http://code.msdn.microsoft.com/windowsapps/FlipView-Control-f9d9a99cAnd then navigate the Flipview control through its name, like this
FlipView2Horizontal->SelectedIndex=1;Best regards,
Jesse
Jesse Jiang [MSFT]
MSDN Community Support | Feedback to us
Thursday, March 15, 2012 9:35 AM -
Hey Jesse,
Thanks for your reply. However, that's not quite what I was looking for. Let me explain... I'm not trying to navigate the FlipView, but rather the Frame associated with MyPage to NewPage. If I pull the button out of the FlipView, the Page navigates without an exception. The caveat is when I do this with a Button inside a FlipViewItem, I get an exception. My guess is this has something to do with the FlipView or Frame control.
Cheers.
- Edited by _sebastian_b Thursday, March 15, 2012 2:15 PM
Thursday, March 15, 2012 2:12 PM -
Hey Jesse,
I tried adding an UnhandledExceptionEventHandler to the App. I checked the message and it reads: "Call to UIASendMessageTimeout failed". Seems like a bug to me.
Cheers.
Thursday, March 15, 2012 2:41 PM -
Would you please upload your issue project to skydriver, so that we can test it on our side.
Best regards,
Jesse
Jesse Jiang [MSFT]
MSDN Community Support | Feedback to us
Monday, March 19, 2012 8:25 AM -
I have exactly the same issue: working with a listbox works fine but exception with a FlipView.
Richard Clark
Consultant - Formateur .NET
http://www.c2i.fr
Depuis 1996: le 1er site .NET francophoneMonday, April 30, 2012 4:27 PM -
Hey,
Just an idea. Can it have something to do with this one? http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/f5b47c78-3660-43cf-b7e5-ab3aa9d173eb
As in the button event handler is attached couple of times and the btnClick function is over-executed.
Can Bilgin
Blog CompuSightMonday, May 21, 2012 2:45 PM