/// <summary>
        /// Selects the template.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <param name="container">The container.</param>
        /// <returns></returns>
        public override System.Windows.DataTemplate SelectTemplate(object item, System.Windows.DependencyObject container)
        {
            System.Windows.FrameworkElement element = container as System.Windows.FrameworkElement;

            if (element != null && item != null && item is Message)
            {
                Message messageItem = (Message)item;

                if (messageItem != null)
                {
                    if (messageItem.From == sender)
                    {
                        return
                            (Caller.FindResource("OwnMessages") as System.Windows.DataTemplate);
                    }

                    else
                    {
                        return
                            (Caller.FindResource("OthersMessages") as System.Windows.DataTemplate);
                    }
                }
            }

            return(null);
        }