I used your XAML code without the associated styles for the Navigation and ScaleBar controls and was not able to reproduce your problem. Looks like you have some issues in your styles.
What do "ScaleBarValue1_Loaded", "ScaleBarValue2_Loaded", and "ScaleBarValue_Loaded" do in your style and why you have them?
The Loaded event on ScaleBarValue TextBlock is not necessary. The thread you are referring to had a specific use case where the current value of ScaleBar is needed to be tracked and converted to a different unit. Ryan's follow-up post #5 proposed an easier way to retrieve the TextBlock using FindName().If your application does not need to do this extra stuff and you only want to change the look and feel of the controls, just start from the default template. If you have Expression Blend, here's a blog on how it can be accomplished: http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2010/05/20/Use-control-templates-to-customize-the-look-and-feel-of-ArcGIS-controls.aspx
I suggest you do the following first before customizing the style.1. Use ExpressionBlend to get the default style (http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2010/05/20/Use-control-templates-to-customize-the-look-and-feel-of-ArcGIS-controls.aspx)2. Use FindName() to get the current scalebar value as suggested in post #5 (http://forums.arcgis.com/threads/15157-Access-ScaleBars-Current-Value)3. Subscribe to your map's ExtentChanged and retrieve the value as suggested in post #6 in the same thread as above4. Perform your own calculation of getting the partial values (I'm not exactly sure how you arrived at the formula, currentvalue * 2 /10 or currentvalue * 6 /10) but check that they are correct.5. If the default style and the calculation works fine, update the style to include your 2 additional TextBlocks.I think breaking it down into steps/parts, will help you find why the scalebar did not load in the first place.
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.