-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix filename selector, zip path separators, wait cursors
- Loading branch information
Showing
5 changed files
with
114 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
using System.Collections.Specialized; | ||
using System.Reflection; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
|
||
namespace SkinConfigurator | ||
{ | ||
public class SpecialCombo : ComboBox | ||
{ | ||
private bool _ignoreSelectionChanged = false; | ||
|
||
private static readonly MethodInfo _selectedItemUpdated = | ||
typeof(ComboBox).GetMethod("SelectedItemUpdated", BindingFlags.NonPublic | BindingFlags.Instance)!; | ||
|
||
protected override void OnSelectionChanged(SelectionChangedEventArgs e) | ||
{ | ||
if (!_ignoreSelectionChanged) | ||
{ | ||
base.OnSelectionChanged(e); | ||
|
||
var textBinding = BindingOperations.GetBindingExpression(this, TextProperty); | ||
if (textBinding == null) return; | ||
|
||
_selectedItemUpdated.Invoke(this, Array.Empty<object>()); | ||
textBinding.UpdateSource(); | ||
} | ||
} | ||
|
||
protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e) | ||
{ | ||
_ignoreSelectionChanged = true; | ||
try | ||
{ | ||
base.OnItemsChanged(e); | ||
} | ||
finally | ||
{ | ||
_ignoreSelectionChanged = false; | ||
} | ||
} | ||
} | ||
} |
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,25 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Input; | ||
|
||
namespace SkinConfigurator | ||
{ | ||
public class WaitCursor : IDisposable | ||
{ | ||
private Cursor _previousCursor; | ||
|
||
public WaitCursor() | ||
{ | ||
_previousCursor = Mouse.OverrideCursor; | ||
Mouse.OverrideCursor = Cursors.Wait; | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
Mouse.OverrideCursor = _previousCursor; | ||
} | ||
} | ||
} |
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