Bug Report T306985
Visible to All Users

The MapControl.CoordinateSystem property value is not accessible using the binding expression

created 9 years ago

I have used MapProjection property of a Layer in MapControl to use in my ViewModel to calculate some distances. Since MapProjection is deprecated I should use MapControl.CoordinateSystem to do the same. However the property is never set. Even if I want to use it directly (not by binding) it is not set. I have to cast MapControl to IMapView to get the CoordinateSystem property. So MapControl.CoordinateSystem is null but (MapControl as IMapView).CoordinateSystem is set.

Comments (2)
DevExpress Support Team 9 years ago

    Hi Gregor,

    Thank you for your report. My attempts to reproduce a similar issue in a newly created application were not successful. Please refer to the attachment and feel free to modify the source code to illustrate the issue. We will be happy to help you.

      The problem is when you have a binding to CoordinateSystem property. I changed the project to show it.

      Answers approved by DevExpress Support

      created 9 years ago

      We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

      Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

        created 9 years ago

        Hi Gregor,

        I have modified the source code and included the MapControl.CoordinateSystem property initialization there. In my tests, changes are correctly reflected in your model class:

        C#
        public MainWindow() {           InitializeComponent();           model = new MainViewModel();           DataContext = model;       }       MainViewModel model;       private void Window_Loaded(object sender, RoutedEventArgs e) {           this.mapControl1.CoordinateSystem = new GeoMapCoordinateSystem();           MessageBox.Show(model.MapCoordinateSystem.ToString());       }

        Please let me know if you find this approach appropriate or you have any questions. I will be happy to help you.

          Show previous comments (4)
          DevExpress Support Team 9 years ago

            Hi Gregor,

            Thank you for the update. My attempts to reproduce a similar issue were not successful. Attached is an updated sample project that prints the model's MapCoordinateSystem value after the application window is loaded. Please test it on your machine and let me know how it works for you.

              Sorry, I still had some references to version 15.1.7. It works now. Thank you for your help.

              DevExpress Support Team 9 years ago

                Thank you for your confirmation, Gregor. It is good news that the problem has been resolved.

                Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.