5
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

WPF の OverridesDefaultStyle プロパティの内容

Posted at

はじめに

WPF の FrameworkElement.OverridesDefaultStyle プロパティの内容が、MSDNの説明を読んでもよく分からなかったので、それを調べた時のメモです。

FrameworkElement.OverridesDefaultStyle プロパティ - MSDN

解説

以下の Stack Overflow のページに書いてありました。

OverridesDefaultStyle in WPF - Stack Overflow

上記によると、コントロールのデフォルトスタイルを無視するために使用するとのことです。
デフォルトでは、コントロールをUIに配置すると、そのコントロール内で設定していない全てのプロパティの値がデフォルトスタイルから取得されます。
OverridesDefaultStyleをtrueに設定することで、デフォルトのスタイルから値を取得されないようにする用途のようです。

日本語記事だと、現在(2020年)ではAzureの記事で有名な「しばやん雑記」の人が、2008年に以下の投稿をしていました。

Template を指定していないのに OverridesDefaultStyle = True にすると何も表示されなくなるので注意

WPF メモ (27) - しばやん雑記

5
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?