chore: rename ImageOpenedEvent to ImageSelectedEvent (#1000)
This commit is contained in:
1 parent
87556183a6
commit
a214a01f7c
1 file changed
+7
-10
@@ -12,14 +12,14 @@ namespace HandyControl.Controls
|
|||||||
{
|
{
|
||||||
public class ImageSelector : Control
|
public class ImageSelector : Control
|
||||||
{
|
{
|
||||||
public static readonly RoutedEvent ImageOpenedEvent =
|
public static readonly RoutedEvent ImageSelectedEvent =
|
||||||
EventManager.RegisterRoutedEvent("ImageOpened", RoutingStrategy.Bubble,
|
EventManager.RegisterRoutedEvent("ImageSelected", RoutingStrategy.Bubble,
|
||||||
typeof(EventHandler<FunctionEventArgs<bool>>), typeof(ImageSelector));
|
typeof(RoutedEventHandler), typeof(ImageSelector));
|
||||||
|
|
||||||
public event EventHandler<FunctionEventArgs<bool>> ImageOpened
|
public event RoutedEventHandler ImageSelected
|
||||||
{
|
{
|
||||||
add => AddHandler(ImageOpenedEvent, value);
|
add => AddHandler(ImageSelectedEvent, value);
|
||||||
remove => RemoveHandler(ImageOpenedEvent, value);
|
remove => RemoveHandler(ImageSelectedEvent, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImageSelector() => CommandBindings.Add(new CommandBinding(ControlCommands.Switch, SwitchImage));
|
public ImageSelector() => CommandBindings.Add(new CommandBinding(ControlCommands.Switch, SwitchImage));
|
||||||
@@ -44,10 +44,7 @@ namespace HandyControl.Controls
|
|||||||
});
|
});
|
||||||
SetValue(HasValuePropertyKey, ValueBoxes.TrueBox);
|
SetValue(HasValuePropertyKey, ValueBoxes.TrueBox);
|
||||||
SetCurrentValue(ToolTipProperty, dialog.FileName);
|
SetCurrentValue(ToolTipProperty, dialog.FileName);
|
||||||
RaiseEvent(new FunctionEventArgs<bool>(ImageOpenedEvent, this)
|
RaiseEvent(new RoutedEventArgs(ImageSelectedEvent, this));
|
||||||
{
|
|
||||||
Info = true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in new issue
Block a user