質問編集履歴

2

修正

2019/03/21 11:06

投稿

mercurian-teto
mercurian-teto

スコア75

test CHANGED
File without changes
test CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  ```
18
18
 
19
- とエラーが起きます。下のコードのようにx:keyに定義されているような記述があるはずなのですが、元のサンプルコードを見渡しても全く記述されているところが見当たりません。
19
+ とエラーが起きます。下のコードのようにStaticResourceの HeaderStylex:keyに定義されているような記述があるはずなのですが、元のサンプルコードを見渡しても全く記述されているところが見当たりません。
20
20
 
21
21
 
22
22
 

1

syuusei

2019/03/21 11:05

投稿

mercurian-teto
mercurian-teto

スコア75

test CHANGED
File without changes
test CHANGED
@@ -1,4 +1,4 @@
1
- NuGetからmaterialdesigncolorsとmaterialdesignthemesをインストールしました。
1
+ NuGetからmaterialdesigncolorsとmaterialdesignthemesをインストールしました。問題のコードは一番下に記述しています.
2
2
 
3
3
  ```
4
4
 
@@ -16,7 +16,51 @@
16
16
 
17
17
  ```
18
18
 
19
+ とエラーが起きます。下のコードのようにx:keyに定義されているような記述があるはずなのですが、元のサンプルコードを見渡しても全く記述されているところが見当たりません。
20
+
21
+
22
+
23
+ ```
24
+
25
+
26
+
27
+ <Window x:Class="WpfTutorialSamples.Styles.ExplicitStyleSample"
28
+
29
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
30
+
31
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
32
+
33
+ Title="ExplicitStyleSample" Height="150" Width="300">
34
+
35
+ <Window.Resources>
36
+
37
+ <Style x:Key="HeaderStyle" TargetType="TextBlock">
38
+
39
+ <Setter Property="Foreground" Value="Gray" />
40
+
41
+ <Setter Property="FontSize" Value="24" />
42
+
43
+ </Style>
44
+
45
+ </Window.Resources>
46
+
47
+ <StackPanel Margin="10">
48
+
49
+ <TextBlock>Header 1</TextBlock>
50
+
51
+ <TextBlock Style="{StaticResource HeaderStyle}">Header 2</TextBlock>
52
+
53
+ <TextBlock>Header 3</TextBlock>
54
+
55
+ </StackPanel>
56
+
57
+ </Window>
58
+
59
+ ```
60
+
61
+
62
+
19
- とあります。
63
+ ##問題のコード
20
64
 
21
65
  ```
22
66