This works but there must be a better way:
txtBox.InputScope = new InputScope { Names = { new InputScopeName { NameValue = InputScopeNameValue.Text } } };
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.