<Grid Margin="405,192,170,450" >
<Slider Name="speedSlider" Value="1" Style="{StaticResource SliderStyle}" HorizontalAlignment="Left" VerticalAlignment="Bottom"
Minimum="0" Maximum=" 50" TickFrequency="5" TickPlacement="None" Width="160"/>
<Label Name="lblSliderSpeed" Content="{Binding ElementName=speedSlider, Path=Value, UpdateSourceTrigger=PropertyChanged}"
Grid.Column="1" VerticalAlignment="Bottom" HorizontalAlignment="Right" ContentStringFormat="{}{0:#}"/>
</Grid>
My label
show the current slide
value
while the value
changing but at the minimum value
(0) my label
not shows any value
i also try this code behind and this still not helped although the if is executed:
private void speedSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
double value = speedSlider.Value;
if (value == 0)
{
lblSliderSpeed.Content = value;
}
}
The problem is with your
ContentStringFormat
Change theContentStringFormat
to Like thisAnd No code Required In page Behind.
Because,The "#" custom format specifier serves as a digit-placeholder symbol. If the value that is being formatted has a digit in the position where the "#" symbol appears in the format string, that digit is copied to the result string. Otherwise, nothing is stored in that position in the result string.
For more Information '#' Formation Here and for "0" Formation click here