2012-10-17 4 views
0

DragMove를 통해 특정 영역으로 이동하면 창을 드래그 할 때 해당 영역에 반투명 창 오버레이를 표시하려고합니다.WPF 창을 앞으로 가져 오기

윈도우가 잘 보이지만 항상 드래그하고 있던 윈도우의 맨 위에 올 것입니다.

오버레이를 표시 한 후에 .focus/.activate와 같은 다양한 시도를했지만 작동하지 않았습니다.

각 창은 WindowStyle="None" Topmost="True" ShowInTaskbar="False"이고 오버레이 창은 IsHitTestVisible="False" Focusable="False"입니다. 하지만 가시성이 켜지면 오버레이는 여전히 초점을 얻습니다.

답변

-1

내가 발견 한 유일한 것은 내 메인 윈도우를 숨긴 다음 다시 보여주었습니다. 비록 내가 깜박 거리지 않기를 원했기 때문에, 나는 디스패처를 작동시키는 동안 그것을 작동시키지 않았다. 이것은 아름답게 일하는 것을 끝내었다. 온라인에서 유사한 문제를 찾을 수 없어서 다음 사람을 도울 수 있도록 게시했습니다.

private void showOverlay() 
{ 
    //show the docking window 
    _overlayWindow.Visibility = Visibility.Visible; 

    //problem here will be that the overlay window will be on top of main 
    //this.focus this.activate +other efforts did not work to bring main back on top 

    //only thing i could find that would bring the main win on top is to hide/show it again. 
    //i wrap this hide/show in a disabled dispatcher block so that the window never really gets hidden on screen 

    using (var d = Dispatcher.DisableProcessing()) 
    { 
    this.Visibility = Visibility.Hidden; 
    this.Visibility = Visibility.Visible; 
    } 
} 
+1

더 좋은 점을 대비하여 다른 솔루션을 자유롭게 게시하십시오. –

관련 문제