I have XAML code:
<Ellipse x:Name="node" Height="10" Width="10" map:MapCanvas.Latitude="{Binding Latitude}" map:MapCanvas.Longitude="{Binding Longitude}" Fill="Red" Stroke="Red" StrokeThickness="1" Stretch="Uniform" </Ellipse> and this
xmlns:map="clr-namespace:MapControl;assembly=MapControl" here is the dependency property in MapCanvas class:
public static readonly DependencyProperty LatitudeProperty = DependencyProperty.RegisterAttached("Latitude", typeof(double), typeof(MapCanvas), new PropertyMetadata(double.PositiveInfinity, OnLatitudeLongitudePropertyChanged)); public static readonly DependencyProperty LongitudeProperty = DependencyProperty.RegisterAttached("Longitude", typeof(double), typeof(MapCanvas), new PropertyMetadata(double.PositiveInfinity, OnLatitudeLongitudePropertyChanged)); I know there was similar questions but my question is how can I do bining in code behind same like in XAML code for longitude and latitude?