[WPF] 韓国語や中国語をコピーすると文字化けした

WPF の System.Windows.Clipboard を使用するときの話です。
以下のコードで韓国語や中国語をコピーすると、ペーストするときに文字化けしました。
string str = "한국어입니다."; ...[C# WPF] SwiftのcompactMapのnearestみたいなことをLINQでやる

ネイティブ開発をしているときに、できればWindowsとMacで同じようなロジックにしておきたいなと思いまして、LINQを使って似たような実装をしました。
環境Windows 10Visual Studio 20 ...
[C# WPF] 多言語対応がうまくいかないのでハイパーリンクを自作した

.NETにはHyperlinkクラスがありますが、NavigateUriに設定するURLを言語ごとに切り替えようとStaticResourceを指定したところ実行時エラーになるので、それっぽくうごくボタンを作りました。
文 ...
[C# WPF] 描画範囲を制限する

描画時にクリップする方法のまとめです。
キャンバス単位でクリップするキャンバス単位でクリップする方法は簡単で、キャンバスのClipToBoundsプロパティをtrueにするだけです。
<Canvas ClipT ...[.NET Core] System.Text.JsonでDictionaryを使ってみる

.Net Frameworkから.NET Coreに移行した際に、System.Web.Script.Serializationが使えなくなりました。
.NET Core 3.0からJsonパーサが組み込まれたので、こちらに置 ...
[C# WPF] なんとかしてWPFの描画を速くしたい「直線描画 」

最近WPFのパフォーマンスチューニングに勤しんでいます。
300,000個ほどのオブジェクトを描画するデスクトップアプリを作っている中で、役に立ったり効果のあった話をまとめていきます。
基本的には速度低下を招く ...
[C# WPF] なんとかしてWPFの描画を速くしたい「DrawRectangleでのPenの有無」

最近WPFのパフォーマンスチューニングに勤しんでいます。
300,000個ほどのオブジェクトを描画するデスクトップアプリを作っている中で、役に立ったり効果のあった話をまとめていきます。
基本的には速度低下を招く ...
[C# WPF] なんとかしてWPFの描画を速くしたい「Structのnew」

最近WPFのパフォーマンスチューニングに勤しんでいます。
300,000個ほどのオブジェクトを描画するデスクトップアプリを作っている中で、役に立ったり効果のあった話をまとめていきます。
基本的には速度低下を招く ...
[C# WPF] なんとかしてWPFの描画を速くしたい「Canvas.Childrenへのオブジェクト追加」

最近WPFのパフォーマンスチューニングに勤しんでいます。
300,000個ほどのオブジェクトを描画するデスクトップアプリを作っている中で、役に立ったり効果のあった話をまとめていきます。
基本的には速度低下を招く ...
[C# WPF] なんとかしてWPFの描画を速くしたい「Canvas.Childrenへのオブジェクト追加/削除のコスト」

最近WPFのパフォーマンスチューニングに勤しんでいます。
300,000個ほどのオブジェクトを描画するデスクトップアプリを作っている中で、役に立ったり効果のあった話をまとめていきます。
基本的には速度低下を招く ...
[C# WPF] ScrollViewer内にWriteableBitmapで描画してみる

前回に引き続き、もうちょっとWriteableBitmapを使ってみます。
今回はScrollViewerで表示されている部分にだけ、WriteableBitmapで描画を行います。
環境Visual Studio ...[C# WPF] WriteableBitmapで描画してみる

最近はWPFの描画速度と戦っています。
描画はWriteableBitmapを使うのが最速だという話を聞いたので、使ってみました。
環境Visual Studio 2019.NET Framework 4.7 ...