3
\$\begingroup\$

This works but there must be a better way:

txtBox.InputScope = new InputScope { Names = { new InputScopeName { NameValue = InputScopeNameValue.Text } } };
\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

I'm not really sure what you want from this, if all you want is to make it more readable, then a few well placed new-lines will make a world of difference. If you want to reduce the amount of code, I don't think there is much room for that other than switching constructors for InputScopeName.

txtBox.InputScope = new InputScope
{
    Names =
    {
        new InputScopeName(InputScopeNameValue.Text)
    }
};

Note: Text does not appear to be a valid member of InputScopeNameValue, but ill keep it for the sake of consistency with the question.

\$\endgroup\$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.