The Media Center Sandbox

Resources and discussion for developing experiences in the Windows Media Center platform.
Welcome to The Media Center Sandbox Sign in | Join | Help
in Search

KeyboardPage.mcml Problem

Last post 08-27-2010, 2:38 AM by thus. 1 replies.
Sort Posts: Previous Next
  •  08-27-2010, 2:19 AM 9853

    KeyboardPage.mcml Problem

    I am having a trouble with KeyboardPage.mcml and the related files. I copied them from the Microsoft SDK folder.

    Here is the code that is used for calling the KeyboardPage.mcml with parameters:

    public void GoToKeyboard(EditableText objEditableText)
    {
    bool password = false;
    bool submitWhenDone = false;

    if (session == null)
    {
    Debug.WriteLine("GoToKeyboard: " + objEditableText.Value);
    return;
    }

    Dictionary properties = new Dictionary();
    properties["Model"] = objEditableText;
    properties["Password"] = password;
    properties["SubmitWhenDone"] = submitWhenDone;
    properties["Application"] = this;

    session.GoToPage("resx://MyMediaCenter/MyMediaCenter.Resources/KeyboardPage", properties);
    }

    I am getting an error due to my session object. I have never used the session object in my project and it's value is always null. That's why when I wanna call the KeyboardPage.mcml with remarking the "if (session == null)" line I am getting an error: "The object reference is not set of an object".

    Because the session is null!!

    How can I set the session object as active? What's the role of session? Is there a way to call the KeyboardPage.mcml without using the session object?
  •  08-27-2010, 2:38 AM 9854 in reply to 9853

    Re: KeyboardPage.mcml Problem

    Sorry, it is my mistake.. Here is the code below I forgot to use in MCML side after I call the GoToKeyboard() method in code behind:

    - Invoke Target="[AddInHost.MediaCenterEnvironment.ShowOnscreenKeyboard]"
    editableText="[EditableText]"
    passwordMasked="[PasswordMasked]"
    maxLength="100"/-
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems