Mike Taulty's Blog
Bits and Bytes from Microsoft UK
Windows 7 for Developers – File Dialogs from .NET

Blogs

Mike Taulty's Blog

Elsewhere

Archives

I’m reading Yochay’s posts up at the Windows 7 for Developers blog;

http://windowsteamblog.com/blogs/developers/rss.aspx

It’s all great material – one of the things that I hadn’t been aware of was that if in a WPF application ( on 3.5 Service Pack 1 ) I’m using a file dialog as in;

using System;
using System.Windows;
using winformsDialog = System.Windows.Forms.OpenFileDialog;

namespace WpfApplication1
{
  public partial class Window1 : Window
  {
    public Window1()
    {
      InitializeComponent();
    }
    void OnClick(object sender, EventArgs args)
    {
      winformsDialog dialog = new winformsDialog();

      dialog.ShowDialog();
    }
  }
}

then I get this dialog;

image

whereas if I use this code ( which is what I would naturally do in a WPF application );

using System;
using System.Windows;
using win32Dialog = Microsoft.Win32.OpenFileDialog;

namespace WpfApplication1
{
  public partial class Window1 : Window
  {
    public Window1()
    {
      InitializeComponent();
    }
    void OnClick(object sender, EventArgs args)
    {
      win32Dialog dialog = new win32Dialog();

      dialog.ShowDialog();
    }
  }
}

then I get this dialog which Yochay refers to as the “legacy Common File Dialog” and talks about its limitations versus the previous dialog.

image

That was news to me and there’s a bunch more similar gems up at Yochay’s blog.


Posted Tue, May 5 2009 4:16 AM by mtaulty
Filed under:

Comments

DotNetShoutout wrote Windows 7 for Developers – File Dialogs from .NET - Mike Taulty
on Wed, May 6 2009 12:11 AM

Thank you for submitting this cool story - Trackback from DotNetShoutout

Dew Drop - May 6, 2009 | Alvin Ashcraft's Morning Dew wrote Dew Drop - May 6, 2009 | Alvin Ashcraft's Morning Dew
on Wed, May 6 2009 7:16 AM
9eFish wrote Mike Taulty's Blog : Windows 7 for Developers – File Dialogs from .NET
on Wed, May 6 2009 7:09 PM

9efish.感谢你的文章 - Trackback from 9eFish

NewsPeeps wrote Windows 7 for Developers – File Dialogs from .NET - Mike Taulty's Blog - Mike Taulty's Blog
on Sat, Jul 11 2009 6:26 PM

Thank you for submitting this cool story - Trackback from NewsPeeps

Cheapest online soma. wrote Cheapest sites for buying soma online.
on Wed, Feb 17 2010 8:13 PM

Soma online pharmacy. Buy soma online. Online soma. Soma online.