halkar / xamarin-range-slider

Range slider for Xamarin and Xamarin.Forms
https://www.nuget.org/packages/Xamarin.Forms.RangeSlider/
MIT License
90 stars 51 forks source link

I am binding the Data using MVVM structure. #142

Closed esolzDotnet closed 6 years ago

esolzDotnet commented 6 years ago

But the New value is not reflecting changed by the user in the Model. what's the issue ?

halkar commented 6 years ago

Sample project please.

esolzDotnet commented 6 years ago
<forms:RangeSlider x:Name="rangeslider_Prev_salary" VerticalOptions="Center" StepValue="10" StepValueContinuously="True" 
                                                                       TextSize="15" TextColor="#ED4350" ActiveColor="#ED4350" BarHeight="10" ShowTextAboveThumbs="true"
                                                                       MinimumValue="{Binding MinimumSalary}"
                                                        MaximumValue="{Binding MaximumSalary}" LowerValue="{Binding BaseSalary}" UpperValue="{Binding EndSalary}"/>

This is my code..

halkar commented 6 years ago

Can you provide a minimal solution reproducing the problem?

esolzDotnet commented 6 years ago

actually that was my view page. now i am pasting my model view.

public long BaseSalary
        {
            get
            {
                return _baseSal;
            }
            set
            {
                _baseSal = value;
                NotifyPropertyChanged("BaseSalary");
            }
        }

        public long EndSalary
        {
            get
            {
                return _endSal;
            }
            set
            {
                _endSal = value;
                NotifyPropertyChanged("EndSalary");
            }
        }

        public long MinimumSalary
        {
            get
            {
                return _minSal;
            }
            set
            {
                _minSal = value;
            }
        }

        public long MaximumSalary
        {
            get
            {
                return _maxsal;
            }
            set
            {
                _maxsal = value;
            }
        }

i hope is right for you!!

halkar commented 6 years ago

Apparently, you forgot to add Mode=TwoWay to your bindings.

halkar commented 6 years ago

Please reopen if you reckon that problem is not solved.