回答編集履歴
1
見直しキャンペーン中
answer
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
`DataGrid`内の`ScrollViewer`(`DG_ScrollViewer`)はテンプレートが当たっているため、`ScrollBar`のスタイルをいじることになります。
|
1
|
+
`DataGrid`内の`ScrollViewer`(`DG_ScrollViewer`)はテンプレートが当たっているため、`ScrollBar`のスタイルをいじることになります。
|
2
|
-
[wpf/DataGrid.xaml at release/5.0 · dotnet/wpf](https://github.com/dotnet/wpf/blob/release/5.0/src/Microsoft.DotNet.Wpf/src/Themes/XAML/DataGrid.xaml#L123)
|
2
|
+
[wpf/DataGrid.xaml at release/5.0 · dotnet/wpf](https://github.com/dotnet/wpf/blob/release/5.0/src/Microsoft.DotNet.Wpf/src/Themes/XAML/DataGrid.xaml#L123)
|
3
|
-
|
3
|
+
|
4
|
-
```
|
4
|
+
```xml
|
5
|
-
<!-- カスタムスクロールバーのスタイル -->
|
5
|
+
<!-- カスタムスクロールバーのスタイル -->
|
6
|
-
<Style TargetType="{x:Type ScrollBar}">
|
6
|
+
<Style TargetType="{x:Type ScrollBar}">
|
7
|
-
```
|
7
|
+
```
|
8
|
-
と`x:Key`なし(既定を上書き)にした上で、アプリ全体でよければ`App.xaml`にマージします。
|
8
|
+
と`x:Key`なし(既定を上書き)にした上で、アプリ全体でよければ`App.xaml`にマージします。
|
9
|
-
`DataGrid`だけでいい場合は、こんな感じでいいと思います。
|
9
|
+
`DataGrid`だけでいい場合は、こんな感じでいいと思います。
|
10
|
-
```
|
10
|
+
```xml
|
11
|
-
<DataGrid.Resources>
|
11
|
+
<DataGrid.Resources>
|
12
|
-
<ResourceDictionary Source="Dictionary1.xaml" />
|
12
|
+
<ResourceDictionary Source="Dictionary1.xaml" />
|
13
|
-
</DataGrid.Resources>
|
13
|
+
</DataGrid.Resources>
|
14
14
|
```
|