Two way binding on Minimum property of DateTimeAxis

Sep 17, 2009 at 1:09 PM

Hi,

I have a problem with two way binding on Minimum property of DateTimeAxis object. The code is:

 

<charting:LineSeries.IndependentAxis>
                    <charting:DateTimeAxis 
                            Orientation="X"
                            Minimum="{Binding Path=PowiekszenieMinimum2,Mode=TwoWay}"
                            Maximum="{Binding Path=PowiekszenieMaximum2,Mode=TwoWay}"/>
 </charting:LineSeries.IndependentAxis>

 object _minimum2 = null;
        public object PowiekszenieMinimum2
        {
            get
            {
                return _minimum2;
            }
            set
            {
                _minimum2 = value;
                OnPropertyChanged("PowiekszenieMinimum2");
            }
        }
        object _maximum2 = null;
        public object PowiekszenieMaximum2
        {
            get
            {
                return _maximum2;
            }
            set
            {
                _maximum2 = value;
                OnPropertyChanged("PowiekszenieMaximum2");
            }
        }

After load data to chart series, minimum and maximum property is set automatically on chart (they fit data), but it doesn't set PowiekszenieMinimum2 and PowiekszenieMaximum2. Why? What should I do to set those properties by two way binding? When I set Minimum property manually, binding works nice. Thx for help

Dave

 

 

 

Sep 17, 2009 at 1:54 PM

I found that after load data to chart's series Minimum and Maximum properties are not set, but ActualMinimum and ActualMaximum are set. The problem is, i can't bind to them in XAML. Any idea?

Coordinator
Sep 18, 2009 at 9:50 PM

ActualMaximum/ActualMinimum are DependencyProperties and therefore one should be able to bind to them. If you think about them like Width/ActualWidth, then that's probably the right way. Looking at what the code above is doing, I don't think that scenario would work for Width/ActualWidth, either. Maybe it would be possible to do things slightly differently?