编程在Silverlight结合Silverlight

2023-09-03 07:01:22 作者:候补情人

我错过了船的东西在这里,孩子们。这样可以使饲养它的头,我不知道发生了什么与怎么回事,所以我希望我的homeys在这里可以帮助。

在Silverlight中工作时,当我创建我的C#code绑定,他们从来没有托起应用程序运行时。从我的XAML中声明绑定看起来不错,但我做错了什么,当我创建我的C#绑定。我希望有一些言自明我失踪。下面是一个典型的绑定,被粉碎的:

 的TextBlock TB =新的TextBlock();
结合B =新的绑定(字号);
b.Source =这一点;
tb.SetBinding(TextBlock.FontSizeProperty,B);
 

解决方案

它看起来像Silverlight的3.1,至少,这不再是一个问题。我不能复制它,无论如何。

I'm missing the boat on something here, kids. This keeps rearing its head and I don't know what's going on with it, so I hope my homeys here can help.

开发简单的Silverlight 2应用程序

When working in Silverlight, when I create bindings in my c# code, they never hold up when the application is running. The declarative bindings from my xaml seem ok, but I'm doing something wrong when I create my bindings in C#. I'm hoping that there is something blindingly obvious I'm missing. Here's a typical binding that gets crushed:

TextBlock tb = new TextBlock();
Binding b = new Binding("FontSize");
b.Source = this;
tb.SetBinding(TextBlock.FontSizeProperty, b);

解决方案

It looks like as of Silverlight 3.1, at least, this is no longer an issue. I can't reproduce it, at any rate.