Fix text filter if there is whitespace in the text, simplified some events
This commit is contained in:
parent
401e0d4ae8
commit
704c58222c
@ -89,8 +89,7 @@
|
|||||||
<ColumnDefinition Width="30" />
|
<ColumnDefinition Width="30" />
|
||||||
<ColumnDefinition Width=".5*" />
|
<ColumnDefinition Width=".5*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<xctk:WatermarkTextBox x:Name="textBoxSearch" Grid.Column="0" Margin="2" Watermark="{x:Static p:Resources.textEnterKeyword}" PreviewTextInput="textBoxSearch_PreviewTextInput"
|
<xctk:WatermarkTextBox x:Name="textBoxSearch" Grid.Column="0" Margin="2" Watermark="{x:Static p:Resources.textEnterKeyword}" TextChanged="textBoxSearch_TextChanged" />
|
||||||
DataObject.Pasting="textBoxSearch_Pasting" TextChanged="textBoxSearch_TextChanged" />
|
|
||||||
<CheckBox x:Name="checkBoxOwn" VerticalAlignment="Center" Grid.Column="1" HorizontalAlignment="Right" Margin="2" Checked="checkBoxOwn_Checked" Unchecked="checkBoxOwn_Checked" />
|
<CheckBox x:Name="checkBoxOwn" VerticalAlignment="Center" Grid.Column="1" HorizontalAlignment="Right" Margin="2" Checked="checkBoxOwn_Checked" Unchecked="checkBoxOwn_Checked" />
|
||||||
<Label Content="{x:Static p:Resources.textMineOnly}" Grid.Column="2" />
|
<Label Content="{x:Static p:Resources.textMineOnly}" Grid.Column="2" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@ -183,23 +183,11 @@ namespace BreCalClient
|
|||||||
foreach (Participant agency in comboBoxAgencies.SelectedItems)
|
foreach (Participant agency in comboBoxAgencies.SelectedItems)
|
||||||
_model.Agencies.Add(agency.Id);
|
_model.Agencies.Add(agency.Id);
|
||||||
SearchFilterChanged?.Invoke();
|
SearchFilterChanged?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void textBoxSearch_Pasting(object sender, System.Windows.DataObjectPastingEventArgs e)
|
|
||||||
{
|
|
||||||
this.SearchFilter.SearchString = e.SourceDataObject.ToString();
|
|
||||||
SearchFilterChanged?.Invoke();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void textBoxSearch_PreviewTextInput(object sender, TextCompositionEventArgs e)
|
|
||||||
{
|
|
||||||
this.SearchFilter.SearchString = this.textBoxSearch.Text + e.Text;
|
|
||||||
SearchFilterChanged?.Invoke();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void textBoxSearch_TextChanged(object sender, TextChangedEventArgs e)
|
private void textBoxSearch_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
{
|
{
|
||||||
this.SearchFilter.SearchString = this.textBoxSearch.Text;
|
this.SearchFilter.SearchString = this.textBoxSearch.Text.Trim();
|
||||||
SearchFilterChanged?.Invoke();
|
SearchFilterChanged?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user