If mytextBox not inside a template or other mytextBox , and you can access it by name in code, you can use the static TextBoxHelper method
TextBoxHelper.SetWatermark(mytextBox, "New Value");
or install it directly
mytextBox.SetValue(TextBoxHelper.WatermarkProperty, "New Value");
source share