mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 23:50:18 -04:00
Main page now uses Frame to change views when selecting items
Backgrounds unified Menu items can be disabled thanks to custom ListView control
This commit is contained in:
20
ModernKeePass/Controls/ListViewWithDisable.cs
Normal file
20
ModernKeePass/Controls/ListViewWithDisable.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using ModernKeePass.Interfaces;
|
||||
|
||||
namespace ModernKeePass.Controls
|
||||
{
|
||||
public class ListViewWithDisable: ListView
|
||||
{
|
||||
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
|
||||
{
|
||||
base.PrepareContainerForItemOverride(element, item);
|
||||
|
||||
var container = element as ListViewItem;
|
||||
var binaryItem = item as IIsEnabled;
|
||||
if (container == null || binaryItem == null) return;
|
||||
container.IsEnabled = binaryItem.IsEnabled;
|
||||
container.IsHitTestVisible = binaryItem.IsEnabled;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user