Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -579,35 +579,16 @@ private void AppFilters_SelectionChanged(object sender, SelectionChangedEventArg

private void ApplyAppFilters()
{
bool hasPlatformPreference = !string.IsNullOrWhiteSpace(mInitialPlatform);
foreach (var app in mApps)
{
app.IsGrayedOut = hasPlatformPreference && !PlatformMatchesInitial(app.Type);
}

var filtered = mApps.AsEnumerable();

if (xAppOsTypeCombo?.SelectedItem is string os && !string.IsNullOrWhiteSpace(os) && os != "All")
if (xAppOsTypeCombo?.SelectedItem is string appOs && !string.IsNullOrWhiteSpace(appOs) && !string.Equals(appOs, "All", StringComparison.OrdinalIgnoreCase))
{
filtered = filtered.Where(a => string.Equals(a.Type, os, StringComparison.OrdinalIgnoreCase));
filtered = filtered.Where(a => string.Equals(a.Type, appOs, StringComparison.OrdinalIgnoreCase));
}

xAppsListBox.ItemsSource = filtered.ToList();
}

private bool PlatformMatchesInitial(string platform)
{
if (string.IsNullOrWhiteSpace(mInitialPlatform) || string.IsNullOrWhiteSpace(platform))
{
return false;
}

bool initialIsIos = mInitialPlatform.IndexOf("ios", StringComparison.OrdinalIgnoreCase) >= 0;
bool platformIsIos = platform.IndexOf("ios", StringComparison.OrdinalIgnoreCase) >= 0;

return initialIsIos == platformIsIos;
}

private void AppsListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (sender is ListBox listBox)
Expand Down Expand Up @@ -1063,17 +1044,11 @@ private void PopulateFilters()

private void ApplyFilters()
{
bool hasPlatformPreference = !string.IsNullOrWhiteSpace(mInitialPlatform);
foreach (var phone in mPhones)
{
phone.IsGrayedOut = hasPlatformPreference && !PlatformMatchesInitial(phone.Platform);
}

var filtered = mPhones.AsEnumerable();

if (xOsTypeCombo?.SelectedItem is string os && !string.IsNullOrWhiteSpace(os) && os != "All")
if (xOsTypeCombo?.SelectedItem is string deviceOs && !string.IsNullOrWhiteSpace(deviceOs) && !string.Equals(deviceOs, "All", StringComparison.OrdinalIgnoreCase))
{
filtered = filtered.Where(p => string.Equals(p.Platform, os, StringComparison.OrdinalIgnoreCase));
filtered = filtered.Where(p => string.Equals(p.Platform, deviceOs, StringComparison.OrdinalIgnoreCase));
}

if (xWorkspaceCombo?.SelectedItem is string ws && !string.IsNullOrWhiteSpace(ws) && ws != "All")
Expand Down
Loading