I have a problem with WPF : I would like use a slider in my XAML with an default value but when i do it, an exception is thrown :
An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in PresentationFramework.dll
this is my code:
<Slider Height="23" HorizontalAlignment="Center" Name="sliderVolume" VerticalAlignment="Top" Width="66" Grid.Row="2" ValueChanged="volume_ValueChanged" Margin="598,35,12,0" Value="100"/>
and this is my code is .cs :
private void volume_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
mediaElement.Volume = sliderVolume.Value;
}
without the default value
Value"100"
It works !