Architect's Log

I'm a Cloud Architect. I'm highly motivated to reduce toils with driving DevOps.

WPF

「わんくま同盟 東京勉強会 #90」に行ってきた(その1「きっと怖くないMVVM&MVPVM」by 暁 紫電さん)

6/7に「わんくま同盟 東京勉強会 #90」に行ってきました。途中で帰らなければならなかったので、全部のセッションは聞けなかったのですが、2回に分けて勉強会の内容を紹介します。 わんくま同盟先月はゴールデンウィークいかがでしたか? 今回はスピーカー…

「めとべや東京 #4」に行ってきた(その5 LT)

5/31に「めとべや東京 #4」に行ってきたので、何度かに分けて勉強会の内容を紹介します。 めとべや東京#4de:code 直後ということで、クライアントサイトテクノロジを中心に最新情報をいち早くまとめて聞いて見ませんか? ... 今回は5回目です。最後のセッシ…

「めとべや東京 #4」に行ってきた(その2「Modern WPF」by Microsoft MVPぐらばくさん)

5/31に「めとべや東京 #4」に行ってきたので、何度かに分けて勉強会の内容を紹介します。 めとべや東京#4de:code 直後ということで、クライアントサイトテクノロジを中心に最新情報をいち早くまとめて聞いて見ませんか? ... 今回は2回目です。2つ目のセッ…

WPFで背景が透明なウィンドウを作成する

WPFで背景が透明なウィンドウを作成する方法を紹介します。 App.xaml <Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="Lancher.App" StartupUri="MainWindow.xaml"> <Application.Resources> </Application.Resources> </Application> MainWindow.…

Windows Presentation Foundation ベースのアプリケーションを実行すると、さまざまな問題が発生する

知っておいた方がいいかもしれない。Windows Presentation Foundation ベースのアプリケーションを実行すると、さまざまな問題が発生する Windows XP または Windows Vista 上で Windows Presentation Framework (WPF) を使用したアプリケーションを実行する…

WPFのDataGridはパフォーマンスについて

WPFのDataGridはパフォーマンスに問題があると報告されています。 NET Framework 4から追加予定のWPFのDataGridコントロールについて、縦スクロールバーをドラッグして移動する際のパフォーマンスが、1000件程度のデータを表示するだけで実用不可能なレ…

MEFでWPFのプラグインを実装する(複数プラグインをファイル名で指定して読み込む)改良版

前回(以下のエントリー)の実装を改良します。AggregateCatalogクラスでカタログを集約し、一度に読み込めるようにします。 MEFでWPFのプラグインを実装する(複数プラグインをファイル名で指定して読み込む) - プログラマーな日々 アプリ実行 プラグイン…

MEFでWPFのプラグインを実装する(複数プラグインをファイル名で指定して読み込む)

前回(以下のエントリー)の実装を改良して、ファイル名を指定して複数のプラグインを読み込めるようにします。 MEFでWPFのプラグインを実装する(複数プラグイン編) - プログラマーな日々 アプリ実行 プラグインのメソッドが呼ばれ、ウィンドウが表示され…

MEFでWPFのプラグインを実装する(複数プラグイン編)

前回(以下のエントリー)の実装を改良して複数のプラグインを読み込んでみます。 MEFでWPFのプラグインを実装する - プログラマーな日々MEFは.NET4で提供された.NET標準のDIコンテナです。このMEFを使ってWPFのプラグインを実装してみます。 アプリ実行 プ…

MEFでWPFのプラグインを実装する

MEFは.NET4で提供された.NET標準のDIコンテナです。このMEFを使ってWPFのプラグインを実装してみます。 アプリ実行 プラグインのメソッドが呼ばれ、ウィンドウが表示されます。 プロジェクト構成 Pluginプロジェクト クラスライブラリプロジェクトです。プラ…

スタイルの継承

