Exemplo n.º 1
0
        private void DragButton_Click(object sender, RoutedEventArgs e)
        {
            if (Owner == null)
            {
                return;
            }

            var opaque = (sender as ToggleButton).IsChecked.Value;

            Owner.IsHitTestVisible = opaque;

            var hwnd = new WindowInteropHelper(Owner).Handle;

            if (opaque)
            {
                WindowsServices.SetWindowExOpaque(hwnd);
            }
            else
            {
                WindowsServices.SetWindowExTransparent(hwnd);
            }

            e.Handled = true;
        }
Exemplo n.º 2
0
        private void Window_SourceInitialized(object sender, EventArgs e)
        {
            var hwnd = new WindowInteropHelper(this).Handle;

            WindowsServices.SetWindowExTransparent(hwnd);
        }