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
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}}"/>