首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >C# WP8开发中网格视图上的Visibile/折叠按钮

C# WP8开发中网格视图上的Visibile/折叠按钮
EN

Stack Overflow用户
提问于 2013-12-12 08:51:38
回答 1查看 655关注 0票数 0

是的,我是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代码..。

代码语言:javascript
复制
  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代码。

代码语言:javascript
复制
     <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’类型的第一个参数的扩展方法‘可见性’(您缺少使用指令还是程序集引用?)”

请帮我解决我的问题..。我只想在点击“交易”按钮后获得该按钮的可见度.!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-12-12 08:54:42

事件处理程序Grid_View_Btn_1_Click有一个参数"e“。当引用"e“时,处理程序将使用参数"e",而不是控件”e“。将处理程序参数重命名为"e2“或类似。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20538828

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档