forked from donkeyProgramming/TheAssetEditor
-
Notifications
You must be signed in to change notification settings - Fork 1
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 donkeyProgramming#208 from Pear-231/BugFixes-PackF…
…ileBrowser-And-UI-Oh-My! Bug fixes, pack file browser, and UI, oh my!
- Loading branch information
Showing
139 changed files
with
1,556 additions
and
503 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
29 changes: 29 additions & 0 deletions
29
AssetEditor/Themes/Attached/WatermarkComboBoxDropDownVisibilityConverter.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,29 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows; | ||
using System.Windows.Data; | ||
|
||
namespace AssetEditor.Themes.Attached | ||
{ | ||
public class WatermarkComboBoxDropDownVisibilityConverter : IMultiValueConverter | ||
{ | ||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
var text = values[0] as string; | ||
var isKeyboardFocusWithin = (bool)values[1]; | ||
|
||
// Show the watermark if the Text is empty and the control does not have focus | ||
if (string.IsNullOrEmpty(text) && !isKeyboardFocusWithin) | ||
return Visibility.Visible; | ||
|
||
// Otherwise, hide the watermark | ||
return Visibility.Collapsed; | ||
} | ||
|
||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotSupportedException(); | ||
} | ||
} | ||
|
||
} |
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
Oops, something went wrong.