Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
出于教育目的,我想扩展 WP8 Map 控件以添加当前位置的属性(例如,我可以调用 myMap.CurrentLocation),然后在我的 XAML 模板中使用此自定义控件。这甚至可能吗?
如果它没有被密封,你可以继承它并添加你想要的任何其他属性。
不幸的是,它是密封的,所以我建议创建一个包含地图实例的新 UserControl,然后将您想要的任何其他属性添加到该控件。根据需要将新属性设为常规属性或 DependencyProperties,您还可以为地图控件的属性创建包装器属性或直接公开内部控件。这将取决于您的具体用例。