Hi,
I'm using a RadTimePicker in a ControlTemplate and would like to set "DateTimeWatermarkContent" to another value. Unfortunately the value is not used and shows still "Enter time". Also I would like to change the Header on the drop down clock which has value "Clock".
Here the code:
<ContentControl Grid.Row="1" Grid.Column="1" Width="80" Style="{StaticResource styleContentControlTime}" Content="{Binding OfficeHour.MondayOpen, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" ></ContentControl>
here the style:
<Style x:Key="styleContentControlTime" TargetType="ContentControl">
<Setter Property="IsTabStop" Value="false"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Path=InEditMode}" Value="true">
<Setter Property="ContentControl.Template">
<Setter.Value>
<ControlTemplate>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<telerik:RadTimePicker SelectedValue="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContentControl}}, Path=Content, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
Margin="10,3" DateTimeWatermarkContent="" >
</telerik:RadTimePicker>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=InEditMode}" Value="false">
<Setter Property="ContentControl.Template">
<Setter.Value>
<ControlTemplate>
<Grid >
<TextBlock Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContentControl}}, Path=Content, Converter={StaticResource dateTimeToTimeStringConverter}}"
Style="{StaticResource styleTextBlock}" VerticalAlignment="Center"></TextBlock>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
regrads,
Timo
I'm using a RadTimePicker in a ControlTemplate and would like to set "DateTimeWatermarkContent" to another value. Unfortunately the value is not used and shows still "Enter time". Also I would like to change the Header on the drop down clock which has value "Clock".
Here the code:
<ContentControl Grid.Row="1" Grid.Column="1" Width="80" Style="{StaticResource styleContentControlTime}" Content="{Binding OfficeHour.MondayOpen, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" ></ContentControl>
here the style:
<Style x:Key="styleContentControlTime" TargetType="ContentControl">
<Setter Property="IsTabStop" Value="false"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Path=InEditMode}" Value="true">
<Setter Property="ContentControl.Template">
<Setter.Value>
<ControlTemplate>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<telerik:RadTimePicker SelectedValue="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContentControl}}, Path=Content, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
Margin="10,3" DateTimeWatermarkContent="" >
</telerik:RadTimePicker>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=InEditMode}" Value="false">
<Setter Property="ContentControl.Template">
<Setter.Value>
<ControlTemplate>
<Grid >
<TextBlock Text="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContentControl}}, Path=Content, Converter={StaticResource dateTimeToTimeStringConverter}}"
Style="{StaticResource styleTextBlock}" VerticalAlignment="Center"></TextBlock>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
regrads,
Timo