Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
800
XamNumericRangeSlider with derived thumb class produces error
posted

 

I'm working on a project that uses the XamNumericRangeSlider class (xaml originally taken from an example provided with the SDK, then heavily modified) and one problem I'm having is with the thumbs that I'm using inside of the slider.  Because of some additional information needed, I had to sub-class the thumb, using the XamSliderNumericThumb as the base class.  When I put this into the thumbs collection in XAML, I get the following error in the XAML file on each thumb added:

A value of type 'LimitSliderNumericThumb' cannot be added to a collection or dictionary of type 'ObservableCollection`1'.

However, the file compiles and runs just fine, exactly as expected.  Is there something I'm doing wrong in my derived thumb class, or some other setting I need to set?  I'm assuming it's something dumb I'm missing, since I'm very new to WPF.  I've been ignoring it for quite a while, since everything still works fine, but it's getting somewhat annoying that the thumb area is really hard to read (VS is putting blue squiggly lines under the entire thumb definition).
Note that I'm using VS 2010 SP1 compiling to .NET 4.0.  A snippet of my XAML is shown below:
        <ig:XamNumericRangeSlider 
            Name="slider"
            Grid.Row="3"
            HorizontalAlignment="Stretch"
            Orientation="Vertical"
            DecreaseButtonVisibility="Collapsed"
            IncreaseButtonVisibility="Collapsed"
            MinValue="{Binding MinValue, Mode=OneWay}" 
            MaxValue="{Binding MaxValue, Mode=OneWay}" Style="{StaticResource XamNumericRangeSliderStyle}"
            >
            <Views:LimitSliderNumericThumb
                x:Name="physicalMaxRange"
                Value="{Binding MaxValue, Mode=TwoWay, UpdateSourceTrigger=Explicit}"
                DisplayValue="{Binding Path=PhysicalMax, Mode=OneTime}"
                Style="{StaticResource PhysicalLimitThumbStyle}"
                IsTrackFillVisible="False"
                IsDragEnabled="False"
                ToolTip="{x:Static UI:TextResources.LimitSettingAndMonitoringControl_physicalMaxRange_ToolTip}" />
        </ig:XamNumericRangeSlider>

 

Parents Reply Children
No Data