I have a UNC path like \\machine\share\folder\something\ and I need to be able to open that location in windows explorer when a button is clicked. What WPF control should I use and how should I bind to that control from my viewModel?
An example of my viewModel is:
public class ViewModel : Screen {
public string LogPath { get { return "\\machine\share\folder\something"; } }
}
I’m using Caliburn Micro, but I don’t know if that’s relevant.
If I’m understanding your question properly, the use of WPF, Caliburn, etc is fairly irrelevant. You simply need a function on your ViewModel that runs the following code:
I would use a simple
Buttoncontrol with aCommandthat is bound to your ViewModel, and potentially aCommandArgumentto specify the path to launch if you need to.