Is there any way to assign a callout to (say) the Open Image Button of the RadImageEditorUI?
I can't seem to find any way to get a reference to a button within the RadImageEditorUI control so I can assign it to a callout.
Thanks
2 Answers, 1 is accepted
0
Martin Ivanov
Telerik team
answered on 02 Apr 2021, 11:25 AM
Hello Richard,
The buttons in the RadImageEditorUI's ControlTemplate don't have public accessors. The easiest way to get those is to use the ChildrenOfType<T> extension method. Here is an example in code:
private void RadImageEditorUI_Loaded(object sender, RoutedEventArgs e)
{
var editorUI = (RadImageEditorUI)sender;
var templateButtons = editorUI.ChildrenOfType<RadButton>();
RadButton openButton = templateButtons.FirstOrDefault(b => b.Command == editorUI.OpenCommand);
var callout = new RadCallout()
{
Background = Brushes.DeepSkyBlue,
Content = "Click this button to open an image from the file system.",
ArrowAnchorPoint = new Point(-0.02, 0.5),
ArrowBasePoint1 = new Point(0, 0.40),
ArrowBasePoint2 = new Point(0, 0.60)
};
CalloutPopupSettings settings = new CalloutPopupSettings()
{
Placement = System.Windows.Controls.Primitives.PlacementMode.Right,
};
CalloutPopupService.Show(callout, openButton, settings);
}
I hope this helps.
Regards,
Martin Ivanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.