Exemple #1
0
        protected override DataTemplate SelectTemplateCore(object item, DependencyObject container)
        {
            ChatDetailInfo temp_info = item as ChatDetailInfo;

            if (temp_info != null)
            {
                if (temp_info.IsFrom)
                {
                    return(FromTemplate);
                }
                else
                {
                    return(ToTemplate);
                }
            }
            return(null);
        }
 public object Convert(object value, Type targetType, object parameter, string language)
 {
     try
     {
         ChatDetailInfo info = value as ChatDetailInfo;
         if (!info.ShowTime)
         {
             return("");
         }
         long stamp = info.Timestamp;
         return(Util.PassedTime(Util.GetTimeStamp(DateTime.Now), stamp));
     }
     catch
     {
         return("");
     }
 }