Click here to Skip to main content
15,886,873 members
Articles / Web Development / HTML

WPF x FileExplorer x MVVM

Rate me:
Please Sign up or sign in to vote.
4.99/5 (52 votes)
24 Nov 2012LGPL323 min read 289.2K   9.4K   228  
This article describe how to construct FileExplorer controls included DirectoryTree and FileList, using Model-View-ViewModel (MVVM) pattern.
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace ShellDll
{
    [ComImport]
    [Guid("0000010f-0000-0000-C000-000000000046")]
    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    public interface IAdviseSink
    {
        // Advises that data has changed
        [PreserveSig]
        void OnDataChange(
            ref ShellAPI.FORMATETC pformatetcIn,
            ref ShellAPI.STGMEDIUM pmedium);

        // Advises that view of object has changed
        [PreserveSig]
        void OnViewChange(
            int dwAspect, 
            int lindex);

        // Advises that name of object has changed
        [PreserveSig]
        void OnRename(
            IntPtr pmk);

        // Advises that object has been saved to disk
        [PreserveSig]
        void OnSave();

        // Advises that object has been closed
        [PreserveSig]
        void OnClose();
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)


Written By
Founder
Hong Kong Hong Kong

Comments and Discussions