Click here to Skip to main content
12,398,537 members (60,251 online)
Click here to Skip to main content

Stats

155.5K views
2.4K downloads
116 bookmarked
Posted

WPF Common TaskDialog for Vista and XP

, 30 Dec 2007 CPOL
WPF custom TaskDialog that renders the same on Vista and XP. This custom dialog simplifies programming by providing a simple interface for developers that is not Operating System dependent. This solution does not use the Windows API for rendering.
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
    <RootNamespace>CommonDialog</RootNamespace>
    <AssemblyName>CommonDialog</AssemblyName>
    <OutputType>Library</OutputType>
    <ApplicationVersion>1.0.0.*</ApplicationVersion>
    <!-- Most people will use Publish dialog in Visual Studio to increment this -->
    <MinFrameworkVersionRequired>3.0</MinFrameworkVersionRequired>
    <OptionStrict>On</OptionStrict>
    <ProjectGuid>{AF1CF85C-3876-4CD2-8A14-1D8DA55F3AE6}</ProjectGuid>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <IncrementalBuild>true</IncrementalBuild>
    <OutputPath>bin\</OutputPath>
    <DocumentationFile>CommonDialog.xml</DocumentationFile>
    <NoWarn>42016,42017,42018,42019,42032,42314</NoWarn>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugSymbols>false</DebugSymbols>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <IncrementalBuild>false</IncrementalBuild>
    <Optimize>true</Optimize>
    <OutputPath>bin\</OutputPath>
    <DocumentationFile>CommonDialog.xml</DocumentationFile>
    <NoWarn>42016,42017,42018,42019,42032,42314</NoWarn>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml" />
    <Reference Include="WindowsBase" />
    <Reference Include="PresentationCore" />
    <Reference Include="PresentationFramework" />
    <Reference Include="UIAutomationProvider" />
    <Reference Include="UIAutomationTypes" />
    <Reference Include="ReachFramework" />
    <Reference Include="System.Printing" />
    <Reference Include="System.ServiceModel" />
    <Reference Include="System.Runtime.Serialization" />
    <Reference Include="System.IdentityModel" />
  </ItemGroup>
  <ItemGroup>
    <Import Include="Microsoft.VisualBasic" />
    <Import Include="System" />
    <Import Include="System.Collections" />
    <Import Include="System.Collections.Generic" />
    <Import Include="System.Diagnostics" />
    <Import Include="System.Windows" />
    <Import Include="System.Windows.Controls" />
    <Import Include="System.Windows.Data" />
    <Import Include="System.Windows.Documents" />
    <Import Include="System.Windows.Input" />
    <Import Include="System.Windows.Shapes" />
    <Import Include="System.Windows.Media" />
    <Import Include="System.Windows.Media.Imaging" />
    <Import Include="System.Windows.Navigation" />
    <Import Include="System.Windows.Shapes" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="CustomDialog.vb" />
    <Compile Include="CustomDialogEnums.vb" />
    <Compile Include="CustomDialogWindow.xaml.vb">
      <SubType>Code</SubType>
      <DependentUpon>CustomDialogWindow.xaml</DependentUpon>
    </Compile>
    <Compile Include="My Project\AssemblyInfo.vb">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="My Project\Resources.Designer.vb">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <Compile Include="My Project\Settings.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
    <Compile Include="My Project\MyEvents.vb">
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="VistaAeroAPI.vb" />
    <EmbeddedResource Include="My Project\Resources.resx">
      <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.vb</LastGenOutput>
      <CustomToolNamespace>My.Resources</CustomToolNamespace>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <None Include="My Project\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <LastGenOutput>Settings.Designer.vb</LastGenOutput>
    </None>
    <AppDesigner Include="My Project\" />
  </ItemGroup>
  <ItemGroup>
    <Page Include="CustomDialogWindow.xaml" />
  </ItemGroup>
  <ItemGroup>
    <Resource Include="CustomDialogInformation.png" />
    <Resource Include="CustomDialogQuestion.png" />
    <Resource Include="CustomDialogShield.png" />
    <Resource Include="CustomDialogStop.png" />
    <Resource Include="CustomDialogWarning.png" />
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" />
  <Import Project="$(MSBuildBinPath)\Microsoft.WinFX.targets" />
</Project>

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 Code Project Open License (CPOL)

Share

About the Author

Karl Shifflett
Architect
United States United States

Current passions are: Electron, ES6, Node.js, Angular, Aurelia, hybrid, Socket.IO, MQTT, and IoT.

Still keen on WPF and Prism, but currently Electron and ES6 deliver the same apps with much better performance, and they are cross-platform.

My Github Repros

Just a grain of sand on the worlds beaches.


You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160721.1 | Last Updated 30 Dec 2007
Article Copyright 2007 by Karl Shifflett
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid