If the image is in your resources folder and its build action is set to Resource. You can reference the image in XAML as follows:
"pack://application:,,,/Resources/Search.png"
Assuming you do not have any folder structure under the Resources folder and it is an application. For example I use:
ImageSource="pack://application:,,,/Resources/RibbonImages/CloseButton.png"
when I have a folder named RibbonImages under Resources folder.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…