Export (0) Print
Expand All

InputLanguageManager Class

Provides facilities for managing input languages in Windows Presentation Foundation (WPF).

System.Object
  System.Windows.Threading.DispatcherObject
    System.Windows.Input.InputLanguageManager

Namespace:  System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)

public sealed class InputLanguageManager : DispatcherObject

The InputLanguageManager type exposes the following members.

  NameDescription
Public propertyAvailableInputLanguagesGets an enumerator for currently available input languages.
Public propertyStatic memberCurrentGets the input language manager associated with the current context.
Public propertyCurrentInputLanguageGets or sets the current input language.
Public propertyDispatcherGets the Dispatcher this DispatcherObject is associated with. (Inherited from DispatcherObject.)
Top

  NameDescription
Public attached propertyInputLanguageGets or sets the preferred input language for the associated dependency object.
Public attached propertyRestoreInputLanguageGets or sets a value that indicates whether or not the previously active input language should be restored when the associated dependency object looses the input focus.
Top

  NameDescription
Public methodCheckAccessDetermines whether the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodStatic memberGetInputLanguageReturns the value of the InputLanguage  attached property for a specified dependency object.
Public methodStatic memberGetRestoreInputLanguageReturns the value of RestoreInputLanguage  attached property for a specified dependency object.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodRegisterInputLanguageSourceRegisters an input language source with the InputLanguageManager.
Public methodReportInputLanguageChangedReport the completion of a change of input language to the InputLanguageManager.
Public methodReportInputLanguageChangingReport the initiation of a change of input language to the InputLanguageManager.
Public methodStatic memberSetInputLanguageSets the value of the InputLanguage attached property on the specified dependency object.
Public methodStatic memberSetRestoreInputLanguageSets the value of the RestoreInputLanguage dependency property on the specified dependency object.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodVerifyAccessEnforces that the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Top

  NameDescription
Public eventInputLanguageChangedOccurs when a change of input language is completed.
Public eventInputLanguageChangingOccurs when a change of input language is initiated.
Top

  NameDescription
Public fieldStatic memberInputLanguagePropertyIdentifies the InputLanguage  attached property.
Public fieldStatic memberRestoreInputLanguagePropertyIdentifies the RestoreInputLanguage  attached property.
Top

Additional languages can be registered by using the Regional and Language Options control panel. From the Languages tab, select "Text Services and input languages", then click the "Details" button to register additional languages. The following dialog appears.

Text services and input languages dialog.

The following example demonstrates how to use an InputLanguageManager to set the input language of a TextBox element.

this.Dispatcher.Thread.CurrentCulture.Name.ToString();
InputLanguageManager.SetInputLanguage(myTextBox, CultureInfo.CreateSpecificCulture("fr"));
tb2.Text = "Available Input Languages:";
lb1.ItemsSource = InputLanguageManager.Current.AvailableInputLanguages;
tb3.Text = "Input Language of myTextBox is " + InputLanguageManager.GetInputLanguage(myTextBox).ToString();
tb4.Text = "CurrentCulture is Set to " + this.Dispatcher.Thread.CurrentCulture.Name.ToString();

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft