WpfControlSamples
.NET Core 7 + WPF Control Samples
Created in 2020/05
Updated in 2022/11
Websites
かずきのBlog@hatena / WPF4.5入門 その62「まとめ」
Gushwell's Dev Notes / WPFサンプル・目次
MVVMパターンの常識 ― 「M」「V」「VM」の役割とは?
【WPF】ViewModelがINotifyPropertyChangedを実装していないとメモリリークする件 - aridai.NET
Per-Monitor DPI
Developing a Per-Monitor DPI-Aware WPF Application - MSDN
デスクトップアプリの高DPI対応 #1 – 高DPI対応とは
タスク マネージャーでアプリのDPI対応を確認可能 - 窓の杜
Per-Monitor DPI 環境下で WPF の Window 位置を調整する - しばやん雑記
Windows 8.1 で加わった Per-Monitor DPI と WPF での対応方法 - grabacr.nét
.Net 4.6.2以降でのWPFのPer-Monitor DPI対応 - SourceChord
stackoverflow
What's the difference betwen a UserControl and a ContentControl?
Assets
Transforming SVG graphics to XAML Metro Icons
MahApps/MahApps.Metro.IconPacks: Awesome icon packs for WPF and UWP in one library
GitHub
aybe/Windows-API-Code-Pack-1.1
snoopwpf/snoopwpf: Snoop - The WPF Spy Utility
Ctrl + Shift で詮索対象のコントロールに移動します。
Memo
[.NET5]自己完結リリースで単一ファイルにならない対応
.NET5 で PublishSingleFile
を True
で Publish したときに、9個くらい dll (*1) ができちゃう対策は、IncludeNativeLibrariesForSelfExtract
を True
にする。
*1) clrcompression.dll clrjit.dll coreclr.dll D3DCompiler_47_cor3.dll mscordaccore.dll PenImc_cor3.dll PresentationNative_cor3.dll vcruntime140_cor3.dll wpfgfx_cor3.dll
参考:.NET 5でシングルバイナリを作る | OPCDiary
PATH : Properties\PublishProfiles\FolderProfile.pubxml
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net6.0-windows\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0-windows</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>True</PublishSingleFile>
<PublishReadyToRun>False</PublishReadyToRun>
<PublishTrimmed>False</PublishTrimmed>
<IncludeNativeLibrariesForSelfExtract>True</IncludeNativeLibrariesForSelfExtract>
</PropertyGroup>
</Project>
発行の出力言語指定(動作未確認)
Microsoft.NET.Sdk の MSBuild プロパティ - .NET | Microsoft Docs
<PropertyGroup>
<SatelliteResourceLanguages>ja-JP;en-US</SatelliteResourceLanguages>
</PropertyGroup>
ビルド時にリソースをコピーする
*.csproj
の記述。プロジェクトのプロパティから設定しても良いです。
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="xcopy /D /E /C /S /Y $(SolutionDir)\assets\* $(OutDir)" />
</Target>
/D コピー元の日付がコピー先の日付より新しいファイルだけをコピーします。
/E ディレクトリまたはサブディレクトリが空であってもコピーします。
/C エラーが発生してもコピーを続けます。
/S 空の場合を除いて、ディレクトリとサブディレクトリをコピーします。
/Y 既存のファイルを上書きする前に確認のメッセージを表示しません。
EOF