InputLanguageManager InputLanguageManager InputLanguageManager InputLanguageManager Class

Definition

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

public ref class InputLanguageManager sealed : System::Windows::Threading::DispatcherObject
public sealed class InputLanguageManager : System.Windows.Threading.DispatcherObject
type InputLanguageManager = class
    inherit DispatcherObject
Public NotInheritable Class InputLanguageManager
Inherits DispatcherObject
Inheritance
InputLanguageManagerInputLanguageManagerInputLanguageManagerInputLanguageManager

Examples

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();
Me.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 " & Me.Dispatcher.Thread.CurrentCulture.Name.ToString()

Remarks

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.

Fields

InputLanguageProperty InputLanguageProperty InputLanguageProperty InputLanguageProperty

Identifies the InputLanguage attached property.

RestoreInputLanguageProperty RestoreInputLanguageProperty RestoreInputLanguageProperty RestoreInputLanguageProperty

Identifies the RestoreInputLanguage attached property.

Properties

AvailableInputLanguages AvailableInputLanguages AvailableInputLanguages AvailableInputLanguages

Gets an enumerator for currently available input languages.

Current Current Current Current

Gets the input language manager associated with the current context.

CurrentInputLanguage CurrentInputLanguage CurrentInputLanguage CurrentInputLanguage

Gets or sets the current input language.

Dispatcher Dispatcher Dispatcher Dispatcher

Gets the Dispatcher this DispatcherObject is associated with.

(Inherited from DispatcherObject)

Attached Properties

InputLanguage InputLanguage InputLanguage InputLanguage

Gets or sets the preferred input language for the associated dependency object.

RestoreInputLanguage RestoreInputLanguage RestoreInputLanguage RestoreInputLanguage

Gets 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.

Methods

CheckAccess() CheckAccess() CheckAccess() CheckAccess()

Determines whether the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetInputLanguage(DependencyObject) GetInputLanguage(DependencyObject) GetInputLanguage(DependencyObject) GetInputLanguage(DependencyObject)

Returns the value of the InputLanguage attached property for a specified dependency object.

GetRestoreInputLanguage(DependencyObject) GetRestoreInputLanguage(DependencyObject) GetRestoreInputLanguage(DependencyObject) GetRestoreInputLanguage(DependencyObject)

Returns the value of RestoreInputLanguage attached property for a specified dependency object.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
RegisterInputLanguageSource(IInputLanguageSource) RegisterInputLanguageSource(IInputLanguageSource) RegisterInputLanguageSource(IInputLanguageSource) RegisterInputLanguageSource(IInputLanguageSource)

Registers an input language source with the InputLanguageManager.

ReportInputLanguageChanged(CultureInfo, CultureInfo) ReportInputLanguageChanged(CultureInfo, CultureInfo) ReportInputLanguageChanged(CultureInfo, CultureInfo) ReportInputLanguageChanged(CultureInfo, CultureInfo)

Report the completion of a change of input language to the InputLanguageManager.

ReportInputLanguageChanging(CultureInfo, CultureInfo) ReportInputLanguageChanging(CultureInfo, CultureInfo) ReportInputLanguageChanging(CultureInfo, CultureInfo) ReportInputLanguageChanging(CultureInfo, CultureInfo)

Report the initiation of a change of input language to the InputLanguageManager.

SetInputLanguage(DependencyObject, CultureInfo) SetInputLanguage(DependencyObject, CultureInfo) SetInputLanguage(DependencyObject, CultureInfo) SetInputLanguage(DependencyObject, CultureInfo)

Sets the value of the InputLanguage attached property on the specified dependency object.

SetRestoreInputLanguage(DependencyObject, Boolean) SetRestoreInputLanguage(DependencyObject, Boolean) SetRestoreInputLanguage(DependencyObject, Boolean) SetRestoreInputLanguage(DependencyObject, Boolean)

Sets the value of the RestoreInputLanguage dependency property on the specified dependency object.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
VerifyAccess() VerifyAccess() VerifyAccess() VerifyAccess()

Enforces that the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)

Events

InputLanguageChanged InputLanguageChanged InputLanguageChanged InputLanguageChanged

Occurs when a change of input language is completed.

InputLanguageChanging InputLanguageChanging InputLanguageChanging InputLanguageChanging

Occurs when a change of input language is initiated.

Applies to

See also