mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
* Remove redundant default initializations * Implement IDisposable in HotkeySettingsControl * Mark classes and methods as static * Move Interop.ShowWindow to NativeMethods class * Fix string-related warnings * Remove unused argument for KeyEventHandler * Log caught general exceptions * Use safe navigation operator for null argument checks * Suppress CA2007 warnings and enable FxCop * Suppress warning for unused event handler params * Use TryParse in ImageResizerPage * Use ConfigureAwait(false) for CA2007
25 lines
769 B
C#
25 lines
769 B
C#
// Copyright (c) Microsoft Corporation
|
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
using System;
|
|
using System.Collections;
|
|
using Windows.UI.Xaml;
|
|
using Windows.UI.Xaml.Data;
|
|
|
|
namespace Microsoft.PowerToys.Settings.UI.Views
|
|
{
|
|
public class VisibleIfNotEmpty : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, string language)
|
|
{
|
|
return (value == null) || (value as IList).Count == 0 ? Visibility.Collapsed : Visibility.Visible;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
}
|