private void CreateDisplaysRectangles() { var displays = WpfScreen.AllScreens(); displays.Sort((d1, d2) => (int)(d1.DeviceBounds.Left - d2.DeviceBounds.Left)); _diplayRectangles.ForEach(disp => disp.Draggable(false)); _diplayRectangles.Clear(); var desktopBounds = WPF_Helper.VirtualScreenBounds(); displays.ForEach((disp) => { Border r = new Border(); r.Opacity = 0.85; r.BorderBrush = Brushes.DimGray; r.Background = Brushes.AliceBlue; r.BorderThickness = new Thickness(3); r.CornerRadius = new CornerRadius(3); r.Width = disp.DeviceBounds.Width / 10.0; r.Height = disp.DeviceBounds.Height / 10.0; Canvas.SetLeft(r, (disp.DeviceBounds.Left - desktopBounds.Left) / 10.0); Canvas.SetTop(r, (disp.DeviceBounds.Top - desktopBounds.Top) / 10.0); r.Draggable(); r.LayoutUpdated += (s, e) => { Debug.WriteLine("R - moved"); }; TextBlock txt = new TextBlock(); txt.FontSize = 16; txt.TextAlignment = TextAlignment.Center; txt.Text = string.Format("Display [{0}]\n\n{1}", disp.Index, disp.WorkingArea); r.Child = txt; _diplayRectangles.Add(r); }); }