BallsGame.Helpers.BindingHelper.HandleCanvasBindingPathChanged C# (CSharp) Метод

HandleCanvasBindingPathChanged() приватный статический Метод

private static HandleCanvasBindingPathChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void
d Windows.UI.Xaml.DependencyObject
e Windows.UI.Xaml.DependencyPropertyChangedEventArgs
Результат void
        private static void HandleCanvasBindingPathChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var propertyPath = e.NewValue as string;

              if (propertyPath != null)
              {
            var canvasProperty =
            e.Property == CanvasLeftBindingPathProperty
            ? Canvas.LeftProperty
            : Canvas.TopProperty;

            BindingOperations.SetBinding(
            d,
            canvasProperty,
            new Binding { Path = new PropertyPath(propertyPath) });
              }
        }