0
1

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 1 year has passed since last update.

MahApps.Metro のスタイルを継承する

Posted at

色々調べた結果、BasedOnを下記のように書けば良いということが判明。

VS2017
MahApps.Metro 2.4.9

予め、App.xamlに以下を記入しておく。

<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />

DataGridにスタイルを”追加”したい場合は、以下。

  <Style BasedOn="{StaticResource MahApps.Styles.DataGrid}" TargetType="{x:Type DataGrid}">
    <Setter XXX />
  </Style>

TabItemなら、以下。

  <Style BasedOn="{StaticResource MahApps.Styles.TabItem}" TargetType="{x:Type TabItem}">
    <Setter XXX />
  </Style>

いくつかのサイトで、StaticResource MetriDataGridと書く方法があったがうまくいかず、上記にたどり着く。バージョンに依るのだろうか。。

0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?