public InkToolbarControl(InkingBehavior parent)
 {
     this.DefaultStyleKey = typeof(InkToolbarControl);
     this.DataContext = parent;
 }
 private static void ShowInkingObjects(InkingBehavior behavior, bool isEnabled = true)
 {
     behavior._inkCanvas.Visibility = isEnabled ? Visibility.Visible : Visibility.Collapsed;
     behavior._inkToolbar.Visibility = isEnabled ? Visibility.Visible : Visibility.Collapsed;
     behavior._annotationCanvas.Visibility = isEnabled ? Visibility.Visible : Visibility.Collapsed;
 }
        private static void EnableInking(InkingBehavior behavior, bool isEnabled = true)
        {
            if (isEnabled)
            {
                if (behavior._inkCanvas != null)
                {
                    behavior._inkCanvas.InkPresenter.IsInputEnabled = true;

                    behavior._inkCanvas.Width = (double)behavior.AssociatedObject.GetValue(FrameworkElement.ActualWidthProperty);
                    behavior._inkCanvas.Height = (double)behavior.AssociatedObject.GetValue(FrameworkElement.ActualHeightProperty);

                    behavior._inkCanvas.Visibility = Visibility.Visible;
                }

                if (behavior._inkToolbar != null) behavior._inkToolbar.Visibility = Visibility.Visible;
            }
            else
            {
                if (behavior._inkCanvas != null)
                {
                    behavior._inkCanvas.InkPresenter.IsInputEnabled = false;
                    //behavior._inkCanvas.Width = 0;
                    //behavior._inkCanvas.Height = 0;

                    //behavior._inkCanvas.Visibility = Visibility.Collapsed;
                }
                //if (behavior._inkToolbar != null) behavior._inkToolbar.Visibility = Visibility.Collapsed;
            }
        }
        public InkToolbarControl(InkingBehavior parent)
        {
            this.InitializeComponent();

            (this.Content as FrameworkElement).DataContext = parent;
        }