teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

見直しキャンペーン中

2023/07/25 15:25

投稿

TN8001
TN8001

スコア10108

answer CHANGED
@@ -1,46 +1,44 @@
1
- > 問題1
1
+ > 問題1
2
-
2
+
3
- まず`BackGroundConverter`の型が違います。
3
+ まず`BackGroundConverter`の型が違います。
4
-
5
- ```xaml
4
+ ```xml
6
- <!--<local:BrushConverter x:Key="BackGroundConverter" />-->
5
+ <!--<local:BrushConverter x:Key="BackGroundConverter" />-->
7
- <local:BackGroundConverter x:Key="BackGroundConverter" />
6
+ <local:BackGroundConverter x:Key="BackGroundConverter" />
8
- ```
7
+ ```
9
-
8
+
10
- なんでもいいですが、なにかしらに`{TemplateBinding Background}`します。
9
+ なんでもいいですが、なにかしらに`{TemplateBinding Background}`します。
11
-
12
- ```xaml
10
+ ```xml
13
- <Style x:Key="DefaultCalendarDayButtonStyle" TargetType="{x:Type CalendarDayButton}">
11
+ <Style x:Key="DefaultCalendarDayButtonStyle" TargetType="{x:Type CalendarDayButton}">
14
- <Setter Property="Background" Value="{Binding Converter={StaticResource BackGroundConverter}, Mode=OneWay}" />
12
+ <Setter Property="Background" Value="{Binding Converter={StaticResource BackGroundConverter}, Mode=OneWay}" />
15
- <Setter Property="Foreground" Value="{Binding Converter={StaticResource BrushConverter}, Mode=OneWay}" />
13
+ <Setter Property="Foreground" Value="{Binding Converter={StaticResource BrushConverter}, Mode=OneWay}" />
16
- <Setter Property="Template">
14
+ <Setter Property="Template">
17
- <Setter.Value>
15
+ <Setter.Value>
18
- <ControlTemplate TargetType="{x:Type CalendarDayButton}">
16
+ <ControlTemplate TargetType="{x:Type CalendarDayButton}">
19
- <Border Background="{TemplateBinding Background}">
17
+ <Border Background="{TemplateBinding Background}">
20
- <ContentPresenter
18
+ <ContentPresenter
21
- x:Name="NormalText"
19
+ x:Name="NormalText"
22
- Margin="5,1,5,1"
20
+ Margin="5,1,5,1"
23
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
21
+ HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
24
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
22
+ VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
25
- </Border>
23
+ </Border>
26
- </ControlTemplate>
24
+ </ControlTemplate>
27
- </Setter.Value>
25
+ </Setter.Value>
28
- </Setter>
26
+ </Setter>
29
- </Style>
27
+ </Style>
30
- ```
28
+ ```
31
-
29
+
32
- > 問題2
30
+ > 問題2
33
-
31
+
34
- ページ(月)を変えると反映されるようなので、強制的に切り替えてみました。
32
+ ページ(月)を変えると反映されるようなので、強制的に切り替えてみました。
35
-
33
+
36
- 特にちらつき等はありませんが、月ビュー?になっていないと戻った時に変わっていませんでした^^;
34
+ 特にちらつき等はありませんが、月ビュー?になっていないと戻った時に変わっていませんでした
37
- ちゃんとやるなら月ビュー?にしたうえで切り替えて、さらにビューを戻す等?
35
+ ちゃんとやるなら月ビュー?にしたうえで切り替えて、さらにビューを戻す等?
38
-
36
+
39
- ```C#
37
+ ```cs
40
- var date = DateTime.ParseExact(txt.Text, "yyyyMMdd", null);
38
+ var date = DateTime.ParseExact(txt.Text, "yyyyMMdd", null);
41
- list.Add(date);
39
+ list.Add(date);
42
-
40
+
43
- var d = custom.DisplayDate;
41
+ var d = custom.DisplayDate;
44
- custom.DisplayDate = new DateTime();
42
+ custom.DisplayDate = new DateTime();
45
- custom.DisplayDate = d;
43
+ custom.DisplayDate = d;
46
44
  ```