There’s a handy method in System.IO.Path which can help with this:
return Path.GetFullPath("Resources/image.jpg");
This should return ‘C:\Folders\MoreFolders\Resources\image.jpg’ or whatever the full path is in your context. It will use the current working folder as the starting point.
Link to MSDN documentation on GetFullPath.
Related Contents:
- WPF – Import image as resource
- WPF Error: Cannot find governing FrameworkElement for target element
- Passing two command parameters using a WPF binding
- Creating WPF BitmapImage from MemoryStream png, gif
- WPF Image Caching
- Make WPF Image load async
- Are “{Binding Path=.}” and “{Binding}” really equal
- How to free the memory after the BitmapImage is no longer needed?
- WPF Change button background image when clicked
- Two combobox with same ItemsSource of ObservableCollection
- WPF Programming Methodology
- Binding to static property
- Is it possible to set code behind a resource dictionary in WPF for event handling?
- INotifyPropertyChanged vs. DependencyProperty in ViewModel
- Pushing read-only GUI properties back into ViewModel
- Bind to a value defined in the Settings
- How do I get the current mouse screen coordinates in WPF?
- DependencyProperty getter/setter not being called
- How to preserve control state within tab items in a TabControl
- How to get a group of toggle buttons to act like radio buttons in WPF?
- WPF Image Pan, Zoom and Scroll with layers on a canvas
- WPF TabControl – Preventing Unload on Tab Change?
- WPF CommandParameter is NULL first time CanExecute is called
- How do I create and show WPF windows on separate threads?
- WPF StringFormat={0:C} showing as dollars
- How to create a semi transparent window in WPF that allows mouse events to pass through
- WPF StringFormat on Label Content
- Is there a way to use data-template inheritance in WPF?
- WPF ListView – detect when selected item is clicked
- Set superscript and subscript in formatted text in wpf
- ItemsControl with multiple DataTemplates for a viewmodel
- WPF and initial focus
- How to disable highlighting on listbox but keep selection?
- Finding the handle to a WPF window
- WPF global font size
- What’s the best approach to printing/reporting from WPF? [closed]
- ComboBox.SelectedValue not updating from binding source
- When Clearing an ObservableCollection, There are No Items in e.OldItems
- How to create user define (new) event for user control in WPF ?one small example
- WPF: How to customize SelectionBoxItem in ComboBox
- Any free WPF themes? [closed]
- A TwoWay or OneWayToSource binding cannot work on the read-only property
- WPF Binding StringFormat Short Date String
- Displaying html from string in WPF WebBrowser control
- How do I make a WPF data template fill the entire width of the listbox?
- TabControl with Add New Tab Button (+)
- WPF UserControl Design Time Size
- Can WPF and WinForms be mixed within an application?
- How do I dynamically generate columns in a WPF DataGrid?
- Setting the Visibility of an Element to Collapsed when Storyboard completes using XAML