C# 我的按钮没有';不能在方法内部工作
我有一个带有反应表单的xaml页面。我在列表框中动态加载这个反应,但是我在这个反应上使用的按钮不起作用。我将反应作为对象加载到列表框中 这就是反应C# 我的按钮没有';不能在方法内部工作,c#,wpf,xaml,object,listbox,C#,Wpf,Xaml,Object,Listbox,我有一个带有反应表单的xaml页面。我在列表框中动态加载这个反应,但是我在这个反应上使用的按钮不起作用。我将反应作为对象加载到列表框中 这就是反应 <Grid x:Name="LayoutRoot" VerticalAlignment="Stretch"> <Border Background="DarkGray" CornerRadius="10" Width="400"> <StackPanel Orientation="Vertical
<Grid x:Name="LayoutRoot" VerticalAlignment="Stretch">
<Border Background="DarkGray" CornerRadius="10" Width="400">
<StackPanel Orientation="Vertical" Width="400" Background="DarkGray" Margin="10,10,10,10">
<Grid>
<TextBlock HorizontalAlignment="Left" Name="tbDateCreated" Text="tbDateCreated" VerticalAlignment="Stretch" FontSize="15" TextWrapping="NoWrap" FontFamily="Segoe WP" Width="152" TextAlignment="Left" Foreground="White" Margin="190,0,0,0" />
<TextBlock HorizontalAlignment="Left" Name="tbTimeCreated" Text="tbTimeCreated" VerticalAlignment="Stretch" FontSize="15" TextWrapping="NoWrap" FontFamily="Segoe WP" Width="152" TextAlignment="Left" Foreground="White" Margin="270,0,-70,0" />
<TextBlock HorizontalAlignment="Left" Name="tbAuthor" Text="tbAuthor" VerticalAlignment="Stretch" FontSize="15" TextWrapping="NoWrap" FontFamily="Segoe WP" FontWeight="Bold" TextAlignment="Left" Margin="10,0,0,0" Width="158" Foreground="White" />
</Grid>
<TextBlock HorizontalAlignment="Stretch" Name="tbContent" Text="tbContent" VerticalAlignment="Stretch" FontSize="15" TextWrapping="Wrap" FontFamily="Segoe WP" TextAlignment="Left" Margin="10,5,20,0" Foreground="White" />
<Line Stretch="Fill" Stroke="Black" X1="0" X2="1" Y1="0" Y2="0" Margin="10,20,10,0" />
<Border Background="Gray" Width="90" Height="30" Margin="-290,10,0,0" CornerRadius="10">
<Button x:Name="reageer" BorderBrush="Gray" Background="Gray" Margin="-5,-12,0,0" Height="60" Width="100" FontSize="12" Click="Button_Click" Tap="reageer_Tap" Content="Reageer" VerticalContentAlignment="Top"/>
</Border>
</StackPanel>
</Border>
</Grid>
在下一页,我加载这个反应
<ListBox Margin="0,0,0,20" Name="lbComments" VerticalAlignment="Top" IsHitTestVisible="False"/>
如何使用我的反应中的按钮在列表框所在的页面上工作?为什么设置IshitteVisible=“False”?需要吗?它可能会导致按钮无法正常工作。我现在很惭愧它起作用了:thx。我只是为了别的什么
<ListBox Margin="0,0,0,20" Name="lbComments" VerticalAlignment="Top" IsHitTestVisible="False"/>