So I have been playing with some code to try to clear the text in the Feature DataForm when the user clicks in the textbox to enter their information. The following code gives me the dreaded NullReference Exception Error at the "txb.Text = String.Empty;" line. Any help would greatly appreciated.Error:System.NullReferenceException was unhandled by user code Message=Object reference not set to an instance of an object. StackTrace: at BikeCountSignUpWebApp.MainPage.MyFeatureDataForm_GotFocus(Object sender, RoutedEventArgs e) at MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags) InnerException: Xaml: <Border x:Name="FeatureDataFormBorder"
Visibility="Visible"
HorizontalAlignment="Center"
VerticalAlignment="Top"
Margin="10,0,10,0"
Width="400" Height="300" >
<Border.Effect>
<DropShadowEffect Color="#FF51626F" Direction="-45" BlurRadius="20" Opacity=".75" />
</Border.Effect>
<esri:FeatureDataForm x:Name="MyFeatureDataForm"
FeatureLayer="{Binding Path=Layers[AllAvailableFeatureLayer], ElementName=Map}"
IsEnabled="True"
GotFocus="MyFeatureDataForm_GotFocus"
DataContext="{Binding}"
IsReadOnly="False"
LabelPosition="Left"
CommitButtonContent="Save"
EditEnded="MyFeatureDataForm_EditEnded"/>
</Border>
c#: private void MyFeatureDataForm_GotFocus(object sender, RoutedEventArgs e)
{
TextBox txb = sender as TextBox;
txb.Text = String.Empty;
}