Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8645569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:35:02+00:00 2026-06-12T12:35:02+00:00

I have a TwoWay binding that controls the value of a slider: <Slider Orientation=Vertical

  • 0

I have a TwoWay binding that controls the value of a slider:

<Slider Orientation="Vertical" Height="200" Value="{Binding Path=MapScale, Mode=TwoWay}" Maximum="{Binding MaxScale}" Minimum="{Binding MinScale}" StepFrequency="0.1" />

The binding is in the ViewModel as a DependencyProperty:

    public static readonly DependencyProperty MapScaleProperty =
         DependencyProperty.Register("MapScale", typeof(Double?), typeof(MappingPageViewModel), new PropertyMetadata(0.0));

    public Double? MapScale
    {
        get { return GetValue(MapScaleProperty) as Double?; }
        set { SetValue(MapScaleProperty, value); OnPropertyChanged("MapScale"); }
    }

As the code is now, the slider updates properly when I update MapScale (e.g. MapScale += .1). But, if I remove the OnPropertyChanged method (which I was under the impression SetValue already calls), the slider doesn’t update properly.

What have I missed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T12:35:04+00:00Added an answer on June 12, 2026 at 12:35 pm

    Slider.Value is of type double, not Nullable<double>. I’ve noticed that WinRT is very picky about matching binding types. It doesn’t auto-convert most things for you like WPF and Silverlight.

    My answer is:

    Use INotifyPropertyChanged as @Adi already mentioned AND use double as the property type.

    If you’re stuck using Nullable<double> in your view-model, then create an IValueConverter that converts null to zero.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it safe to assume that WPF TwoWay data binding Wont work on controls
I am trying to set twoway binding on a UserControl that I have created.
While debugging a problem in a WPF application, I have noticed that the TwoWay
We have an app that uses simple one way binding with a GridView to
I have a listview which I have binded (twoWay) to a datatable. The binding
I have a ComboBox in wpf that twoway binds between the view and viewmodel.
I am (very) new to WPF and I have got a question regarding that.
Environment: VS2010, SL4, RIA Services I have an SL4 UI that I developed against
I have a DependencyObject class composition that looks like the following: public class A
I have a WPF application implemented using the MVVM framework that uses an ActiveX

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.