feature -> possibility to disable mouse over extension

This commit is contained in:
jkuehner 2017-07-30 11:02:07 +02:00
Родитель 2d97eb70ef
Коммит ae70c2ce93
2 изменённых файлов: 34 добавлений и 3 удалений

Просмотреть файл

@ -60,8 +60,36 @@ namespace ICSharpCode.WpfDesign.Extensions
/// Gets or sets a semicolon-separated list with extension names that is disabled for a component's view.
/// </summary>
public static readonly DependencyProperty DisabledExtensionsProperty =
DependencyProperty.RegisterAttached("DisabledExtensions", typeof(string), typeof(Extension), new PropertyMetadata(null));
DependencyProperty.RegisterAttached("DisabledExtensions", typeof(string), typeof(Extension), new PropertyMetadata(null));
/// <summary>
/// Gets the value of the <see cref="DisableMouseOverExtensionsProperty"/> attached property for an object.
/// </summary>
/// <param name="obj">The object from which the property value is read.</param>
/// <returns>The object's <see cref="DisableMouseOverExtensionsProperty"/> property value.</returns>
public static bool GetDisableMouseOverExtensions(DependencyObject obj)
{
return (bool)obj.GetValue(DisableMouseOverExtensionsProperty);
}
/// <summary>
/// Sets the value of the <see cref="DisableMouseOverExtensionsProperty"/> attached property for an object.
/// </summary>
/// <param name="obj">The object to which the attached property is written.</param>
/// <param name="value">The value to set.</param>
public static void SetDisableMouseOverExtensions(DependencyObject obj, bool value)
{
obj.SetValue(DisableMouseOverExtensionsProperty, value);
}
/// <summary>
/// Disables the mouse over Extension for this Element
/// </summary>
public static readonly DependencyProperty DisableMouseOverExtensionsProperty =
DependencyProperty.RegisterAttached("DisableMouseOverExtensions", typeof(bool), typeof(Extension), new PropertyMetadata(false));
}
}

Просмотреть файл

@ -67,6 +67,9 @@ namespace ICSharpCode.WpfDesign.Extensions
if (potentialHitTestTarget is IAdornerLayer)
return HitTestFilterBehavior.ContinueSkipSelfAndChildren;
if (Extension.GetDisableMouseOverExtensions(potentialHitTestTarget))
return HitTestFilterBehavior.ContinueSkipSelfAndChildren;
var item = this.Services.Component.GetDesignItem(potentialHitTestTarget);
if (item == null)
return HitTestFilterBehavior.ContinueSkipSelf;