Skip to content

Commit

Permalink
Merge pull request #26 from augustoproiete/release/2.0
Browse files Browse the repository at this point in the history
Release 2.0.0
  • Loading branch information
augustoproiete authored Nov 15, 2020
2 parents 71dbc0d + dec9525 commit a44a5e0
Show file tree
Hide file tree
Showing 25 changed files with 286 additions and 403 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ _ReSharper*/
#Ignore files created by NUnit
TestResult.xml
*.VisualState.xml
/Ookii.Dialogs.Wpf.NETCore/Properties/PublishProfiles
13 changes: 8 additions & 5 deletions Ookii.Dialogs.Wpf.sln
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.452
VisualStudioVersion = 16.0.30711.63
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sample", "sample", "{85E0D2C3-A700-4A65-BFEA-1F9A29875419}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ookii.Dialogs.Wpf.Sample", "sample\Ookii.Dialogs.Wpf.Sample\Ookii.Dialogs.Wpf.Sample.csproj", "{E38181B2-E8E5-466D-9099-33FE75B4CFA1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E248E2C9-CE4A-41D2-91A0-8F61AAB69247}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ookii.Dialogs.Wpf", "src\Ookii.Dialogs.Wpf\Ookii.Dialogs.Wpf.csproj", "{D01B1D20-8F5B-4834-8E5C-C7EC6DD587D4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "assets", "assets", "{B2AB57E4-0121-4AF9-A559-C53B442F33D8}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitattributes = .gitattributes
.gitignore = .gitignore
global.json = global.json
LICENSE = LICENSE
nuget.config = nuget.config
assets\ookii-dialogs.snk = assets\ookii-dialogs.snk
README.md = README.md
SECURITY.md = SECURITY.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ookii.Dialogs.Wpf.Sample", "sample\Ookii.Dialogs.Wpf.Sample\Ookii.Dialogs.Wpf.Sample.csproj", "{E38181B2-E8E5-466D-9099-33FE75B4CFA1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ookii.Dialogs.Wpf", "src\Ookii.Dialogs.Wpf\Ookii.Dialogs.Wpf.csproj", "{D01B1D20-8F5B-4834-8E5C-C7EC6DD587D4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
79 changes: 65 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
# Ookii.Dialogs.Wpf [![NuGet Version](http://img.shields.io/nuget/v/Ookii.Dialogs.Wpf.svg?style=flat)](https://www.nuget.org/packages/Ookii.Dialogs.Wpf/)
README.md |
|:---|

## Overview
<div align="center">

**Ookii.Dialogs.Wpf** is a class library for .NET applications providing several common dialogs. Included are classes for task dialogs, credential dialogs, progress dialogs, and common file dialogs.
<img src="assets/ookii-dialogs-wpf-nuget.png" alt="Ookii.Dialogs.Wpf" width="100" />

</div>

<h1 align="center">Ookii.Dialogs.Wpf</h1>
<div align="center">

A class library for WPF applications providing several common dialogs. Included are classes for task dialogs, credential dialogs, progress dialogs, and common file dialogs.

[![NuGet Version](http://img.shields.io/nuget/v/Ookii.Dialogs.Wpf.svg?style=flat)](https://www.nuget.org/packages/Ookii.Dialogs.Wpf) [![NuGet Downloads](https://img.shields.io/nuget/dt/Ookii.Dialogs.Wpf.svg)](https://www.nuget.org/packages/Ookii.Dialogs.Wpf) [![.NET Framework](https://img.shields.io/badge/.NET%20Framework-%3E%3D%204.5-informational)](https://dotnet.microsoft.com/download) [![.NET Core](https://img.shields.io/badge/.NET%20Core-%3E%3D%203.1.0-informational)](https://dotnet.microsoft.com/download)

</div>

## Give a Star! :star:

Expand All @@ -18,8 +30,6 @@ Install-Package Ookii.Dialogs.Wpf

The included sample application [`Ookii.Dialogs.Sample.Wpf`](sample/Ookii.Dialogs.Wpf.Sample/) demonstrate the dialogs for WPF. View the source of this application to see how to use the dialogs.

N.B.: **Ookii.Dialogs.Wpf** requires the [Microsoft .NET Framework 4.5](https://www.microsoft.com/en-us/download/details.aspx?id=30653) or higher.

### Windows Forms compatibility

If you're looking to use these common dialogs on a Windows Forms application, check out [Ookii.Dialogs.WinForms](https://github.com/augustoproiete/ookii-dialogs-winforms).
Expand All @@ -30,7 +40,9 @@ If you're looking to use these common dialogs on a Windows Forms application, ch

[Task dialogs](https://docs.microsoft.com/en-us/windows/desktop/Controls/task-dialogs-overview) are a new type of dialog first introduced in Windows Vista. They provide a superset of the message box functionality.

![A task dialog](assets/sample-task-dialog.png)
![A task dialog as it appears on Windows 10](assets/sample-task-dialog-win10.png)

![A task dialog with command links as it appears on Windows 10](assets/sample-task-dialog-command-links-win10.png)

The `Ookii.Dialogs.Wpf.TaskDialog` class provide access to the task dialog functionality. The `TaskDialog` class inherits from `System.ComponentModel.Component` and offers full support for the Component designer of Visual Studio.

Expand All @@ -40,21 +52,21 @@ The `TaskDialog` class requires Windows Vista or a later version of Windows. Win

Progress dialogs are a common dialog to show progress during operations that may take a long time. They are used extensively in the Windows shell, and an API has been available since Windows 2000.

![A progress dialog as it appears on Windows Vista and later](assets/sample-progress-dialog.png)
![A progress dialog as it appears on Windows 10](assets/sample-progress-dialog-win10.png)

The `Ookii.Dialogs.Wpf.ProgressDialog` class provide a wrapper for the Windows progress dialog API. The `ProgressDialog` class inherits from `System.ComponentModel.Component` and offers full support for the Component designer of Visual Studio. The `ProgressDialog` class resembles the `System.ComponentModel.BackgroundWorker` class and can be used in much the same way as that class.

The progress dialog's behaviour of the `ShowDialog` function is slightly different than that of other .NET dialogs; It is recommended to use a non-modal dialog with the `Show` function.

The `ProgressDialog` class is supported on Windows XP and later versions of Windows. However, the progress dialog has a very different appearance on Windows Vista and later (the image above shows the Vista version), so it is recommended to test on both operating systems to see if it appears to your satisfaction.
The `ProgressDialog` class is supported on Windows XP and later versions of Windows. However, the progress dialog has a very different appearance on Windows Vista and later (the image above shows the Windows 10 version), so it is recommended to test on the operating systems your application is supported to see if it appears to your satisfaction.

When using Windows 7 or later, the `ProgressDialog` class automatically provides progress notification in the application's task bar button.

### Credential dialog

The `Ookii.Dialogs.Wpf.CredentialDialog` class provide wrappers for the `CredUI` functionality first introduced in Windows XP. This class provides functionality for saving and retrieving generic credentials, as well as displaying the credential UI dialog. This class does not support all functionality of `CredUI`; only generic credentials are supported, thing such as domain credentials or alternative authentication providers (e.g. smart cards or biometric devices) are not supported.

![A credential dialog as it appears on Windows Vista and later](assets/sample-credential-dialog.png)
![A credential dialog as it appears on Windows 10](assets/sample-credential-dialog-win10.png)

The `CredentialDialog` class inherits from `System.ComponentModel.Component` and offers full support for the Component designer of Visual Studio.

Expand All @@ -64,16 +76,55 @@ On Windows XP, the `CredentialDialog` class will use the `CredUIPromptForCredent

Windows Vista introduced a new style of common file dialogs. As of .NET 3.5 SP1, the Windows Forms `OpenFileDialog` and `SaveFileDialog` class will automatically use the new style under most circumstances; however, some settings (such as setting `ShowReadOnly` to `true`) still cause it to revert to the old dialog. The `FolderBrowserDialog` still uses the old style. In WPF, the `Microsoft.Win32.OpenFileDialog` and `SaveFileDialog` classes still use the old style dialogs, and a folder browser dialog is not provided at all.

![The Vista-style folder browser dialog on Windows 7](assets/sample-folderbrowser-dialog.png)
![The Vista-style folder browser dialog on Windows 10](assets/sample-folderbrowser-dialog-win10.png)

The `Ookii.Dialogs.Wpf.VistaOpenFileDialog`, `Ookii.Dialogs.Wpf.VistaSaveFileDialog` and `Ookii.Dialogs.Wpf.VistaFolderBrowserDialog` classes provide these dialogs for WPF (note that in the case of the `OpenFileDialog` and `SaveFileDialog` it is recommended to use the built-in .NET classes unless you hit one of the scenarios where those classes use the old dialogs).

The classes have been designed to resemble the original WPF classes to make it easy to switch. When the classes are used on Windows XP, they will automatically fall back to the old style dialog; this is also true for the `VistaFolderBrowserDialog`; that class provides a complete implementation of a folder browser dialog for WPF, old as well as new style.

---
## .NET Core 3.1 pre-requisites

Copyright (c) Sven Groot 2009-2018
Ookii Dialogs leverages the components and visual styles of the Windows Common Controls library (`comctl32.dll`), and WPF applications targeting .NET Core 3.1 must add an [application manifest](https://docs.microsoft.com/en-us/windows/win32/sbscs/application-manifests) (`app.manifest`) to their projects with a reference to `Microsoft.Windows.Common-Controls`.

Copyright (c) C. Augusto Proiete 2018-2020
Without the application manifest, you'll get an error with a message similar to the below:

```
System.EntryPointNotFoundException: 'Unable to find an entry point named '...' in DLL 'comctl32.dll'.'
```

In Visual Studio, you can right click on your project and go to Add -> New Item... and select `Application Manifest File (Windows Only)`. That will create a template that you can customize and delete the parts you don't want and/or uncomment the parts that you want. The only required part for Ookii Dialogs to work is the `dependentAssembly` entry with the `Microsoft.Windows.Common-Controls` dependency.

```xml
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<!-- (...) -->

<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
```

For more information, visit the following links:

- [EntryPointNotFoundException when instantiating a TaskDialog](https://github.com/augustoproiete/ookii-dialogs-wpf/issues/23)
- [WPF System.EntryPointNotFoundException: Unable to find an entry point named 'TaskDialogIndirect' in DLL 'comctl32.dll'](https://github.com/augustoproiete-repros/repro-wpf-net5-comctl32-entrypointnotfoundexception)
- [Calls to comctl32.dll succeed in .NET 4.8, but fail in .NET 5 with System.EntryPointNotFoundException](https://github.com/dotnet/wpf/issues/3815)

## Release History

Click on the [Releases](https://github.com/augustoproiete/ookii-dialogs-wpf/releases) tab on GitHub.

---

See [LICENSE](LICENSE) for details
_Copyright &copy; 2009-2020 Ookii Dialogs Contributors - Provided under the [BSD 3-Clause "New" or "Revised" License](LICENSE)._
Binary file added assets/sample-credential-dialog-win10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/sample-credential-dialog.png
Binary file not shown.
Binary file added assets/sample-folderbrowser-dialog-win10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/sample-folderbrowser-dialog.png
Binary file not shown.
Binary file removed assets/sample-input-dialog.png
Binary file not shown.
Binary file added assets/sample-progress-dialog-win10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/sample-progress-dialog.png
Binary file not shown.
Binary file added assets/sample-task-dialog-command-links-win10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sample-task-dialog-win10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/sample-task-dialog.png
Binary file not shown.
7 changes: 7 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"sdk": {
"allowPrerelease": false,
"version": "3.1.100",
"rollForward": "latestFeature"
}
}
13 changes: 13 additions & 0 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<disabledPackageSources>
<clear />
</disabledPackageSources>
<fallbackPackageFolders>
<clear />
</fallbackPackageFolders>
</configuration>
5 changes: 1 addition & 4 deletions sample/Ookii.Dialogs.Wpf.Sample/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Windows;
using System.Windows;

namespace Ookii.Dialogs.Wpf.Sample
{
Expand Down
12 changes: 1 addition & 11 deletions sample/Ookii.Dialogs.Wpf.Sample/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Threading;
using System.ComponentModel;

Expand All @@ -32,7 +22,7 @@ public MainWindow()
{
InitializeComponent();

_sampleProgressDialog.DoWork += new System.ComponentModel.DoWorkEventHandler(_sampleProgressDialog_DoWork);
_sampleProgressDialog.DoWork += new DoWorkEventHandler(_sampleProgressDialog_DoWork);
}


Expand Down
125 changes: 23 additions & 102 deletions sample/Ookii.Dialogs.Wpf.Sample/Ookii.Dialogs.Wpf.Sample.csproj
Original file line number Diff line number Diff line change
@@ -1,52 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{E38181B2-E8E5-466D-9099-33FE75B4CFA1}</ProjectGuid>
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<RootNamespace>Ookii.Dialogs.Wpf.Sample</RootNamespace>

<AssemblyName>Ookii.Dialogs.Wpf.Sample</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<ApplicationManifest>app.manifest</ApplicationManifest>
<ApplicationIcon>ookii.ico</ApplicationIcon>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup>
<NeutralLanguage>en</NeutralLanguage>
<ApplicationManifest>app.manifest</ApplicationManifest>

<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>../../assets/ookii-dialogs.snk</AssemblyOriginatorKeyFile>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>

<NoWarn>$(NoWarn);NU5048</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<TreatSpecificWarningsAsErrors />
</PropertyGroup>

<PropertyGroup>
<AssemblyOriginatorKeyFile>..\..\assets\ookii-dialogs.snk</AssemblyOriginatorKeyFile>
<DisableImplicitFrameworkReferences Condition=" '$(TargetFramework)' == 'net45' ">true</DisableImplicitFrameworkReferences>
</PropertyGroup>
<ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xaml" />
Expand All @@ -55,67 +34,9 @@
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>

<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<None Include="app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Ookii.Dialogs.Wpf\Ookii.Dialogs.Wpf.csproj">
<Project>{D01B1D20-8F5B-4834-8E5C-C7EC6DD587D4}</Project>
<Name>Ookii.Dialogs.Wpf</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="ookii.ico" />
<ProjectReference Include="..\..\src\Ookii.Dialogs.Wpf\Ookii.Dialogs.Wpf.csproj" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

</Project>
Loading

0 comments on commit a44a5e0

Please sign in to comment.