aleukhin 90ca23d239 1st com | hai 6 meses | |
---|---|---|
.vs | hai 6 meses | |
WpfApp1 | hai 6 meses | |
img | hai 6 meses | |
WpfApp1.sln | hai 6 meses | |
readme.md | hai 6 meses |
это xaml
</ComboBox>
<RadioButton
GroupName="Price"
Tag="2"
Content="Старше"
Checked="RadioButton_Checked"
VerticalAlignment="Center" RenderTransformOrigin="0.067,0.44"/>
<RadioButton
GroupName="Price"
Tag="1"
Content="Младше"
IsChecked="True"
Checked="RadioButton_Checked"
VerticalAlignment="Center" Height="15" Width="69"/>
<Label
Content="Искать"
VerticalAlignment="Center"/>
<TextBox
Width="200"
VerticalAlignment="Center"
x:Name="SearchFilterTextBox"
KeyUp="SearchFilter_KeyUp"/>
это mainwindow xaml .cs
private string searchFilter = "";
private void SearchFilter_KeyUp(object sender, KeyEventArgs e)
{
searchFilter = SearchFilterTextBox.Text;
Invalidate();
}
public IEnumerable<Worker> WorkerList
{
get
{
var res = _WorkerList;
res = res
.Where(c => (c.Pos == selectedPos || selectedPos == "Должность"))
.Where(c => (selectedAge == null || (c.Age >= selectedAge.AgeFrom && c.Age < selectedAge.AgeTo)))
.Where(c => (c.Sex == selectedSex || selectedSex == "Пол"));
if (searchFilter != "")
res = res.Where(c => c.name.IndexOf(
searchFilter,
StringComparison.OrdinalIgnoreCase) >= 0);
if (sortAsc) res = res.OrderBy(c => c.Age);
else res = res.OrderByDescending(c => c.Age);
return res;
}
set
{
_WorkerList = value;
}
}