Select to view content in your preferred language

Disable Legend Check Box For FeatureLayer (No IsInScaleRange)?

2185
2
Jump to solution
02-03-2012 02:28 PM
Labels (1)
RyanCoodey
Frequent Contributor
I just upgraded our code base from using 2.2 to 2.4 of the ArcGIS WPF API.  I really like that the map now has a Scale property and that Feature Layers obey the scales set in the service.  So thanks for that!

My question/issue now is the legend does not show the check box grayed out for service layers (feature layers) in the legend.  I have the legend setup pretty much like the Silverlight example but in a control template (I actually made my own check box that only grays out and doesn't disable, but same concept/issue):

<CheckBox Content="{Binding Label}"     IsChecked="{Binding IsEnabled, Mode=TwoWay}"     IsEnabled="{Binding IsInScaleRange}" > </CheckBox>


Now that Feature Layers obey their scale, I would like to disable their checkbox too, but IsInScaleRange doesn't exist...  Any ideas on how to do this?  Only thing I can think of is to derive a new layer from FeatureLayer and make a property that returns if in scale range.

Thanks a lot for any help!
0 Kudos
1 Solution

Accepted Solutions
DominiqueBroux
Esri Frequent Contributor
Hi Ryan,

It seems it's a bug.
LayerItemViewModel.IsInScaleRange and LayerItemViewModel.IsVisible are not taking care of the scales set in the service when 'IgnoreServiceScaleRange' is false.

We'll try to get it fixed in a future version.

Thanks for reporting that.

View solution in original post

0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
Hi Ryan,

It seems it's a bug.
LayerItemViewModel.IsInScaleRange and LayerItemViewModel.IsVisible are not taking care of the scales set in the service when 'IgnoreServiceScaleRange' is false.

We'll try to get it fixed in a future version.

Thanks for reporting that.
0 Kudos
RyanCoodey
Frequent Contributor
Ok, no problem, we will just leave IgnoreServiceScaleRange = true until resolved.  Thanks a lot for looking into this and the info!
0 Kudos