feat: quick fix and rename.
This commit is contained in:
@@ -31,12 +31,12 @@ public class DialogControl: ContentControl
|
||||
{
|
||||
if (args.OldValue.Value is IDialogContext oldContext)
|
||||
{
|
||||
oldContext.Closed-= CloseFromContext;
|
||||
oldContext.RequestClose-= OnContextRequestClose;
|
||||
}
|
||||
|
||||
if (args.NewValue.Value is IDialogContext newContext)
|
||||
{
|
||||
newContext.Closed += CloseFromContext;
|
||||
newContext.RequestClose += OnContextRequestClose;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ public class DialogControl: ContentControl
|
||||
}
|
||||
}
|
||||
|
||||
private void CloseFromContext(object sender, object? args)
|
||||
private void OnContextRequestClose(object sender, object? args)
|
||||
{
|
||||
if (this.DataContext is IDialogContext context)
|
||||
{
|
||||
|
||||
@@ -26,12 +26,12 @@ public class DialogWindow: Window
|
||||
{
|
||||
if (args.OldValue.Value is IDialogContext oldContext)
|
||||
{
|
||||
oldContext.Closed-= OnDialogContextClose;
|
||||
oldContext.RequestClose-= OnContextRequestClose;
|
||||
}
|
||||
|
||||
if (args.NewValue.Value is IDialogContext newContext)
|
||||
{
|
||||
newContext.Closed += OnDialogContextClose;
|
||||
newContext.RequestClose += OnContextRequestClose;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class DialogWindow: Window
|
||||
EventHelper.RegisterClickEvent(OnDefaultClose, _closeButton);
|
||||
}
|
||||
|
||||
private void OnDialogContextClose(object? sender, object? args)
|
||||
private void OnContextRequestClose(object? sender, object? args)
|
||||
{
|
||||
Close(args);
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ namespace Ursa.Controls;
|
||||
public interface IDialogContext
|
||||
{
|
||||
void Close();
|
||||
event EventHandler<object?> Closed;
|
||||
event EventHandler<object?> RequestClose;
|
||||
}
|
||||
@@ -194,6 +194,7 @@ public abstract class NumericUpDown : TemplatedControl
|
||||
if (AllowDrag && _dragPanel is not null)
|
||||
{
|
||||
_dragPanel.IsVisible = true;
|
||||
_dragPanel.Focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -204,8 +205,14 @@ public abstract class NumericUpDown : TemplatedControl
|
||||
if (e.ClickCount == 2 && _dragPanel is not null && AllowDrag)
|
||||
{
|
||||
_dragPanel.IsVisible = false;
|
||||
_textBox.IsReadOnly = false;
|
||||
}
|
||||
_textBox?.Focus();
|
||||
else
|
||||
{
|
||||
_textBox?.Focus();
|
||||
_textBox!.IsReadOnly = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void OnDragPanelPointerReleased(object sender, PointerReleasedEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user