Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Possible issue in way how preview mode access dialogs

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support
View previous topic :: View next topic  
Author Message
jakubbukaj



Joined: 07 Mar 2013
Posts: 8

PostPosted: Thu Mar 07, 2013 5:52 am    Post subject: Possible issue in way how preview mode access dialogs Reply with quote

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
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Fri Mar 08, 2013 8:03 am    Post subject: Reply with quote

You are right there is an issue there with the Preview engine not disposing the Window when it is no longer required so that the OnClosed method never gets called and the the event handler stays hooked to the UICultureChanged event. This will cause a memory leak - but in general should not otherwise affect operation (unless you display message boxes like you are). We will fix this in the next minor release.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sun Mar 17, 2013 11:43 pm    Post subject: Reply with quote

This issue has now been fixed in Version 3.5.3 just released.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group