c# - Pagination or navigation control in Windows Phone 8.1 app -


i developing windows phone 8.1 app

i have define navigation path on top of every page. path grow, size not fit screen. searching control shorttern path

please refer below image

enter image description here

any appreciated

thanks

you can write own converter truncates string given maximal length

public class maxstringconverter : ivalueconverter {     public maxstringconverter()     {         replacechars = "...";         maxlenght = int.maxvalue;     }      public int maxlength { get; set; }     public string replacechars { get; set; }      public object convert(object value, type targettype, object parameter, string culture)     {         string val = (string)value;         int replacecharlength = replacechars.length;         if(val.lenght > maxlength )         {             int middle = val.lenght / 2;             int textlenth = maxlength - 2 * replacecharlength;             string texttoreturn = val.substring(middle - replacecharlength , textlenth);             return string.format("{1}{0}{1}", texttoreturn, replacechars);         }     } } 

then use as

<window.resources>     <maxstringconverter x:key="maxstringconverter" maxlength=100/> </window.resources>  <textblock text="{binding path=mytext, converter={staticresource maxstringconverter}}"/> 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -