有什么理由我不应该在彼此之上使用两个 ContentPresenters 来模拟弹出窗口 window?

Is there any reason I shouldn't use two ContentPresenters on top of each other to emulate a pop up window?

例如:

    <Viewbox>
        <ContentPresenter Content="{Binding CurrentView}" />
    </Viewbox>

    <!--This is the popup presenter, which overlays the whole screen and displays a popup when one is active-->
    <Viewbox>
        <ContentPresenter Content="{Binding PopUpView}" />
    </Viewbox>
</Grid>

然后,PopUpView 中的视图将在中间有一个边框,显示消息和半透明背景,使其看起来像原始视图没有焦点。有什么理由避免这种方法吗?

答案当然是因为已经有一个 Popup class 专门用来处理这种情况,包括您可能会遇到的所有焦点问题等?