0

ピボット アイテムを動的に作成しようとしていますが、

ここで私が使用したコード

paginationPivot.Items.Clear();

            for (int i = 1; i <= pagecount; i++)
            {
                TextBlock textBlock = new TextBlock();
                textBlock.Foreground = new SolidColorBrush(Colors.Blue);
                textBlock.FontSize = 30;
                textBlock.Text = (i).ToString();

                Border border = new Border();

                PivotItem pivotItem = new PivotItem() { Name="item"+i.ToString(), Header=textBlock, Content=border,Margin= new Thickness(0,-70,0,0), FlowDirection=System.Windows.FlowDirection.RightToLeft};

                paginationPivot.Items.Add(pivotItem);
            }

ここで私が得たエラー

A first chance exception of type 'System.ArgumentException' occurred in Microsoft.Phone.ni.dll

誰でもこの問題を解決するのを手伝ってくれませんか。

ありがとうございました。

しかし、ピボットアイテムの作成中にこのエラーが発生しました

4

1 に答える 1