Query 1
Value cannot be entered in SfMaskedEdit after setting EndTime value to null |
We have checked your reported query and the reported behavior occurs due to mask regex expression(HH:MM format) is not supported with OR operations. Currently we are validating your reported query and we will provide more details on Aug 8th ,2019.
|
Query 2
Forum Thead 145485 – Forum thread patch could not be accessible
|
Forum thread patch will not be accessible for all users. The patch could be downloaded only for the customer who created the forum thread or patch must be generated with particular customer id. |
<ControlTemplate x:Key="validationErrorTemplate">
<DockPanel>
<TextBlock Foreground="Red" DockPanel.Dock="Top">Error</TextBlock>
<AdornedElementPlaceholder x:Name="ErrorAdorner"/>
</DockPanel>
</ControlTemplate>
<sf:SfMaskedEdit x:Name="maskededit" Margin="5"
Validation.ErrorTemplate="{StaticResource validationErrorTemplate}"
ValidationMode="{Binding ElementName=validation ,Path=Text}"
Mask="00:00"
MaskType="Simple" >
<sf:SfMaskedEdit.Style>
<Style TargetType="sf:SfMaskedEdit">
<Style.Triggers>
<Trigger Property="ValidationMode" Value="KeyPress">
<Setter Property="Text">
<Setter.Value>
<Binding Path="Value" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
<Binding.ValidationRules>
<local:TimeValidator/>
</Binding.ValidationRules>
</Binding>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="ValidationMode" Value="LostFocus">
<Setter Property="Text">
<Setter.Value>
<Binding Path="Value" Mode="TwoWay" UpdateSourceTrigger="LostFocus">
<Binding.ValidationRules>
<local:TimeValidator/>
</Binding.ValidationRules>
</Binding>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</sf:SfMaskedEdit.Style>
</sf:SfMaskedEdit> |
if (value == null)
return new ValidationResult(false, "value cannot be empty.");
else
{
int hour = 0, minute = 0;
if (value.ToString() != string.Empty && Int32.TryParse((value.ToString().Substring(0, 2)), out int x))
hour = x;
if (value.ToString() != string.Empty && Int32.TryParse((value.ToString().Substring(3, 2)), out int y))
minute = y;
// sets the validation result to "false" when we need to restrict the Hour inputs.
if (hour > 23)
return new ValidationResult(false, "Hour cannot be higher than 23.");
// sets the validation result to "false" when we need to restrict the Minutes inputs.
if (minute > 59)
return new ValidationResult(false, "Minute higher than 59.");
}
return ValidationResult.ValidResult; |