locked
Is there any way to know the value changed event of a Slider is trigged by code or user operation?

    Question

  • Is there any way to know the value changed event of a Slider is trigged by  code or user operation?

    I don't want to receive the event when I change the slider's current value by code.

    Wednesday, July 18, 2012 9:43 AM

Answers

All replies

  • Hello,

     

    As far as I know, there is no directly way to know if this event fired by the user or codes. But in metro application, only your codes can change this value, so that you don't worry other application can change this value.

     

    Therefore, you can set a global value, if your codes change the slider value, you change the global value. In the value change event,  you can check the global value. You will know if this value change by codes.

     

     
    <Slider HorizontalAlignment="Left" Margin="344,263,0,0" VerticalAlignment="Top" Width="227" ValueChanged="Slider_ValueChanged_1"  />
    

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, July 19, 2012 9:06 AM
  • Jesse:

    Thanks for your replay. Let me try.

    By the way, how to receive the event when the user click on the slider? I can receive ManipulationStarted and ManipulationCompleted, but PointerPressed never be received.

    Friday, July 20, 2012 1:47 AM
  • Yes, the PointerPressed event not works in slider, you can change it with ManipulationStarted event.
    http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/d33239cf-3a3d-4164-940f-7e49f63f7806

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by ytshe Monday, July 30, 2012 2:06 AM
    Tuesday, July 24, 2012 9:14 AM
  • Jesse:

    Thanks.

    I still can't receive the event when I click on the slider without drag operation. If I drag the slider, the event can be received.

    Monday, July 30, 2012 2:05 AM