title: custom string format text input wpf
body: <p>I have values that are in format [double-type-value][unit] where unit can be "g" or "mg" (g for grams and mg for milligrams). Is there a way to allow user to enter text in TextBox ONLY in that format. For example to be like mini textbox that accept only numbers and mini combobox where values are "g" or "mg" in normal textbox or something else? It would be nice for unit to have default value to be "g" before something is typed in textbox so user don't have to type g or mg at the end of the textbox everty time if there are more textboxes.</p>
  
  <p>EDIT
  I’m using MVVM pattern, so code behind is violating it.</p>