I have created a custom control by deriving a class from the RadMaskedNumericInput control. It works fine until I create a resource style for it. Once the style exists, the control is no longer visible when running the app. When I tab, I can still give it focus, but it is not visible. It is visible when on a page in Visual Studio designer. I am working in WPF. The problem does not occur when wrapping the RadDatePicker.
Here is the derived class:
Here is the derived class:
public class ccNumericTextBox : RadMaskedNumericInput
{
public ccNumericTextBox()
{
}
public override void EndInit()
{
base.EndInit();
}
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
{
this.SelectAll();
base.OnGotKeyboardFocus(e);
}
}
Here is the XAML:
<cc:ccNumericTextBox x:Name="txtDuration" Padding="2" Mask="#3.1" Height="22" Value="{Binding Path=Hours, Mode=TwoWay}"/>
Here is the Style:
<Style TargetType="{x:Type cc:ccNumericTextBox}">
<Setter Property="Margin" Value="3,3,3,3"/>
</Style>