This question is locked. New answers and comments are not allowed.
Is there a bug where MouseLeftButtonUp and Down are not triggered when there is a user control inside of a RadTabItem? Is something intercepting and handling the click before the button gets it and is there a workaround? The enter and leave events seem to be making it to the button. This is kind of a deal breaker if this functionality does not work.
Here is the code I used to illustrate the bug:
UserControl XAML:
<UserControl xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input" x:Class="RadTabTest.ControlWithButton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400" Height="300">
<Grid x:Name="LayoutRoot" Background="White">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*" />
<ColumnDefinition Width="0.5*" />
</Grid.ColumnDefinitions>
<Button x:Name="btnTest" MouseLeftButtonDown="btnTest_MouseLeftButtonDown" MouseLeftButtonUp="btnTest_MouseLeftButtonUp" Content="Click Me" MouseEnter="btnTest_MouseEnter" MouseLeave="btnTest_MouseLeave"></Button>
<dataInput:Label x:Name="lblTest" Grid.Column="1" Content="This is a label" />
</Grid>
</UserControl>
UserControl CS:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace RadTabTest
{
public partial class ControlWithButton : UserControl
{
public ControlWithButton()
{
InitializeComponent();
}
private void btnTest_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
lblTest.Content = "MouseLeftButtonDown";
}
private void btnTest_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
lblTest.Content = "MouseLeftButtonUp";
}
private void btnTest_MouseEnter(object sender, MouseEventArgs e)
{
lblTest.Content = "MouseEnter";
}
private void btnTest_MouseLeave(object sender, MouseEventArgs e)
{
lblTest.Content = "MouseLeave";
}
}
}
The XAML for the Tab Host for the UserControl:
<UserControl xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" x:Class="RadTabTest.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
<Grid x:Name="LayoutRoot">
<telerikNavigation:RadTabControl x:Name="tcTest"></telerikNavigation:RadTabControl>
</Grid>
</UserControl>
The CS for the Host:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Telerik.Windows.Controls;
namespace RadTabTest
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
RadTabItem ti = new RadTabItem();
ti.Header = "test";
ti.Content = new ControlWithButton();
tcTest.Items.Add(ti);
}
}
}