是的,我是windows phone 8 dev的新手。我有问题要控制网格视图visibilty和visibilty在那个网格上的按钮。这是我的xaml视图快照。
http://www.4shared.com/photo/Hu1FVCdn/wp8.html
这是我的Xaml视图.我在左边有一个网格视图,上面有一个按钮。(1,2,3,5)这些按钮的...Visibilty是collapsed...when交易按钮,我喜欢所有的按钮,visible..But,在我的屏幕上显示了2,3个错误。
这是我的xaml.cs代码..。
public main()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.RelativeOrAbsolute));
}
private void Grid_View_Btn_1_Click(object sender, System.Windows.RoutedEventArgs e)
{
// a.Visible = !a.Visible;
a.Visibility = Visibility.Visible; //Also possible to Collapse (hide).
b.Visibility = Visibility.Visible; //Also possible to Collapse (hide).
c.Visibility = Visibility.Visible; //Also possible to Collapse (hide).
d.Visibility = Visibility.Visible; //Also possible to Collapse (hide).
e.Visibility = Visibility.Visible; //Also possible to Collapse (hide).
// TODO: Add event handler implementation here.
}这是我的xaml代码。
<Grid x:Name="grid" Height="618" Margin="6,147,0,0" Width="112" HorizontalAlignment="Left" VerticalAlignment="Top">
<Grid.Background>
<ImageBrush Stretch="Fill" ImageSource="pannel.png"/>
</Grid.Background>
<Button x:Name="a" Content="1" HorizontalAlignment="Left" Margin="-7,-11,-11,563" VerticalAlignment="Bottom" Width="130" RenderTransformOrigin="0.636,0.638" Height="66" BorderThickness="0" d:IsHidden="True">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="pannel_btn_unselected.png"/>
</Button.Background>
</Button>
<Button x:Name="b" Content="2" HorizontalAlignment="Left" Margin="-7,0,-11,519" VerticalAlignment="Bottom" Width="130" RenderTransformOrigin="0.636,0.638" Height="66" BorderThickness="0" d:IsHidden="True">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="pannel_btn_unselected.png"/>
</Button.Background>
</Button>
<Button x:Name="c" Content="3" HorizontalAlignment="Left" Margin="-7,0,-11,475" VerticalAlignment="Bottom" Width="130" RenderTransformOrigin="0.636,0.638" Height="66" BorderThickness="0" d:IsHidden="True">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="pannel_btn_unselected.png"/>
</Button.Background>
</Button>
<Button x:Name="d" Content="4" HorizontalAlignment="Left" Margin="-7,0,-11,431" VerticalAlignment="Bottom" Width="130" RenderTransformOrigin="0.636,0.638" Height="66" BorderThickness="0" d:IsHidden="True">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="pannel_btn_unselected.png"/>
</Button.Background>
</Button>
<Button x:Name="e" Content="5" HorizontalAlignment="Left" Margin="-7,0,-11,387" VerticalAlignment="Bottom" Width="130" RenderTransformOrigin="0.636,0.638" Height="66" BorderThickness="0" d:IsHidden="True">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="pannel_btn_unselected.png"/>
</Button.Background>
</Button>
</Grid>出现的错误是这个“System.Windows.RoutedEventArgs:'System.Windows.RoutedEventArgs‘不包含’可见性‘的定义,也找不到接受'System.Windows.RoutedEventArgs’类型的第一个参数的扩展方法‘可见性’(您缺少使用指令还是程序集引用?)”?
请帮我解决我的问题..。我只想在点击“交易”按钮后获得该按钮的可见度.!
发布于 2013-12-12 08:54:42
事件处理程序Grid_View_Btn_1_Click有一个参数"e“。当引用"e“时,处理程序将使用参数"e",而不是控件”e“。将处理程序参数重命名为"e2“或类似。
https://stackoverflow.com/questions/20538828
复制相似问题