예제 #1
0
        /// <summary>
        /// Generates a new <see cref="BindingEventContainer"/> for the specified Skia element and binding property.
        /// </summary>
        /// <param name="skiaElement">The skia element.</param>
        /// <param name="bindingProperty">The binding property.</param>
        /// <returns></returns>
        public static BindingEventContainer Generate(SkiaFrameworkElement skiaElement, BindingProperty bindingProperty)
        {
            BindingEventContainer container = new BindingEventContainer(skiaElement, bindingProperty);

            Binding binding = new Binding();

            binding.Mode    = BindingMode.OneWay;
            binding.Source  = skiaElement.WpfElement;
            binding.Path    = new PropertyPath(bindingProperty.DependencyProperty);
            binding.IsAsync = true;
            BindingOperations.SetBinding(container, BindingEventContainer.ValueProperty, binding);

            return(container);
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BindingEventContainer"/> class.
 /// </summary>
 /// <param name="skiaElement">The skia element.</param>
 /// <param name="bindingProperty">The binding property.</param>
 public BindingEventContainer(SkiaFrameworkElement skiaElement, BindingProperty bindingProperty)
 {
     SkiaElement     = skiaElement;
     BindingProperty = bindingProperty;
 }