jakubbukaj
Joined: 07 Mar 2013 Posts: 8
|
Posted: Thu Mar 07, 2013 5:52 am Post subject: Possible issue in way how preview mode access dialogs |
|
|
I have MainWindow.cs with following code inside:
Code: |
public MainWindow()
{
InitializeComponent();
CultureManager.UICulture = Thread.CurrentThread.CurrentCulture;
MessageBox.Show("Ctor: " + CultureManager.UICulture.NativeName);
CultureManager.UICultureChanged += CultureManager_UICultureChanged;
}
protected override void OnClosed(EventArgs e)
{
base.OnClosed(e);
CultureManager.UICultureChanged -= new EventHandler(CultureManager_UICultureChanged);
}
void CultureManager_UICultureChanged(object sender, EventArgs e)
{
MessageBox.Show("UIC ch: " + CultureManager.UICulture.NativeName);
}
|
If you will try to show preview for this window you will get for first preview 2 messages (ctor, uic ch). For second preview you will get 4 messages (uic ch, ctor, uic ch, uic ch). For third preview you will get 7 messages (uic ch, uic ch, ctor, uic ch, uic ch, uic ch, uic ch). And so on. It looks like there is some bug in preview engine.
Thanks,
VS2012 Prof, WPF project, Win 7 64bit |
|