I found it a little annoying that I had to drop to code behind to just have a button do nothing more than close a RadWindow it. It's fairly easy to encapsulate this into TriggerAction.
For this to work you should have installed and referenced System.Windows.Interactivity from the Blend 3 SDK.
Here's the Behavior:
And here's how to use it in XAML:
For this to work you should have installed and referenced System.Windows.Interactivity from the Blend 3 SDK.
Here's the Behavior:
using System.Windows; |
using System.Windows.Interactivity; |
using Telerik.Windows.Controls; |
namespace Mass.ThirdParty.Telerik.Behaviors |
{ |
public class CloseRadWindowTriggerAction : TriggerAction<FrameworkElement> |
{ |
protected override void Invoke(object parameter) |
{ |
var radWindow = RadWindow.GetParentRadWindow(AssociatedObject); |
if (radWindow != null) |
{ |
radWindow.Close(); |
} |
} |
} |
} |
And here's how to use it in XAML:
<Button Content="Close"> |
<i:Interaction.Triggers> |
<i:EventTrigger EventName="Click"> |
<Behaviors:CloseRadWindowTriggerAction /> |
</i:EventTrigger> |
</i:Interaction.Triggers> |
</Button> |