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

質問編集履歴

1

ソースコードの追加

2021/01/11 08:17

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -9,4 +9,49 @@
9
9
  ### 補足情報(FW/ツールのバージョンなど)
10
10
  .Net Framework4.7.2
11
11
  Prism Core v8.0.0.1909
12
- Prism Unity v8.0.0.1909
12
+ Prism Unity v8.0.0.1909
13
+
14
+
15
+ 頂いた回答を基に作成しました。
16
+
17
+ ### 作成したソースコード
18
+
19
+ ```xml:MainWindow.xaml
20
+ <Window x:Class="BlankApp1.Views.MainWindow"
21
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
22
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
23
+ xmlns:prism="http://prismlibrary.com/"
24
+ xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
25
+ prism:ViewModelLocator.AutoWireViewModel="True"
26
+ Title="Test" Height="350" Width="525">
27
+ <Grid>
28
+ <Calendar>
29
+ <i:Interaction.Triggers>
30
+ <i:EventTrigger EventName="SelectedDatesChanged">
31
+ <prism:InvokeCommandAction Command="{Binding SelectCommand}" />
32
+ </i:EventTrigger>
33
+
34
+ </i:Interaction.Triggers>
35
+ </Calendar>
36
+ </Grid>
37
+ </Window>
38
+ ```
39
+
40
+ ```c#:MainWindowViewModel
41
+ public class MainWindowViewModel : BindableBase
42
+ {
43
+ public DelegateCommand<SelectionChangedEventArgs> SelectCommand { get; }
44
+
45
+ public MainWindowViewModel()
46
+ {
47
+ this.SelectCommand = new DelegateCommand<SelectionChangedEventArgs>(this.ExecuteCommand);
48
+ }
49
+
50
+ private void ExecuteCommand(SelectionChangedEventArgs e)
51
+ {
52
+ Console.WriteLine("Date:{0}", e.OriginalSource.ToString());
53
+ }
54
+ }
55
+ ```
56
+
57
+ ここにより詳細な情報を記載してください。