问题描述
Metro 风格的 Windows 8 应用程序中 System.Device.Location.GeoCoordinate.GetDistanceTo 方法的等价物是什么.
What is the equivelant of the System.Device.Location.GeoCoordinate.GetDistanceTo method in Metro style Windows 8 Applications.
Metro 应用程序具有 Geocoordinate 类(带有小写C"),但没有 GetDistanceTo 方法.
Metro applications have the Geocoordinate class (With a lower case 'C') but no GetDistanceTo method.
其次,Metro Geocoordinate 类没有构造函数.如何创建它的实例.
Secondly, the Metro Geocoordinate class has no constructor. How can I create an instance of it.
推荐答案
Metro Geocoordinate
由于某种原因没有 public
构造函数.在我看来,实现这一点的最佳方法是使用 Reflector 并复制 System.Device.Location.GeoCoordinate
的实现,这也会为您提供 GetDistanceTo
.
The Metro Geocoordinate
has no public
constructor for some reason. The best way to implement this in my opinion is to use Reflector and copy the implementation of System.Device.Location.GeoCoordinate
which will also give you GetDistanceTo
.
希望这会在以后重新添加到 API 中.
Hopefully this will be re-added to the API at a later time.
这篇关于Windows 8 Metro 风格应用中 .NET GeoCoordinate.GetDistanceTo 的等价物的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!