S57 display

4180
11
01-20-2013 08:40 PM
ModyBuchbinder
Esri Regular Contributor
Hi all

I am trying to display a S57 file in the new RunTime WPF SDK 10.1.1
The example for HydrographicS57Layer is clear and works fine.
Now I would like to control my display properties (for example NIGHT color scheme).
As far as I understand I need the HydrographicS52DisplayProperties class for this.
I cannot find the way to get HydrographicS52DisplayProperties from HydrographicS57Layer.
The HydrographicS57Layer is written in the HydrographicS52DisplayProperties help (see here:    http://resources.arcgis.com/en/help/runtime-wpf/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Advance... ).

Thanks
Mody
0 Kudos
11 Replies
EugenReiswich
New Contributor

Hi Antti,

that was a very good hint, thanks a lot!

I'm able to load my data into the example. When I check and uncheck the soundings checkbox the soundings appear and disappear from the map. However, when I try to disable soundings programmatically at start up, they just don't disappear. This is how I disable soundings:

public S57DisplayPropertiesSample()

        {

            InitializeComponent();

            // Create default instance of display properties and set that to DataContext for binding

            DataContext = HydrographicS52DisplayProperties.Default;

            HydrographicS52DisplayProperties.Default.ViewGroupProperties.Soundings = false;

            ZoomToHydrographicLayers();

        }

Is this a matter of timing or something else?

0 Kudos
EugenReiswich
New Contributor

Hi Antti,

I could sort this problem out myself. It was really a matter of timing. I had to change the display properties after all Layers were loaded:

        public S57DisplayPropertiesSample()

        {

            InitializeComponent();

            // Create default instance of display properties and set that to DataContext for binding

            DataContext = HydrographicS52DisplayProperties.Default;

            ZoomToHydrographicLayers();

        }

        // Zoom to combined extent of the group layer that contains all hydrographic layers

        private async void ZoomToHydrographicLayers()

        {

            try

            {

                // wait until all layers are loaded

                await MyMapView.LayersLoadedAsync();

                HydrographicS52DisplayProperties.Default.ViewGroupProperties.Soundings = false;

...

Thanks for your help again!

0 Kudos