I have an image in a WPF window. When I resize the window the image resizes with it. Is it possible to preserve the aspect ratio when the image is resizing, so it doesn't look squashed if the window is too narrow? If so, how?
我在WPF窗口中有一个图像。当我调整窗口的大小时,图像也随之调整大小。当图像调整大小时,是否可以保持高宽比,这样当窗口太窄时就不会显得被压扁?如果是这样,如何?