Click here to Skip to main content
15,888,454 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: MVVM FolderBrowserDialog Pin
SledgeHammer0116-Nov-10 7:04
SledgeHammer0116-Nov-10 7:04 
GeneralRe: MVVM FolderBrowserDialog Pin
eddieangel16-Nov-10 7:11
eddieangel16-Nov-10 7:11 
GeneralRe: MVVM FolderBrowserDialog Pin
SledgeHammer0116-Nov-10 9:09
SledgeHammer0116-Nov-10 9:09 
AnswerRe: MVVM FolderBrowserDialog Pin
Kevin Marois17-Nov-10 5:24
professionalKevin Marois17-Nov-10 5:24 
GeneralRe: MVVM FolderBrowserDialog Pin
SledgeHammer0117-Nov-10 9:47
SledgeHammer0117-Nov-10 9:47 
GeneralRe: MVVM FolderBrowserDialog Pin
Kevin Marois17-Nov-10 11:14
professionalKevin Marois17-Nov-10 11:14 
GeneralRe: MVVM FolderBrowserDialog Pin
SledgeHammer0117-Nov-10 12:31
SledgeHammer0117-Nov-10 12:31 
GeneralRe: MVVM FolderBrowserDialog Pin
Pete O'Hanlon17-Nov-10 10:00
mvePete O'Hanlon17-Nov-10 10:00 
The traditional MVVM way to do this would be to implement something like:
C#
public string PromptForFile()
{
  IFileDialog dialog = ServiceLocator.Get<IFileDialog>()
  {
    InitialDirectory = @".\",
    Filter = "All Files (*.*)|*.*",
    FilterIndex = 0,
    RestoreDirectory = true;
  }
  if (dialog.ShowDialog() == DialogResult.OK)
    return dialog.FileName;
  return string.Empty;
}
Obviously, this implies the use of a service locator, and there are many acceptable alternatives including my particular favourite MEF.

I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

Forgive your enemies - it messes with their heads


My blog | My articles | MoXAML PowerToys | Onyx


GeneralRe: MVVM FolderBrowserDialog Pin
_Maxxx_17-Nov-10 16:11
professional_Maxxx_17-Nov-10 16:11 
GeneralRe: MVVM FolderBrowserDialog Pin
Pete O'Hanlon17-Nov-10 21:50
mvePete O'Hanlon17-Nov-10 21:50 
QuestionDataGrid - merging cells Pin
urinspiration15-Nov-10 7:41
urinspiration15-Nov-10 7:41 
QuestionWPF Style Question Pin
Kevin Marois15-Nov-10 7:08
professionalKevin Marois15-Nov-10 7:08 
AnswerRe: WPF Style Question Pin
#realJSOP15-Nov-10 8:03
mve#realJSOP15-Nov-10 8:03 
GeneralRe: WPF Style Question Pin
Kevin Marois15-Nov-10 8:05
professionalKevin Marois15-Nov-10 8:05 
GeneralRe: WPF Style Question [modified] Pin
SledgeHammer0115-Nov-10 8:55
SledgeHammer0115-Nov-10 8:55 
GeneralRe: WPF Style Question Pin
Kevin Marois15-Nov-10 12:13
professionalKevin Marois15-Nov-10 12:13 
GeneralRe: WPF Style Question Pin
SledgeHammer0115-Nov-10 13:29
SledgeHammer0115-Nov-10 13:29 
GeneralRe: WPF Style Question Pin
Kevin Marois16-Nov-10 4:37
professionalKevin Marois16-Nov-10 4:37 
GeneralRe: WPF Style Question Pin
SledgeHammer0116-Nov-10 14:06
SledgeHammer0116-Nov-10 14:06 
GeneralRe: WPF Style Question Pin
SledgeHammer0116-Nov-10 14:10
SledgeHammer0116-Nov-10 14:10 
Questionexecute code on Server-side - Silverlight Pin
jadughar14-Nov-10 19:40
jadughar14-Nov-10 19:40 
AnswerRe: execute code on Server-side - Silverlight Pin
Vimalsoft(Pty) Ltd14-Nov-10 20:10
professionalVimalsoft(Pty) Ltd14-Nov-10 20:10 
AnswerRe: execute code on Server-side - Silverlight Pin
Abhinav S14-Nov-10 20:40
Abhinav S14-Nov-10 20:40 
GeneralRe: execute code on Server-side - Silverlight Pin
jadughar14-Nov-10 21:07
jadughar14-Nov-10 21:07 
QuestionMouse Move - how to determine span of move (i.e. delta x and delta y) Pin
devvvy14-Nov-10 16:10
devvvy14-Nov-10 16:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.