Exemple #1
0
        /// <summary>
        /// VerticalOffsetProperty property changed handler.
        /// </summary>
        /// <param name="d">Window that changed its VerticalOffset.</param>
        /// <param name="e">DependencyPropertyChangedEventArgs.</param>
        private static void OnVerticalOffsetPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DraggableWindow dp = d as DraggableWindow;

            if (dp.RenderTransform is TranslateTransform)
            {
                (dp.RenderTransform as TranslateTransform).Y = (double)e.NewValue;
            }
        }
Exemple #2
0
        /// <summary>
        /// IsHeightResizeableProperty property changed handler.
        /// </summary>
        /// <param name="d">Window that changed its VerticalOffset.</param>
        /// <param name="e">DependencyPropertyChangedEventArgs.</param>
        private static void OnIsHeightResizeablePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DraggableWindow dp = d as DraggableWindow;

            if (dp.ResizeHeight != null)
            {
                dp.ResizeHeight.IsHitTestVisible = (bool)e.NewValue;
            }
        }
Exemple #3
0
        /// <summary>
        /// IsOpenProperty property changed handler.
        /// </summary>
        /// <param name="d">Window that changed its IsOpen.</param>
        /// <param name="e">DependencyPropertyChangedEventArgs.</param>
        private static void OnIsOpenPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DraggableWindow dp     = d as DraggableWindow;
            bool            isOpen = (bool)e.NewValue;

            dp.Visibility = isOpen ? Visibility.Visible : Visibility.Collapsed;
            if (isOpen)
            {
                dp.OnOpened();
            }
            else
            {
                dp.OnClosed();
            }
        }