Exemplo n.º 1
0
        private static void ApplyCustomThumbSetting(Thumb thumb)
        {            
            var dragablzItem = thumb.VisualTreeAncestory().OfType<DragablzItem>().FirstOrDefault();
            if (dragablzItem == null) throw new ApplicationException("Cannot find parent DragablzItem for custom thumb");

            System.Diagnostics.Debug.WriteLine("ApplyCustomThumbSetting " + dragablzItem.IsDragging);

            var enableCustomThumb = (bool)thumb.GetValue(IsCustomThumbProperty);
            dragablzItem._customThumb = enableCustomThumb ? thumb : null;
            dragablzItem._templateSubscriptions.Disposable = dragablzItem.SelectAndSubscribeToThumb().Item2;

            if (dragablzItem._customThumb != null && dragablzItem._isTemplateThumbWithMouseAfterSeize)
                dragablzItem.Dispatcher.BeginInvoke(new Action(() => dragablzItem._customThumb.RaiseEvent(new MouseButtonEventArgs(InputManager.Current.PrimaryMouseDevice,
                        0,
                        MouseButton.Left) { RoutedEvent = MouseLeftButtonDownEvent })));
        }
Exemplo n.º 2
0
 public static Popup GetPopupToMove(Thumb thumb)
 {
     return (Popup) thumb.GetValue(PopupToMoveProperty);
 }
Exemplo n.º 3
0
 public static bool GetIsCustomThumb(Thumb element)
 {
     return (bool) element.GetValue(IsCustomThumbProperty);
 }