source() path relative to the current script directory?
By : Andrea Urru
Date : September 17 2020, 06:00 AM
will help you In my main R script, I am doing source("some/path/script1.R"). This script includes another script in that directory: , You can use : source("file.R", chdir = TRUE)
Can I set the base path outside of my application directory when binding an image source path to a relative path in WPF?
By : kumoyuki
Date : March 29 2020, 07:55 AM
I wish did fix the issue. So I'm trying to display an image that is ouside the path of my application. I only have a relative image path such as "images/background.png" but my images are somewhere else, I might want to choose that base location at runtime so that the binding maps to the proper folder. Such as "e:\data\images\background.png" or "e:\data\theme\images\background.png" , Declare a static field say BasePath in code behind
public static BasePath;
public class RelativePathToAbsolutePathConverter : IValueConverter
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
//conbine the value with base path and return
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
// return whatever you want