绑定MapPolyline

时间:2014-02-20 10:59:01

标签: c# windows-phone-8 binding maps toolkit

如何绑定MapPolyline?我试图使用工具包,但它没有用。 这是我的代码:

 <Controls:Map Grid.Row="1" Name="myMap">
            <MapToolkit:MapExtensions.Children>
                <MapToolkit:MapItemsControl Name="MapElements" 
                                            ItemsSource="{Binding Locations, Mode=TwoWay}">
                    <MapToolkit:MapItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Controls:MapPolyline StrokeColor="Red" 
                                                  StrokeThickness="3" 
                                                  Path="{Binding MapPolyline}"></Controls:MapPolyline>
                        </DataTemplate>
                    </MapToolkit:MapItemsControl.ItemTemplate>
                </MapToolkit:MapItemsControl>
                <MapToolkit:Pushpin Name="TapPushpin" 
                                    Content="Tapped position" 
                                    Background="{StaticResource PhoneAccentBrush}" 
                                    GeoCoordinate="{Binding TapCoordinate}" />                   
            </MapToolkit:MapExtensions.Children>
        </Controls:Map>

我从这个属性绑定路径:

private GeoCoordinateCollection _mapPolyline;
    public GeoCoordinateCollection MapPolyline
    {
        get { return _mapPolyline; }
        set
        {
            _mapPolyline = value;
            RaisePropertyChanged(() => MapPolyline);
        }
    }

0 个答案:

没有答案