Merge branch 'master' of https://github.com/HandyOrg/HandyControl
This commit is contained in:
commit
b1fef59ad5
1 file changed
+11
@@ -12,6 +12,16 @@ namespace HandyControl.Controls
|
||||
{
|
||||
public class ImageSelector : Control
|
||||
{
|
||||
public static readonly RoutedEvent ImageSelectedEvent =
|
||||
EventManager.RegisterRoutedEvent("ImageSelected", RoutingStrategy.Bubble,
|
||||
typeof(RoutedEventHandler), typeof(ImageSelector));
|
||||
|
||||
public event RoutedEventHandler ImageSelected
|
||||
{
|
||||
add => AddHandler(ImageSelectedEvent, value);
|
||||
remove => RemoveHandler(ImageSelectedEvent, value);
|
||||
}
|
||||
|
||||
public ImageSelector() => CommandBindings.Add(new CommandBinding(ControlCommands.Switch, SwitchImage));
|
||||
|
||||
private void SwitchImage(object sender, ExecutedRoutedEventArgs e)
|
||||
@@ -34,6 +44,7 @@ namespace HandyControl.Controls
|
||||
});
|
||||
SetValue(HasValuePropertyKey, ValueBoxes.TrueBox);
|
||||
SetCurrentValue(ToolTipProperty, dialog.FileName);
|
||||
RaiseEvent(new RoutedEventArgs(ImageSelectedEvent, this));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user