Take the 2-minute tour ×
Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.

This works but there must be a better way:

txtBox.InputScope = new InputScope { Names = { new InputScopeName { NameValue = InputScopeNameValue.Text } } };
share|improve this question

closed as unclear what you're asking by Malachi, RubberDuck, JaDogg, Heslacher, Simon Forsberg Dec 15 '14 at 17:22

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

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.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.