zoukankan      html  css  js  c++  java
  • win8 app GridView点击子项布局变更

    要触发点击必须设置IsItemClickEnabled="True"

    要变更布局代码如下:

     private void gridView_ItemClick_1(object sender, ItemClickEventArgs e)
            {
                ColorModel model = (e.ClickedItem as ColorModel);//自定义的类
                model.ColSpan = 2;//占的格数
                model.RowSpan = 2;//占的格数
                (VisualTreeHelper.GetChild(((VisualTreeHelper.GetChild(gridView, 0) as Border).Child as ScrollViewer).Content as FrameworkElement, 1) as VariableSizedWrapGrid).Children[gridView.Items.IndexOf(e.ClickedItem)].SetValue(Windows.UI.Xaml.Controls.VariableSizedWrapGrid.ColumnSpanProperty, model.ColSpan);
                (VisualTreeHelper.GetChild(((VisualTreeHelper.GetChild(gridView, 0) as Border).Child as ScrollViewer).Content as FrameworkElement, 1) as VariableSizedWrapGrid).Children[gridView.Items.IndexOf(e.ClickedItem)].SetValue(Windows.UI.Xaml.Controls.VariableSizedWrapGrid.RowSpanProperty, model.RowSpan);
                (VisualTreeHelper.GetChild(((VisualTreeHelper.GetChild(gridView, 0) as Border).Child as ScrollViewer).Content as FrameworkElement, 1) as VariableSizedWrapGrid).InvalidateArrange();//重新布局
                (VisualTreeHelper.GetChild(((VisualTreeHelper.GetChild(gridView, 0) as Border).Child as ScrollViewer).Content as FrameworkElement, 1) as VariableSizedWrapGrid).InvalidateMeasure();//重新计算

    }

  • 相关阅读:
    AWS 监控服务(六)
    PB赋值粘贴
    oracle中的替换函数replace和translate函数
    instr函数
    The test form is only available for requests from the local machine
    ORACLE提交事务回滚
    PB开发境界 多个DW进行update
    plsql使用技巧
    pb 11 数据窗口空白,预览pb崩溃解决方案
    oracle函数
  • 原文地址:https://www.cnblogs.com/wangjinming/p/4594876.html
Copyright © 2011-2022 走看看