I´m trying to change the Format Date is shown in TmeRuler weekview...
I have an OrientedGroupHeaderContentTemplateselector, inside i have an HorizontalDayViewDateTemplate, which contains a DataTemplate with a TextBlock like this:
<TextBlock Margin="4" Text="{Binding Name, StringFormat=dd dddd}"/>
But I change this to:
<TextBlock Margin="0" Text="{Binding Name, StringFormat=d, Converter={StaticResource StringFormatConverter}, ConverterParameter='\{0:d\}'}" />
where StringFormatConverter is this:
public class stringFormatConverter:IValueConverter
{
#region IValueConverter Members
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
string res = String.Empty;
if (parameter != null)
{
string formatString = parameter.ToString();
if (!string.IsNullOrEmpty(formatString))
{
res= String.Format(formatString, value);
return res;
}
}
return value.ToString();
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return value;
}
#endregion
}
The problem I have, is I like to change the format to {0:ddd d} to show "Fri 29" instead "Friday 29", but the application sends an error if I don´t set {0:d} in the textblock ConvertParameter.
"Línea: 1 Error: Unhandled Error in Silverlight Application Se detectó un ciclo de diseño. No se pudo completar el diseño."
The class StringFormatConverter Formats successful the Date, but the Schedule don't work.
Any ideas, how could work.....?
Saludos
José de Jesús