xamarin-docs
xamarin-docs copied to clipboard
Code typo
[Enter feedback here] In the Data Binding section, the LoadNote code is placed within the ItemId property, which is obviously wrong. The code should be:
public string ItemId
{
set
{
LoadNote(value);
}
}
async void LoadNote(string itemId)
{
try
{
int id = Convert.ToInt32(itemId);
// Retrieve the note and set it as the BindingContext of the page.
Note note = await App.Database.GetNoteAsync(id);
BindingContext = note;
}
catch (Exception)
{
Console.WriteLine("Failed to load note.");
}
}
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 6ab89335-bb35-dd6e-cb41-2d889415a555
- Version Independent ID: 72c891a7-6f2a-45e5-0935-0cdee220305c
- Content: Xamarin.Forms Quickstart Deep Dive - Xamarin
- Content Source: docs/get-started/quickstarts/deepdive.md
- Product: xamarin
- Technology: xamarin-forms
- GitHub Login: @davidbritch
- Microsoft Alias: dabritch