How to change the titile bar image (the top-left most icon) in WPF?
The Icon attribute of Window is used to set Icon of a window.
The Icon property of Window class represents a window's icon at run-time. This property takes an ImageSource variable.
The following code snippet uses BitmapFrame.Create method to create an ImageSource and sets the Icon property of a Window.
Uri iconUri = new Uri("pack://application:,,,/Icon1.ico", UriKind.RelativeOrAbsolute);
this.Icon = BitmapFrame.Create(iconUri);
You can read more from here