1
我已经在Silverlight中为Google FrameworkElementFactory搜索了一下,我们没有这个类,如果没有,我们有其他的替代方法请帮助我。Silverlight5中的FrameworkElementFactory在哪里
FrameworkElementFactory spFactory = new FrameworkElementFactory(typeof(Grid));
spFactory.Name = "myComboFactory";
spFactory.SetValue(Grid.WidthProperty, Convert.ToDouble(3));
spFactory.SetValue(Grid.HeightProperty, Convert.ToDouble(3));
spFactory.SetValue(Grid.RenderTransformProperty, new TranslateTransform(-6, -6));
FrameworkElementFactory ec1 = new FrameworkElementFactory(typeof(Ellipse));
ec1.SetValue(Ellipse.FillProperty, Brushes.Red);
spFactory.AppendChild(ec1);
上面的代码工作正常WPF广告应用程式,但现在我想要做的Silverlight5 我使用VS 2010是相同的,Silverlight5 我想补充的DataTemplate动态
感谢您的回复,但没有运气。 – Gowtham 2013-04-04 13:57:41
它应该工作...是否有例外? – 2013-04-04 15:38:44
@Siler Solver:它没有抛出异常,但没有显示任何元素..发现不同的解决方案,如Directly创建对象的Eclipse类和填充相应的颜色..感谢您的努力和瓦解时间 – Gowtham 2013-04-09 09:17:43