Skip to content

HowTo access WPFSharp.Globalizer from code behind/ViewModel file (e.g. for a MessageBox) #18

Description

@Daimonion1980

Hi

What do I have to do when a MessageBox.Show(...) in a code behind file shall use WPFSharp.Globalizer?
I did not find any example for this.

Actually i am using a delegate from viewmodel to view to setup a function when the messagebox should appear:

UCCommunicationViewModel? viewmodel = this.DataContext as UCCommunicationViewModel;
if (viewmodel != null)
{ 
	viewmodel.MBErrorInitialize = (title, text) =>
	{
		//title and text contains the keys for globalizer
		return MessageBox.Show(text, title, MessageBoxButton.OK, MessageBoxImage.Error);
	};
}

How can i evaluate the keys in title and text to print out the localized strings?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions