When navigating between one View and another, and setting a binding on an element which contains a # in the name, results in the bound value being String.Empty, rather than the original text.
Steps to reproduce:
- Open the attached Visual Studio Project
- Run the project in the Emulator
- When MainPage.xaml opens, notice that there is Test1, #Test2, Test3 and Test4 which are a BindableCollection<Project> which is Bound to a ListBox on the View
-
Select Test1, which will cause a navigation to another view, using:
public void GoToBuildTypesPage(string projectId, string projectName)
{
navigationService.UriFor<BuildTypesViewModel>()
.WithParam(x => x.ProjectId, projectId)
.WithParam(x => x.ProjectName, projectName)
.Navigate();
}
- In the BuildTypesView, note that the text Test1 is now bound to the TextBlock on this view.
- Click the hardware back button
- Click #Test2 and notice that within the BuildTypesView, there is nothing in the TextBlock
- Click the hardware back button
-
Click Test3 and in the BuildTypesView witness that the TextBlock is correctly bound.
Any ideas on what is going on here?