Menu

Formats

Anonymous

Utilising StingFormat (introduced in framework 3.5) managed from resource dictionary.

  • Dictionary contains input masks, regex expressions.
  • Formats will be used across all client components.
  • Simple to add new formats.
  • Switch xaml files for local variations across desk/regions.

Example

    <c:Hashtable x:Key="ShortDateTime">
        <s:String x:Key="StringFormat">d</s:String>
        <s:String x:Key="Type">Date</s:String>
        <s:String x:Key="InputMask">^(D{2}|M{2}|(YY){1,2})[-|\/]?(?!\1)(D{2}|M{2})[-|\/]?((?!\1|\3)(D{2}|M{2}|(YY){1,2}))$</s:String>
    </c:Hashtable>
    <c:Hashtable x:Key="NumDp0">
        <s:String x:Key="StringFormat">#,#</s:String>
        <s:String x:Key="Type">Num</s:String>
        <s:String x:Key="InputMask">^(\d?\d?\d(,\d\d\d)*|\d+)(\.\d\d)?$</s:String>
    </c:Hashtable>
    <c:Hashtable x:Key="NumDp1">
        <s:String x:Key="StringFormat">#,##0.0</s:String>
        <s:String x:Key="Type">Num</s:String>
        <s:String x:Key="InputMask">^(\d?\d?\d(,\d\d\d)*|\d+)(\.\d\d)?$</s:String>

Related

Wiki: FinPlusMarketMaker
Wiki: FinPlusWPFControls