【问题标题】:WrapGrid Bug in Windows Store AppWindows Store 应用程序中的 WrapGrid 错误
【发布时间】:2013-01-02 00:18:29
【问题描述】:

我尝试在我的应用程序中初始化 WrapGrid 并设置它的 heightwidthitemheightitemwidth 然后我将 childrens 添加到它作为 Border 控件 然后我在Canvas 中添加了这个WrapGrid 作为一个孩子,就像普通的Windows 7 应用程序一样,但是我得到xaml 错误在哪里问题!!!!?

 WrapGrid new_wrap = new WrapGrid();
            new_wrap.Height = 75;
            new_wrap.Width = 75;
            new_wrap.ItemHeight = 16;
            new_wrap.ItemWidth = 16;
 Border imgborder = new Border();
                imgborder.CornerRadius = new CornerRadius(5);
                imgborder.Height = 16;
                imgborder.Width = 16;
                imgborder.BorderThickness = new Thickness(1, 1, 1, 1);
                imgborder.BorderBrush = new SolidColorBrush(Colors.Black);
                imgborder.Margin = new Thickness(10, 10, 0, 0);
                new_wrap.Children.Add(imgborder);
new_shape_g.Children.Add(new_wrap);

【问题讨论】:

    标签: c# grid windows-store-apps


    【解决方案1】:

    我发现最好的方法是使用VariableSizedWrapGrid 而不是WrapGrid,它会起作用。

    【讨论】:

      猜你喜欢
      • 2016-03-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-21
      • 2018-10-29
      • 1970-01-01
      相关资源
      最近更新 更多