-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from scdmitryvodich/Issue_117_OuterDockingBut…
…tons Fix #117 with hiding outer docking buttons.
- Loading branch information
Showing
8 changed files
with
116 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
source/Components/AvalonDock/Converters/OverlayWindowToVisibilityConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/************************************************************************ | ||
AvalonDock | ||
Copyright (C) 2007-2013 Xceed Software Inc. | ||
This program is provided to you under the terms of the Microsoft Public | ||
License (Ms-PL) as published at https://opensource.org/licenses/MS-PL | ||
************************************************************************/ | ||
|
||
using System; | ||
using System.Windows; | ||
using System.Windows.Data; | ||
using AvalonDock.Controls; | ||
using AvalonDock.Layout; | ||
|
||
namespace AvalonDock.Converters | ||
{ | ||
/// <summary> | ||
/// Converts a <see cref="LayoutContent"/> into a <see cref="LayoutItem"/> | ||
/// and ensures that other essential properties (Root, Root.Manager) are available. | ||
/// | ||
/// Returns null or Binding.DoNothing otherwise. | ||
/// </summary> | ||
public class OverlayWindowToVisibilityConverter : IValueConverter | ||
{ | ||
/// <summary> | ||
/// Converts a <see cref="OverlayWindow"/> into a <see cref="Visibility"/>. | ||
/// </summary> | ||
/// <param name="value">The value produced by the binding source.</param> | ||
/// <param name="targetType">The type of the binding target property.</param> | ||
/// <param name="parameter">The converter parameter to use.</param> | ||
/// <param name="culture">The culture to use in the converter.</param> | ||
/// <returns>A converted value.</returns> | ||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) | ||
{ | ||
bool isHostedInFloatingWindow = value is OverlayWindow overlayWindow && overlayWindow.IsHostedInFloatingWindow; | ||
if (parameter == null || !bool.TryParse(parameter.ToString(), out bool isLarge)) | ||
{ | ||
isLarge = false; | ||
} | ||
|
||
return isHostedInFloatingWindow && isLarge ? Visibility.Hidden : Visibility.Visible; | ||
} | ||
|
||
/// <summary> | ||
/// Method is not implemented and will raise <see cref="System.NotSupportedException"/> when called. | ||
/// </summary> | ||
/// <param name="value">The value that is produced by the binding target.</param> | ||
/// <param name="targetType">The type to convert to.</param> | ||
/// <param name="parameter">The converter parameter to use.</param> | ||
/// <param name="culture">The culture to use in the converter.</param> | ||
/// <returns><see cref="System.NotSupportedException"/></returns> | ||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) => throw new NotSupportedException(); | ||
} | ||
} |