SOLVED
Actually, I solved the problem by removing the "Value_Changed" event from the XAML and adding it manually with C# AFTER setting the value of the slider. Otherwise it looks like the slider take the minimum value possible - Thanks to all
I have two page, one page have a slider which have to takes the value of a variable from the first page.
Main.xaml.cs
public static int val;
...//Some stuff here
val = Converti.ToInt32(roamingSetting.Value["Setting"]);
...//Some stuff there
Then the second page
Second.xaml.cs
public Settings()
{
this.InitializeComponent();
slider.Value = Main.val; //looks like this line does not do his job
}
private void slider_ValueChanged(object s, RangeBaseValueChangedEventArgs e)
{
writeToRoaming(slider.Value.Tostring());
}
Slider XAML
<Slider x:Name="slider" Minimum="5" Maximum="100" IsThumbToolTipEnabled="True" ValueChanged="slider_ValueChanged"/>
The fact is that the value of the slider is never set to the value of the setting