将xaml / wpf中的网格镜像到另一个xaml / wpf中

时间:2019-03-26 06:53:18

标签: wpf vb.net xaml

因此,基本上,我有一个网格名称“ gridSeatPlan”,上面带有允许用户选择的按钮。我能否将用户选择的结果显示在第二个窗口中,该窗口将显示在第二个监视器上?

我在下面使用代码,但是没有在MainMenu上得到网格的镜像。我可以知道我做错了什么吗?

<Rectangle>
    <Rectangle.Fill>
        <VisualBrush Visual="{Binding ElementName=gridSeatPlan}"/>
    </Rectangle.Fill>
</Rectangle>

这是我用来显示第二个监视器的表单的代码

If dualScreenSeatPlan = 2 Then
    Dim screen As Screen
    screen = Screen.AllScreens(dualScreenSeatPlan - 1)
    If Screen.AllScreens.Length > 1 Then
       FormSeatPlanDual = New frmSeatPlan_DualMirror
       BaseForm.ParentSeatPlanDual = FormSeatPlanDual
       FormSeatPlanDual.StartPosition = FormStartPosition.Manual
       FormSeatPlanDual.Location = screen.WorkingArea.Location
       FormSeatPlanDual.TopMost = True
       FormSeatPlanDual.Show()
    End If
ElseIf dualScreenSeatPlan = 1 Then
   Dim screen As Screen
   screen = Screen.AllScreens(dualScreenSeatPlan - 1)
   If Screen.AllScreens.Length > 1 Then
       FormSeatPlanDual = New frmSeatPlan_DualMirror
       BaseForm.ParentSeatPlanDual = FormSeatPlanDual
       FormSeatPlanDual.StartPosition = FormStartPosition.Manual
       FormSeatPlanDual.Location = Screen.PrimaryScreen.WorkingArea.Location
       FormSeatPlanDual.TopMost = False
       FormSeatPlanDual.Show()
End If

0 个答案:

没有答案