小编Lex*_*kov的帖子

数组初始值设定项中的C#源代码格式

是否可以在VS.NET 2010中的数组初始值设定项中启用C#源代码格式化?

Elements =
{
// starting from here source code formatting does not work
  new TextViewModel("PublicId") 
  { 
    Label = new LText("Fund Nr:", "de", "Fondsnummer"),
    Watermark = new LText("Please enter fund number...", "de", "Bitte hier Fondsnummer erfassen...")
  },
  new CheckViewModel("Juristic")
  {
    Style = "Radio",
    Default = true,
    Label = new LText("Juristic Fund", "de", "Juristischer Fonds")
  }
}    
// starting from here source code formatting works again
Run Code Online (Sandbox Code Playgroud)

我在工具 - >选项 - >文本编辑器 - > C#中缺少一些格式化选项吗?

c# visual-studio-2010 visual-studio

7
推荐指数
2
解决办法
1188
查看次数

如何在Silverlight中即时切换UI文化数据绑定

我有一个TextBlock控件,它是绑定到DateTime属性的数据.

文本显示如下:

2010年10月21日,星期四

我需要动态切换UI Culture,使用以下内容:

Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture 
                                    = new CultureInfo("de-de");
Run Code Online (Sandbox Code Playgroud)

我试过这个强制绑定到recalc:

var bindingExpression = textBlock.GetBindingExpression(TextBlock.TextProperty);
bindingExpression.UpdateSource();
Run Code Online (Sandbox Code Playgroud)

但我仍然看到周四而不是Donnerstag ......

我该怎么办?有任何想法吗?

data-binding silverlight localization silverlight-4.0

3
推荐指数
1
解决办法
4341
查看次数