Please provide us more information. What do you mean "it doesn't work"? The code doesn't execute? It executes but doesn't display the right values? etc.
What does clicking the button have to do with any of this? They don't appear to be sharing any datapoints so most likely there is something that you're not showing us that is causing the problems.
Have you tried debugging this by putting a breakpoint inside your Slider_ValueChanged
method and then verifying it is being called. If it isn't then either the condition needed to trigger a value change isn't happening or you didn't properly register the event handler. If it is being called then step through the code line by line until it behaves the way you didn't expect. That is where the problem lies so you'll have to figure out what has to change to have the code behave the way you want. We don't have insight into your business logic for this.