private void ExecuteSearchCommand() { if (tempList.Count == 0) { foreach (TableSMItem item in DERS) { tempList.Add(item); } DERS.Clear(); foreach (TableSMItem item in tempList) { if (item.Der.Name.Contains(SearchName) || item.Der.Name.ToLower().Contains(SearchName)) { DERS.Add(item); } } SearchButton = "Cancel Search"; IsFilterEnabled = false; } else { DERS.Clear(); foreach (TableSMItem item in tempList) { DERS.Add(item); } tempList.Clear(); SearchButton = "Search"; IsFilterEnabled = true; } ShowGauges(); }
private void ExecuteFilterCommand() { if (tempList.Count == 0) { foreach (TableSMItem item in DERS) { tempList.Add(item); } DERS.Clear(); foreach (TableSMItem item in tempList) { if (FilterType.Equals("Sun")) { if (item.Der.FuelType == FTN.Common.FuelType.Sun) { DERS.Add(item); } } else if (FilterType.Equals("Wind")) { if (item.Der.FuelType == FTN.Common.FuelType.Wind) { DERS.Add(item); } } else { } } FilterButton = "Cancel Filter"; IsSearchEnabled = false; } else { DERS.Clear(); foreach (TableSMItem item in tempList) { DERS.Add(item); } tempList.Clear(); FilterButton = "Filter"; IsSearchEnabled = true; } ShowGauges(); }