示例#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;
            }
        }
示例#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;
            }
        }
示例#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();
            }
        }