Is a dashed border around a selected text/image element possible in Silverlight?
===

I have an image editor I'm developing in silverlight which has multiple text and image elements on one canvas, that are draggable etc. I need feedback for the user to highlight the selected element when it is clicked on by the user and highlight a different element instead if another is clicked. I think I should do this with a dashed border around the element, but I don't know if it's possible. 


Below is my code relating to the elements -

Project.cs


    namespace ImageEditor.Client.BLL
    {
	 public class Project : INotifyPropertyChanged
	   {
		private int numberOfElements;

		#region Properties
		
		private ObservableCollection<FrameworkElement> elements;
		public ObservableCollection<FrameworkElement> Elements
		{
			get { return elements; }
			set
			{
				elements = value;
				NotifyPropertyChanged("Elements");
			}
		}
		
		
		private FrameworkElement selectedElement;
		public FrameworkElement SelectedElement
		{
			get { return selectedElement; }
			set
			{
				selectedElement = value;
				NotifyPropertyChanged("SelectedElement");
				
			}
		}


		private TextBlock selectedTextElement;
		public TextBlock SelectedTextElement
		{
			get { return selectedTextElement; }
			set
			{
				selectedTextElement = value;
				NotifyPropertyChanged("SelectedTextElement");
			}
		}

		private Image selectedImageElement;
		public Image SelectedImageElement
		{
			get { return selectedImageElement; }
			set
			{
				selectedImageElement = value;
				NotifyPropertyChanged("SelectedImageElement");
			}
		}
		
		#endregion
		
		
		#region Methods
		
		private void AddTextElement(object param)
		{
			TextBlock textBlock = new TextBlock();
			textBlock.Text = "New Text";
			textBlock.Foreground = new SolidColorBrush(Colors.Gray);
			textBlock.FontSize = 25;
			textBlock.FontFamily = new FontFamily("Arial");
			textBlock.Cursor = Cursors.Hand;
			textBlock.Tag = null;

			AddDraggingBehavior(textBlock);
			textBlock.MouseLeftButtonUp += element_MouseLeftButtonUp;

			this.Elements.Add(textBlock);
			numberOfElements++;

			this.SelectedElement = textBlock;
			this.selectedTextElement = textBlock;
		}
		
		private BitmapImage GetImageFromLocalMachine(out bool? success, out string fileName)
		{
			OpenFileDialog dialog = new OpenFileDialog()
			{
				Filter = "Image Files (*.bmp;*.jpg;*.gif;*.png;)|*.bmp;*.jpg;*.gif;*.png;",
				Multiselect = false
			};

			success = dialog.ShowDialog();
			if (success == true)
			{
				fileName = dialog.File.Name;
				FileStream stream = dialog.File.OpenRead();
				byte[] data;

				BitmapImage imageSource = new BitmapImage();
				using (FileStream fileStream = stream)
				{
					imageSource.SetSource(fileStream);
					data = new byte[fileStream.Length];
					fileStream.Read(data, 0, data.Length);
					fileStream.Flush();
					fileStream.Close();
				}

				return imageSource;
			}
			else
			{
				fileName = string.Empty;
				return new BitmapImage();
			}
		}
		
		private void AddImageElement(object param)
		{
			bool? gotImage;
			string fileName;
			BitmapImage imageSource = GetImageFromLocalMachine(out gotImage, out fileName);

			if (gotImage == true)
			{
				Image image = new Image();
				image.Name = fileName;
				image.Source = imageSource;
				image.Height = imageSource.PixelHeight;
				image.Width = imageSource.PixelWidth;
				image.MaxHeight = imageSource.PixelHeight;
				image.MaxWidth = imageSource.PixelWidth;
				image.Cursor = Cursors.Hand;
				image.Tag = null;


				AddDraggingBehavior(image);
				image.MouseLeftButtonUp += element_MouseLeftButtonUp;

				this.Elements.Add(image);
				numberOfElements++;

				this.SelectedElement = image;
				this.SelectedImageElement = image;
			}
		}
		
		
		private void OrderElements()
		{
			var elList = (from element in this.Elements
						  orderby element.GetValue(Canvas.ZIndexProperty)
						  select element).ToList<FrameworkElement>();

			for (int i = 0; i < elList.Count; i++)
			{
				FrameworkElement fe = elList[i];
				fe.SetValue(Canvas.ZIndexProperty, i);
			}

			this.Elements = new ObservableCollection<FrameworkElement>(elList);
		}
		
		public void element_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
		{
			this.SelectedElement = sender as FrameworkElement;
			if (sender is TextBlock)
			{
				this.SelectedTextElement = sender as TextBlock;
				FadeOut(this.SelectedTextElement);
			}
			else if (sender is Image)
			{
				this.SelectedImageElement = sender as Image;
				FadeOut(this.SelectedImageElement);
			}

		}
		#endregion
		
		
More than needed there but you get a good idea of how it all works from that. How might I go about it? I'm still pretty new to silverlight
		
