Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ElementHost でホストされているカスタム コントロールにテーマを定義して適用する方法。
VS は、Themes フォルダーに Generic.xaml を作成しました。名前を別のもの (Blue.xaml など) に変更すると、コントロール全体が表示されなくなります。
もう 1 つの質問は、VS でどのテーマ xaml ファイルを設定する必要があるかということです: コンテンツ、ページ、またはリソース?
Generic.xaml を常に定義しておく必要があります。
それをコピーし、Blue.xaml を変更して "Blue" テーマを定義します。
ビルド アクション = ページ
ElementHost を使用して Windows フォーム アプリケーションで WPF コントロールをホストしているため、テーマの変更を確認するのが難しい場合があります。
見る:
http://www.actiprosoftware.com/community/thread/20266/how-to-get-themes-working-inside-an-elementho
ElementHost でホストされている場合、アプリケーションレベルのリソースは動的ではありません