I have a project which has several UI culture references like this:
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sysglb="clr-namespace:System.Globalization;assembly=mscorlib"
xmlns:local="clr-namespace:WpfApplication1"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Grid>
<StackPanel Orientation="Horizontal" Grid.Column="1">
<TextBlock Text="{Binding MyData, StringFormat={}{0:C2}, ConverterCulture={x:Static sysglb:CultureInfo.CurrentUICulture}}" />
</StackPanel>
</Grid>
In code behind, I have a simple implementation:
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
DataContext = this;
MyData = 10;
}
public int MyData { get; set; }
}
In App_Startup, I have initialized the CurrentUICulture:
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-GB");
When I open any such UI in designer, I receive 'Invalid Markup' with error:
The member "CurrentUICulture" is not recognized or is not accessible.
Any idea why this basic use case will not work in Xaml designer for Visual Studio 2015 RC? I have tried options mentioned in an earlier post, but that does not work (Visual studio 2012 XAML designer invalid markup)
Earlier, when loading the designer, we could see the controls and UI without problems in Visual Studio 2010, 2012 and 2013. We decided to try out Visual Studio 2015 RC, but it appears that this is broken now.