What version of the API are you using? I'm not able to reproduce with released version v100 with the following code.
To use, hit "Enter" key to execute update on FeatureLayer.DefinitionExpression, should only display states that begin with 'N'
Clearing the text and hit "Enter" again, should display all states.
I'm able to update the definition expression without issue.
Can you share some repro code or try code below to see if you can get the an exception? Thanks.
xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013">
<Grid>
<esri:MapView x:Name="MyMapView" />
<StackPanel VerticalAlignment="Top"
HorizontalAlignment="Right">
<TextBox Text="STATE_NAME LIKE 'N%'"
Width="250"
KeyUp="OnKeyUp"/>
</StackPanel>
</Grid>
public MainWindow()
{
InitializeComponent();
MyMapView.Map = new Map(Basemap.CreateTopographic());
MyMapView.Map.OperationalLayers.Add(new FeatureLayer(new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3")));
}
private void OnKeyUp(object sender, KeyEventArgs e)
{
if(e.Key == Key.Enter)
{
var clause = ((TextBox)sender).Text.Trim();
var layer = (FeatureLayer)MyMapView.Map.OperationalLayers[0];
layer.DefinitionExpression = clause;
}
}