Silvelight에서,
for (int i = 0; i < 5; i++)
{
Rectangle rect = new Rectangle();
rect.Stroke = new SolidColorBrush(Colors.Brown);
rect.Width = 50;
rect.Height = 50;
rect.SetValue(LeftProperty, 300);
rect.SetValue(TopProperty, 50 * i);
this.Children.Add(rect);
}
{
Rectangle rect = new Rectangle();
rect.Stroke = new SolidColorBrush(Colors.Brown);
rect.Width = 50;
rect.Height = 50;
rect.SetValue(LeftProperty, 300);
rect.SetValue(TopProperty, 50 * i);
this.Children.Add(rect);
}
이건 잘 돌아가는데,
List<Rectangle> rectList = new List<Rectangle>();
// ... 대충 저 List 안에 이것저것 뭘 집어넣자
for (int i = 0; i < rectList.Count; i++)
{
rectList[i].Stroke = new SolidColorBrush(Colors.Brown);
rectList[i].Width = 50;
rectList[i].Height = 50;
rectList[i].SetValue(LeftProperty, 300);
rectList[i].SetValue(TopProperty, 50 * i);
this.Children.Add(rectList[i]);
}
// ... 대충 저 List 안에 이것저것 뭘 집어넣자
for (int i = 0; i < rectList.Count; i++)
{
rectList[i].Stroke = new SolidColorBrush(Colors.Brown);
rectList[i].Width = 50;
rectList[i].Height = 50;
rectList[i].SetValue(LeftProperty, 300);
rectList[i].SetValue(TopProperty, 50 * i);
this.Children.Add(rectList[i]);
}
이건 this.Children.Add에서 Runtime Exception-_-;
WPF에선 이상 없이 돌아가는 코드였는데,
왜 Silverlight에서는 이지랄로 뒈져버리는게냐 이런 옘병할 시바랄것 니년이 그렇게 비싸? 엉?
으으으..
TAG Silverlight
댓글을 달아 주세요
rectList[i].height 같은 구문이
2007/10/05 08:58 [ ADDR : EDIT/ DEL : REPLY ]클래스에 배열이 겹쳐지는
자바의 컴파일러에 따라
저런구문을 용서못하는경우가ㅡ..ㅡ 있더라구요
rectList.Height[i] 이런식으로 바꾸면
되는데 그럼 코딩이 지저분해지고
음 지나가다 주접이였슴돠
후다닥
오호, 그렇군요.. 회사 돌아가면 다시 시도해 보아야 겠어요. 감사합니다 :)
2007/10/09 22:12 [ ADDR : EDIT/ DEL ]