質問

I have a FixedPage class as follows

        PageContent pageContent = new PageContent();
        FixedPage fixedPage = new FixedPage();
        double pageWidth = 96 * 8.5;
        double pageHeight = 96 * 11;
        fixedPage.Width = pageWidth;
        fixedPage.Height = pageHeight;
        Size sz = new Size(8.5 * 96, 11 * 96);
        fixedPage.Measure(sz);
        fixedPage.Arrange(new Rect(new Point(), sz));
        fixedPage.UpdateLayout();

        ((IAddChild)pageContent).AddChild(fixedPage);

and an IEnumerable object as follows

IEnumerable<FixedPage> page;
page.Concat(new[] { fixedPage });

in the line

page.Concat(new[] { fixedPage });

Its showing error as

'Use of unassigned local variable 'page''

How can I assign fixedPage to page?

I also need help to create a fixedPage object(elements)

役に立ちましたか?

解決

You should initialize the page variable by creating a new instance of a class, which implements the IEnumerable interface, for example the generic List class:

IEnumerable<FixedPage> page = new List<FixedPage>(new FixedPage[] { fixedPage });
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top