0
다음 코드를 사용하여 팝업 창을 열 때 회색 조명 효과를 설정합니다. 그것은 잘 작동하지만 기본적으로 모든 컨트롤을 새로 고치거나 기본 창을 새로 고칩니다.wpf 팝업 윈도우 라이트 효과
특히이 라인 : currentWindow.Content = lightboxGrid;
Window currentWindow = Application.Current.Windows.Cast<Window>()
.SingleOrDefault(x => x.Name.Equals(MAIN_WINDOW_NAME));
Grid lightboxGrid = new Grid();
object currentWindowContent = currentWindow.Content;
currentWindow.Content = null;
lightboxGrid.Children.Add(new ContentControl()
{
Content = currentWindowContent
});
// now add the grid that will "black out" the content
Grid blackoutGrid = new Grid();
blackoutGrid.Background = new SolidColorBrush(Colors.Black);
lightboxGrid.Children.Add(blackoutGrid);
blackoutGrid.Opacity = 0.0; // start fully transparent
blackoutGrid.Loaded += blackoutGrid_Loaded;
currentWindow.Content = lightboxGrid;
this._lightboxEffectApplied = true;
은 무엇 메인 창을 새로 고치거나 컨트롤을 다시로드하지 않고 같은 효과를 할 수있는 옵션이 될 수 있을까?