0

我尝试WrapGrid在我的应用程序中初始化并设置它,height然后width我将孩子作为控件添加到它然后我将它作为一个孩子添加到与普通 Windows 7 应用程序相同的地方,但我发现问题出在哪里!!!! ?itemheightitemwidthBorderWrapGridCanvasxaml

 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);
4

1 回答 1

0

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

于 2013-01-02T02:18:07.600 回答