我只想在WPF
个页面之间切换,但得到上述错误:
" Show不是WpfApplication1.Page2" 的成员。
这是我的代码
Imports System.Windows.Forms
Public Class Page1
' Private Property Page2 As WpfApplication1.Page2
Private Sub btn1_Click(sender As Object, e As RoutedEventArgs) Handles btn1.Click
Dim dd As New Page2
dd.Show(Me)
'dd.ShowDialog(Me)
Me.txt1.Text = (dd.txt10.Text)
End Sub
End Class
第2页xaml代码
<Page x:Class="Page2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
Title="Page2">
<Grid>
<Button x:Name="button1" Content="Button" HorizontalAlignment="Left" Margin="163,62,0,0" VerticalAlignment="Top" Width="101" Height="55"/>
<TextBox x:Name="txt10" HorizontalAlignment="Left" Height="23" Margin="38,81,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="120"/>
</Grid>
第2页代码
Imports System.Windows.Forms
班级第2页
结束班
请指导我做错了什么。
答案 0 :(得分:-1)
Dim dd As New Page2
Me.Content = dd