private void UpdateIcon(TypeMessage type) { this.RectangleElement.Fill = Application.Current.Resources["Icon" + type.Name()] as DrawingBrush; }