private void XrayImage_Loaded(object sender, RoutedEventArgs e) { SimpleRulerAdorner ruler = new SimpleRulerAdorner(MainXRayView, MainXRayView.PanAndZoomViewer); ruler.SamplingSpace = Conversion.SamplingSpace; ruler.ImageWidth = MainXRayView.Image.Source.Width; AdornerLayer myAdornerLayer = AdornerLayer.GetAdornerLayer(MainXRayView); myAdornerLayer.Add(ruler); }