我必须在后面的代码中对silverlight网格进行一些操作。我目前正在Grid_loaded事件中执行此操作。这并不理想,因为网格加载随着代码所做的更改而闪烁。这显然是因为在网格加载后进行了操作。我需要做的操作不能通过数据绑定来完成。
我可以在其他地方放置此代码吗?在asp .net中,我会在预呈现中这样做。
有什么建议吗?
由于
答案 0 :(得分:0)
我有数据绑定工作,所以问题解决了。我对这样的房产具有约束力......
public object ListingBG
{
get
{
if (!string.IsNullOrEmpty(ListingBGString))
{
// bind Image
return new ImageBrush
{
ImageSource = new BitmapImage(new Uri(ListingBGString, UriKind.RelativeOrAbsolute))
};
}
// bind color hex (RGB hex or RGB+Alpha hex)
return "#FFFFFFFF";
}
}