是否可以在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#中缺少一些格式化选项吗?
我有一个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 ......
我该怎么办?有任何想法吗?