I'm trying to apply the trigger as follows:
using SmartRoutePlanner.Models;
...
Map locationMap = new Map();
locationTextBox.DataContext = locationMap;
Binding locationBinding = new Binding("Location");
locationTextBox.SetBinding(TextBox.TextProperty, locationBinding);
locationBinding.UpdateSourceTrigger = UpdateSourceTrigger.Explicit;
And my XAML code is this:
...
xmlns:models="clr-namespace:SmartRoutePlanner.Models"
...
<Grid.Resources>
<models:Map x:Key="mapDataSource"/>
</Grid.Resources>
<Grid.DataContext>
<Binding Source="{StaticResource mapDataSource}" />
</Grid.DataContext>
<TextBox x:Name="locationTextBox" />
What is causing the exceptions?