lazy initialization causing system.argumentexception silverlight 2.0 beta
i've got following instance controlling rudimentary silverlight page:
public page()
{
initializecomponent();
initializeother();
}
private doublecollection dashes;
public doublecollection dashes
{
get
{
//dashes = new doublecollection(); //works ok
//dashes.add(2.0);
//dashes.add(2.0);
(dashes == null)
{
dashes = new doublecollection(); //causes exception
dashes.add(2.0);
dashes.add(2.0);
}
relapse dashes;
}
set
{
dashes = value;
}
}
private vacant initializeother()
{
line line;
(int i = 0; i < 10; i++)
{
line = new line();
line.stroke = new solidcolorbrush(colors.blue);
line.strokedasharray = dashes; //exception thrown here
line.x1 = 10;
line.y2 = 10;
line.x2 = 400;
line.y2 = 10 + (i * 40);
canvas1.children.add(line);
}
}
the above formula throws system.argumentexception line marked. fortitude problem also noted example.
does anybody know problem associated fact ability system.windows.shapes.shape.strokedasharray dependency property?
Comments
Post a Comment