回答編集履歴

5

更に追記

2018/10/30 02:37

投稿

takabosoft
takabosoft

スコア8356

test CHANGED
@@ -97,3 +97,71 @@
97
97
 
98
98
 
99
99
  どうしたものか(^_^;)
100
+
101
+
102
+
103
+ ----
104
+
105
+ 追記:2018/10/30 11:30
106
+
107
+
108
+
109
+ 何度もすみません。
110
+
111
+ こちらのサイトに載っている方法でしたら、なんとか動いたようです。
112
+
113
+ [http://tkatochin.hatenablog.com/entry/20080916/1221565841](http://tkatochin.hatenablog.com/entry/20080916/1221565841)
114
+
115
+
116
+
117
+ ```xaml
118
+
119
+ <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
120
+
121
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
122
+
123
+
124
+
125
+ <ResourceDictionary.MergedDictionaries>
126
+
127
+ <ResourceDictionary Source="/PresentationFramework.AeroLite;component/themes/aerolite.normalcolor.xaml" />
128
+
129
+
130
+
131
+ <ResourceDictionary>
132
+
133
+ <Style x:Key="__Type_Button__" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
134
+
135
+ <Setter Property="Margin" Value="5,5,5,5"/>
136
+
137
+ <Setter Property="VerticalAlignment" Value="Center"/>
138
+
139
+ <Setter Property="VerticalContentAlignment" Value="Center"/>
140
+
141
+ <Setter Property="Height" Value="25"/>
142
+
143
+ </Style>
144
+
145
+
146
+
147
+ </ResourceDictionary>
148
+
149
+
150
+
151
+ </ResourceDictionary.MergedDictionaries>
152
+
153
+
154
+
155
+ <Style TargetType="Button" BasedOn="{StaticResource __Type_Button__}"/>
156
+
157
+
158
+
159
+ </ResourceDictionary>
160
+
161
+ ```
162
+
163
+
164
+
165
+ Qiitaの記事にもThemeとStyleのマージという項目がありましたが、手元では反映されなかったので、なかなかこの辺の挙動はよくわからないです。
166
+
167
+ https://qiita.com/norimatsu_yusuke/items/3a7a22f0d852d99e18cc

4

やっぱだめでした。

2018/10/30 02:37

投稿

takabosoft
takabosoft

スコア8356

test CHANGED
@@ -86,10 +86,14 @@
86
86
 
87
87
 
88
88
 
89
- こんな感じに書けば動きました。
89
+ ~~こんな感じに書けば動きました。~~
90
90
 
91
91
 
92
92
 
93
- DLLリソースを使わず、単体アプリでもMergedDictionaries内でエアロとは別に直接Styleを書き込んでしまうとBaseOnが効かない感じでした。
93
+ 動いてませんでした。
94
94
 
95
- たぶんそうう仕組みなのでしょうねこの辺詳しい方補足願えると助かります。
95
+ "Dictionary1.xaml"のスタイルが全く適用されてませでし
96
+
97
+
98
+
99
+ どうしたものか(^_^;)

3

修正

2018/10/30 02:05

投稿

takabosoft
takabosoft

スコア8356

test CHANGED
@@ -34,27 +34,15 @@
34
34
 
35
35
  -----
36
36
 
37
- 追記:
38
-
39
- 加された情報を元に手元で試しましたが問題なくエアロが効いているように見えます。
37
+ 記 2018/10/30 10:39
40
38
 
41
39
 
42
40
 
43
- ![イメージ説明](c26af012b4e66aa7ae36cfea3d70e5cf.png)
41
+ Resources.dllプロジェクトの方で、styles.xaml の
44
42
 
45
43
 
46
44
 
47
- AeroTestプロジェクトで「参照の追加」で「Resources.dll」を追加してあって、
48
-
49
- debugフォルダにこのDLLとエアロのDLLが入れば動くと思います。
50
-
51
-
52
-
53
- ・・・と思ったんですが
54
-
55
-
56
-
57
- > <Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
45
+ > <Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
58
46
 
59
47
  > <Setter Property="Margin" Value="5,5,5,5"/>
60
48
 
@@ -68,4 +56,40 @@
68
56
 
69
57
 
70
58
 
59
+ を別のディクショナリ(例えば)Dictionary1.xamlファイルに切り出し、
60
+
61
+ styles.xaml側を
62
+
63
+
64
+
65
+ ```xaml
66
+
67
+ <ResourceDictionary
68
+
69
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
70
+
71
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
72
+
73
+
74
+
75
+ <ResourceDictionary.MergedDictionaries>
76
+
77
+ <ResourceDictionary Source="Dictionary1.xaml" />
78
+
79
+ <ResourceDictionary Source="/PresentationFramework.AeroLite;component/themes/aerolite.normalcolor.xaml" />
80
+
81
+ </ResourceDictionary.MergedDictionaries>
82
+
83
+ </ResourceDictionary>
84
+
85
+ ```
86
+
87
+
88
+
89
+ こんな感じに書けば動きました。
90
+
91
+
92
+
93
+ DLLリソースを使わず、単体アプリでもMergedDictionaries内でエアロとは別に直接Styleを書き込んでしまうとBaseOnが効かない感じでした。
94
+
71
- これが入ってると効かなくなるぽですね。しょう。
95
+ たぶんそうう仕組みでしょうこの辺詳しい方補足願えると助かります。

2

再現テスト2

2018/10/30 01:43

投稿

takabosoft
takabosoft

スコア8356

test CHANGED
@@ -47,3 +47,25 @@
47
47
  AeroTestプロジェクトで「参照の追加」で「Resources.dll」を追加してあって、
48
48
 
49
49
  debugフォルダにこのDLLとエアロのDLLが入れば動くと思います。
50
+
51
+
52
+
53
+ ・・・と思ったんですが
54
+
55
+
56
+
57
+ > <Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
58
+
59
+ > <Setter Property="Margin" Value="5,5,5,5"/>
60
+
61
+ > <Setter Property="VerticalAlignment" Value="Center"/>
62
+
63
+ > <Setter Property="VerticalContentAlignment" Value="Center"/>
64
+
65
+ > <Setter Property="Height" Value="25"/>
66
+
67
+ > </Style>
68
+
69
+
70
+
71
+ これが入ってると効かなくなるぽいですね。なんででしょう。

1

再現テスト

2018/10/30 01:12

投稿

takabosoft
takabosoft

スコア8356

test CHANGED
@@ -29,3 +29,21 @@
29
29
 
30
30
 
31
31
  にするとどうですか?
32
+
33
+
34
+
35
+ -----
36
+
37
+ 追記:
38
+
39
+ 追加された情報を元に手元で試しましたが問題なくエアロが効いているように見えます。
40
+
41
+
42
+
43
+ ![イメージ説明](c26af012b4e66aa7ae36cfea3d70e5cf.png)
44
+
45
+
46
+
47
+ AeroTestプロジェクトで「参照の追加」で「Resources.dll」を追加してあって、
48
+
49
+ debugフォルダにこのDLLとエアロのDLLが入れば動くと思います。