LongListSelector strange behavior - vb.net

My purpose is to add two buttons which allow the user to jump to the first of to the last item quickly. I'm using MVVM path and the code is very simple:
Sub ScrollDown()
If ResponseModel.Items.Count > 0 And ResponseModel.IsDataLoaded Then
If ResponseModel.Items.LastOrDefault IsNot Nothing Then ResponseList.ScrollTo(ResponseModel.Items.LastOrDefault())
End If
End Sub
Sometimes this code throws a NullReferenceException on the last line, yes, the one with End Sub. None of these object are null, so I can't find out what the problem is.
System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Phone.Controls.LongListSelector.ScrollTo(Object item, Nullable`1 isGroup) at Microsoft.Phone.Controls.LongListSelector.ScrollTo(Object item) at WindowsPhoneAnswers.Thread.Lambda$_68() at WindowsPhoneAnswers.Thread.Lambda$_67(Object a0, EventArgs a1) at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)
The only possible explanation is that the last item hasn't been realized yet, but how to check it?

The solution sounds weird as well. It seems that calling the method using the Dispatcher solves the issue.
However this is odd since the exception was raised randomly and I'm not on a background thread.

Related

PictureBox throws "Parameter is not valid" ArgumentException upon tab keypress

I have a form where the user can first scan to a bitmap. When scan is done, and the bitmap is loaded, I have 4 text boxes that are then enabled. Next to each text box, I have a button called "Cut from image". When the user clicks the button, they can click and drag in the bitmap to get the selected text using MODI.
This works perfect except for one annoying bug: When I click a "Cut from image" button and drag a square, it gets the information nicely to the text box. Then, if i click to the next text box, it goes very well, but if I use the tab key to leave the field, I get a "Parameter is not valid" ArgumentException and it does not show any help for where in the code the crash is made. I can tab around in the form with no problems at all, but once the bitmap is scanned, it crashes like 9 out of 10 times when I use the tab key.
I tried to override the tab key (just for debugging) using this:
Protected Overrides Function ProcessTabKey(ByVal forward As Boolean) As Boolean
MsgBox("TAB is currently disabled!")
Return False 'Tried True as well, just in case
End Function
...but it still crashes.
Any suggestions about what's wrong? Since I don't know where to begin debugging I can't tell what code to show.
EDIT 1
Here is the stack trace for the ArgumentException that gets thrown:
at System.Drawing.Image.get_Width()
at System.Drawing.Image.get_Size()
at System.Windows.Forms.PictureBox.ImageRectangleFromSizeMode(PictureBoxSizeMode mode)
at System.Windows.Forms.PictureBox.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at ORC_Testing.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
EDIT 2
Here is how I'm scanning/loading the image:
Dim filename As Collection
filename = TwainHandler.ScanImages("c:\scan\", "tif")
Dim ScannedFile As Image = Image.FromFile(filename(1))
PictureBox1.Image = ScannedFile
PictureBox1.Width = ScannedFile.Width
' etc.
Your problem is likely that, at some point, you are calling the Dispose method on one of your Image objects. When you call Image.Dispose, it deletes the underlying image data from memory, so the Image object still exists, but is invalid because it no longer contains an actual image. When you set the PictureBox.Image property to a loaded Image object, the PictureBox control assumes that the Image object will remain valid so that it can reuse it later any time the control needs to repaint itself to the screen. For instance:
Dim myImage As Image = Image.FromFile("file path")
PictureBox1.Image = myImage
PictureBox1.Refresh() ' This works
myImage.Dispose()
PictureBox1.Refresh() ' This throws an exception because it tries to access the disposed Image object
The PictureBox control will automatically dispose of the image for you when it is disposed, so you don't need to worry about disposing it yourself. The only time you should be disposing your images is when you are not giving them to any other objects for later use.
Here is my solution, somebody could use it, even though the question is old.
Dim myImage As Image = Image.FromFile("file path")
PictureBox1.Image = myImage.clone // Use clone to give a new copy not a reference of image
PictureBox1.Refresh() // This works
myImage.Dispose()
PictureBox1.Refresh() // This works also because we've a copy not reference
PictureBox1.Image = myImage.Clone
This way you are using a copy of the image so it does not matter what happens with the original

Application.UnhandledException and original exception message

I'm trying to access original exception which caused UnhandledException but all I see is text contained at UnhandledExceptionEventArgs.Message property;
For example:
I have view with button with click handler:
private void Button_Click_1(object sender, RoutedEventArgs e)
{
throw new NullReferenceException("Test exc");
}
At App constructor I have subscribed to UnhandledException exception
this.UnhandledException += App_UnhandledException;
private void App_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
Debug.WriteLine(e.Message);
Debug.WriteLine(e.Exception.ToString());
}
As a result I have no option to get original exception text "Test exc". All I have is
Message = System.NullReferenceException at
W8.Controls.SearchControl.Button_Click_1(Object sender,
RoutedEventArgs e)
Exception = System.NullReferenceException: Object reference not set to
an instance of an object.
Thanks in advance for advise!
There are some limitations in what gets propagated to a UnhandledException. As documented:
Another limitation is that the UnhandledException event arguments
don’t contain as much detail as the original exception. Whenever
possible, if the application requires specific processing of a certain
exception, it’s always better to catch the exception as it propagates,
since more detail will be available. The UnhandledException event
arguments expose an exception object through the Exception property.
However, the type, message, and stack trace of this exception object
are not guaranteed to match those of the original exception that was
raised. The event arguments also expose a Message property. In most
cases, this will contain the message of the originally raised
exception.

What things should I consider when I get an intermittent exception in Visual Basic .net (debugging in Visual Studio Express 2010)?

I'm testing my Visual Basic .net application by running it in Visual Studio express.
Sometimes it runs OK, but other times I get an exception (details below, if useful). I'm not sure why I get the exception as the particular part of the application that I am testing re-uses code that works OK for other features.
What should I check, what would give me a hint as to the root cause.
Things I tried so far are:
Rewriting some of the code to be more robust. The outcome of this was that this approach was getting out of control - I was correcting everything. I made changes such asing alternative libraries (e.g. replacing CInt with convertTo etc). Some lazy declarations, but it occurred to me that there was no problem with these with the code before my changes. And every change I seemed to solve uncovered yet another problem, another different exception
So I thought something must be fundamentally wrong with my installation, and a search found discussion group posts from people experiencing something similar. The suggested remedy would be to re-install the .net framework. So I did that and the problems still occured.
Any thoughts on approach to get to the root of the problem? I'm not asking for a solution but some fresh ideas would be very welcome.
Update:
I've added in the following code to get more detail (+1 thanks #Meta-Knight)
Dim exceptionMessage As String = ex.Message
Console.WriteLine("Message: \n" & exceptionMessage)
Dim exceptionTargetSite As String = ex.TargetSite.ToString
Console.WriteLine("Inner: \n" & ex.TargetSite.ToString)
Dim exceptionSource As String = ex.Source
Console.WriteLine("Source\n:" & exceptionSource)
' put the stack trace into a variable
' (this helps debugging - put a break point after this is assigned
' to see the contents)
Dim stackTrace As String = ex.StackTrace.ToString()
Console.WriteLine("Stack trace\n:" & stackTrace)
More details about exception
Error - Exception Message
"Arithmetic operation resulted in an overflow."
Exception Target Site:
"Int32 ToInteger(System.String)"
Exception Source:
"Microsoft.VisualBasic"
at Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value) at MyCo_3rd-Party-Industrial-Printing-System.Customer_EanUpc_serialNumberGeneratorAssembly.btnPrint_Click(Object sender, EventArgs e) in C:\labelprint\MyCo 3rd-Party-Industrial-Printing-System v2\MyCo 3rd-Party-Industrial-Printing-System\PrintForms\Customer_EanUpc_serialNumberGeneratorAssembly.vb:line 271 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.PerformClick() at System.Windows.Forms.Form.ProcessDialogKey(Keys keyData) at System.Windows.Forms.Control.ProcessDialogKey(Keys keyData) at System.Windows.Forms.Control.PreProcessMessage(Message& msg) at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg) at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg) at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FPreTranslateMessage(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.RunDialog(Form form) at System.Windows.Forms.Form.ShowDialog(IWin32Window owner) at System.Windows.Forms.Form.ShowDialog() at MyCo_3rd-Party-Industrial-Printing-System.utlForm.openNewModalForm(String form) in C:\labelprint\MyCo 3rd-Party-Industrial-Printing-System v2\MyCo 3rd-Party-Industrial-Printing-System\Utilities\utlForm.vb:line 128
Update 2:
The code around line 272 was:
For i As Integer = 1 To CInt(numQuantity)
If generationMethods() Then
The code around line 272 is now (I've adjusted it):
Dim numQuantityAsStr As String = numQuantity.Text
Dim numQuantityAsInt As Integer = Convert.ToInt32(numQuantityAsStr)
For i As Integer = 1 To numQuantityAsInt
If generationMethods() Then
numQuantity is a String variable for a field in the Windows form I am using and this has a value put in it by the user, the field is used to specify the quantity of something so this variable is converted to a integer so that it can be used in a for loop. The test value I am using is always entering 1 in this field, and sometimes this causes the exception.
My alteration uses what I think is a more modern type conversion Convert.ToInt32 rather than CInt I've also introduced intermediate steps to help debug.
The exception now does not occur here but I did try this the other week and another separate exception popped up (if I remember) from somewhere else so we'll see if this fixes it. Any thoughts as to why using a different conversion utility would solve the problem?
Update 3:
An Exception now occurs elsewhere:
(But why?! This one is thrown from library code!)
The following code caused it:
Dim dateNowAsStr As String = DateTime.Now.Date.ToString
Exception Message:
"Value to add was out of range. Parameter name: value"
Exception target site:
"System.DateTime Add(Double, Int32)"
Exception source:
"mscorlib"
" at System.DateTime.Add(Double value, Int32 scale) at System.TimeZoneInfo.TransitionTimeToDateTime(Int32 year, TransitionTime transitionTime) at System.TimeZoneInfo.GetDaylightTime(Int32 year, AdjustmentRule rule) at System.TimeZoneInfo.GetIsDaylightSavingsFromUtc(DateTime time, Int32 Year, TimeSpan utc, AdjustmentRule rule, Boolean& isAmbiguousLocalDst) at System.TimeZoneInfo.GetDateTimeNowUtcOffsetFromUtc(DateTime time, Boolean& isAmbiguousLocalDst) at System.DateTime.get_Now() at GenerationLibrary.GenerationUtilities.callserialNumberGenerator(String serialNumberGeneratorSnFile, String serialNumberGeneratorRange, DefaultSettingsHandler settings) in C:\labelprint\MyCo 3rd-Party-Industrial-Printing-System v2\GenerationLibrary\GenerationUtilities.vb:line 28 at GenerationLibrary.MyCoSnGeneration.constructMyCoSn(DataRow& oDataRow, DefaultSettingsHandler& settings) in C:\labelprint\MyCo 3rd-Party-Industrial-Printing-System v2\GenerationLibrary\MyCoSnGeneration.vb:line 18 at MyCo_3rd-Party-Industrial-Printing-System.Customer_EanUpc_serialNumberGeneratorAssembly.generationMethods() in C:\labelprint\MyCo 3rd-Party-Industrial-Printing-System v2\MyCo 3rd-Party-Industrial-Printing-System\PrintForms\Customer_EanUpc_serialNumberGeneratorAssembly.vb:line 40 at MyCo_3rd-Party-Industrial-Printing-System.Customer_EanUpc_serialNumberGeneratorAssembly.btnPrint_Click(Object sender, EventArgs e) in C:\labelprint\MyCo 3rd-Party-Industrial-Printing-System v2\MyCo 3rd-Party-Industrial-Printing-System\PrintForms\Customer_EanUpc_serialNumberGeneratorAssembly.vb:line 275 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.PerformClick() at System.Windows.Forms.Form.ProcessDialogKey(Keys keyData) at System.Windows.Forms.Control.ProcessDialogKey(Keys keyData) at System.Windows.Forms.Control.PreProcessMessage(Message& msg) at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg) at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg) at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FPreTranslateMessage(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.RunDialog(Form form) at System.Windows.Forms.Form.ShowDialog(IWin32Window owner) at System.Windows.Forms.Form.ShowDialog() at MyCo_3rd-Party-Industrial-Printing-System.utlForm.openNewModalForm(String form) in C:\labelprint\MyCo 3rd-Party-Industrial-Printing-System v2\MyCo 3rd-Party-Industrial-Printing-System\Utilities\utlForm.vb:line 128"
Update 4
BUT
Dim dateNowAsStr As String = CStr(DateTime.Now)
does not cause the exception
Before rewriting or reinstalling anything, you should try to identify the source and the reason for the error.
The first thing to do is to analyse the error message and stack trace. If you include debugging files (.pdb) with your application's files, you will get more detailed information such as the line number which can be helpful.
If that doesn't give enough information about the circumstances of the error, then you can add some logging to your app. By logging what the user does in your app it might help reproduce the problem.
Finally you can always get help by searching on google or asking on StackOverflow, but make sure to include the actual error message, not just the stack trace... You should also post the code where the error happens.
Edit:
So the actual error is: "Arithmetic operation resulted in an overflow."
Googling this would have helped: you would have found out that such an error happens when you're trying to convert a number which is out of bounds for an integer. If you expect to have some very large numbers you can try converting to Long instead.
I think you can start by looking at what is at line 271 of the Customer_EanUpc_serialNumberGeneratorAssembly.vb source code file.
Which is located: C:\labelprint\MyCo 3rd-Party-Industrial-Printing-System v2\MyCo 3rd-Party-Industrial-Printing-System\PrintForms\ directory.
It looks like the problem is related to a conversion between string to integer where maybe it failed because the string cannot be converted to integer... maybe it has alphanumeric characters...
"Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value)"
Did you already check that?
Why you get the error some times and not always could be because (and I'm guessing here) the code in serialNumberGeneratorAssembly sometimes generates numeric only values (that can be correctly converted to integer) and some other times generates alphanumeric serial numbers (that throw the convertion exception).
UPDATE: the code that generates the Serial Numbers is generating numbers bigger than an Integer value. Try converting to Long instead of Integer... or have a look at System.Numerics.BigInteger in case those numbers are too big.
That explains the: "Arithmetic operation resulted in an overflow." exception message.

What does this usually mean, Error HRESULT E_FAIL has been returned from a call to a COM component.?

I have a particular view with a DataGrid (silverlight 4). But i have a project where resources have been merged with another project (for backward support). Now, after this merge, i am getting this error whenever i try to add a new row oject to my ObservableCollection.... my theory is that it is something wrong with the xaml (which i can touch!) or, hopefully, the merged resources (styles & brushes).
MS.Internal.WrappedException was unhandled by user code
Message=Error HRESULT E_FAIL has been returned from a call to a COM component.
StackTrace:
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.UIElement_Measure(UIElement element, Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.DataGrid.InsertDisplayedElement(Int32 slot, UIElement element, Boolean wasNewlyAdded, Boolean updateSlotInformation)
at System.Windows.Controls.DataGrid.OnAddedElement_Phase1(Int32 slot, UIElement element)
at System.Windows.Controls.DataGrid.OnInsertedElement_Phase1(Int32 slot, UIElement element, Boolean isCollapsed, Boolean isRow)
at System.Windows.Controls.DataGrid.InsertElement(Int32 slot, UIElement element, Boolean updateVerticalScrollBarOnly, Boolean isCollapsed, Boolean isRow)
at System.Windows.Controls.DataGrid.InsertElementAt(Int32 slot, Int32 rowIndex, Object item, DataGridRowGroupInfo groupInfo, Boolean isCollapsed)
at System.Windows.Controls.DataGrid.InsertRowAt(Int32 rowIndex)
at System.Windows.Controls.DataGridDataConnection.NotifyingDataSource_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at System.Windows.Data.PagedCollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
at System.Windows.Data.PagedCollectionView.ProcessAddEvent(Object addedItem, Int32 addIndex)
at System.Windows.Data.PagedCollectionView.ProcessCollectionChanged(NotifyCollectionChangedEventArgs args)
at System.Windows.Data.PagedCollectionView.<.ctor>b__0(Object sender, NotifyCollectionChangedEventArgs args)
at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
at System.Collections.ObjectModel.Collection`1.Add(T item)
InnerException:
Message=Error HRESULT E_FAIL has been returned from a call to a COM component.
StackTrace:
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
InnerException:
This usually means that there is a problem with your XAML that couldn't be validated at design time but would manifest in runtime. Given your scenario I'm guessing the row you're adding may cause one of the Datagrid column templates to error in this manner.
This usually is due to a reference to a style or an event handler that does not exist or is not within the context of the XAML. In my experience this is a common occurence in Custom Control development.
See my answer to a similar question here.
HTH.

Exception "Element is already the child of another element." when navigating to the startup view

I'm using Region Navigation integrated with the Silverlight Frame Navigation as follows: I have my frame, to which I attached a region, and set the ContentLoader to the FrameContentLoader which I got from Karl Shiflett's example:
<navigation:Frame
x:Name="ContentFrame"
Style="{StaticResource ContentFrameStyle}"
Source="/Home"
Navigated="ContentFrame_Navigated"
NavigationFailed="ContentFrame_NavigationFailed"
prism:RegionManager.RegionName="MainContentRegion">
<navigation:Frame.ContentLoader>
<prism_Regions:FrameContentLoader RegionName="MainContentRegion"/>
</navigation:Frame.ContentLoader>
<navigation:Frame.UriMapper>
<uriMapper:UriMapper>
<uriMapper:UriMapping Uri="" MappedUri="/MyProject.Views.Home" />
<uriMapper:UriMapping Uri="/{pageName}" MappedUri="/MyProject.Views.{pageName}" />
</uriMapper:UriMapper>
</navigation:Frame.UriMapper>
</navigation:Frame>
I get the following exception: "Element is already the child of another element.", here's the stack trace:
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, DependencyObject doh)
at MS.Internal.XcpImports.SetValue(IManagedPeerBase doh, DependencyProperty property, Object obj)
at System.Windows.DependencyObject.SetObjectValueToCore(DependencyProperty dp, Object value)
at System.Windows.DependencyObject.SetEffectiveValue(DependencyProperty property, EffectiveValueEntry& newEntry, Object newValue)
at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
at System.Windows.Controls.ContentControl.set_Content(Object value)
at System.Windows.Navigation.NavigationService.CompleteNavigation(DependencyObject content)
at System.Windows.Navigation.NavigationService.ContentLoader_BeginLoad_Callback(IAsyncResult result)
this happens whenever I try to navigate to the Home view, whereas all the other navigation request complete successfully! To make sure that the problem isn't with the view itself, I tried replacing Home with About which is an existing view (making it the startup view), but the problem still exists! Now, I can navigate to Home but not About.
what could cause such a problem?
PS: the problem persists even after I removed the assignement of the Source property for the Frame, and the default UriMapper (the first one). With this, I have the error with the first view I visit, the others work fine.
I finally stumbled upon the "real cause" of this problem!
I found the following lines in my App.xaml
protected virtual void InitializeRootVisual()
{
BusyIndicator busyIndicator = new BusyIndicator();
busyIndicator.Content = new Shell();
busyIndicator.HorizontalContentAlignment = HorizontalAlignment.Stretch;
busyIndicator.VerticalContentAlignment = VerticalAlignment.Stretch;
this.RootVisual = busyIndicator;
}
I'm not really sure as to what really happened here that caused the issue (maybe someone can enlighten me on that), but removing this solved the problem.
I hope this could help somebody (maybe a "future me") someday :)