アプリ実行 ソースコード App.xaml <Application x:Class="WpfApplication7.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> </Application> MainWindow.xaml

テーマを適用する

アプリ実行 起動 チェックする チェックを外す ソースコード App.xaml <Application x:Class="WpfApplication7.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> </Application> MainWindow.xaml

Style.TriggersとControlTemplate.Triggersの違い

エッセンシャル WPFより引用: Buttonの既定のテンプレートが(境界線の背景を明示的に赤にすることにより)背景のテンプレートバインディングを削除するため、スタイルのトリガは何の影響も与えません。このような現象が起きる理由は、コントロールテンプレ…

トリガとリソースをスタイルに関連付ける

アプリ実行 起動 マウスオーバー ソースコード App.xaml <Application x:Class="WpfApplication7.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> </Application> MainWindow.xaml

型をキーにしてスタイルを適用する

アプリ実行 ソースコード App.xaml <Application x:Class="WpfApplication7.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> </Application> MainWindow.xaml

リソース参照でスタイルの定義を共有する

アプリ実行 ソースコード App.xaml <Application x:Class="WpfApplication7.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> </Application> MainWindow.xaml

スタイルでトリガーを適用する

アプリ実行 起動 チェック ソースコード App.xaml <Application x:Class="WpfApplication7.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> </Application> MainWindow.xaml

コントロールにスタイルを適用する

アプリ実行 ソースコード App.xaml <Application x:Class="WpfApplication7.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> </Application> MainWindow.xaml

複数のTriggerでコントロールのプロパティを制御する

アプリ実行 起動 マウスオーバー ソースコード App.xaml <Application x:Class="WpfApplication9.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> </Application> MainWindow.xaml

Triggerでコントロールのプロパティを制御する

アプリ実行 起動 マウスオーバー ソースコード App.xaml <Application x:Class="WpfApplication7.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> </Application> MainWindow.xaml

DataTriggerでコマンドのバインディングをマークアップに移動させる

アプリ実行 起動 猫の[歩く]をクリック 鈴木の[歩く]をクリック ソースコード App.xaml <Application x:Class="CommandDataTriggerSample.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> </Application> MainWindow.xaml

コマンドとデータバインディングの統合

アプリ実行 起動 .jpg以外の[表示]をクリック .jpgの[表示]をクリック ソースコード App.xaml <Application x:Class="WpfApplication7.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> </Application> MainWindow.xaml

RoutedCommandでコマンドバインディングを実装する

アプリ実行 起動 Ctrl + S を押下 ソースコード App.xaml <Application x:Class="WpfApplication7.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> </Application> MainWindow.xaml

コマンドバインディング

起動 [保存]メニュークリック ソースコード App.xaml <Application x:Class="WpfApplication7.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> </Application> MainWindow.xaml

マークアップでメニュー項目をコマンドに結び付ける

アプリ実行 起動 [保存]メニュークリック ソースコード App.xaml <Application x:Class="WpfApplication7.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> </Application> MainWindow.xaml

すべてのボタンに共通のクリックハンドラを設定する

アプリ実行 起動 ボタンAクリック ボタンBクリック ソースコード App.xaml <Application x:Class="WpfApplication6.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> </Application> MainWindow.xaml

データ駆動型の表示

アプリ実行 ソースコード App.xaml <Application x:Class="WpfApplication6.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> </Application> MainWindow.xaml

CollectionViewSourceを使ってコレクションビューを実装する

アプリ実行 ソースコード App.xaml <Application x:Class="WpfApplication8.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> </Application> MainWindow.xaml

ディレクトリの子項目を階層的に表示する

アプリ実行 起動 展開 ソースコード App.xaml <Application x:Class="WpfApplication6.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> </Application> MainWindow.xaml

ディレクトリの子項目をリストボックスに表示する

アプリ実行 ソースコード App.xaml <Application x:Class="WpfApplication6.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"> </Application> MainWindow.xaml