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

質問編集履歴

1

クラス名と名前空間名の変更

2021/04/30 15:24

投稿

K.KATSU2
K.KATSU2

スコア10

title CHANGED
File without changes
body CHANGED
@@ -7,15 +7,15 @@
7
7
  ### 該当のソースコード
8
8
  [UsercontrolのXaml]
9
9
  ```Xaml
10
- <UserControl x:Class="ApprovalFlow.Views.WIPList"
10
+ <UserControl x:Class="TEST.Views.TESTList"
11
11
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
12
12
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
13
13
  xmlns:prism="http://prismlibrary.com/"
14
- xmlns:viewmodels="clr-namespace:ApprovalFlow.ViewModels"
14
+ xmlns:viewmodels="clr-namespace:TEST.ViewModels"
15
15
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
16
16
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
17
17
  mc:Ignorable="d"
18
- d:DataContext="{d:DesignInstance Type=viewmodels:WIPListViewModel}"
18
+ d:DataContext="{d:DesignInstance Type=viewmodels:TESTListViewModel}"
19
19
  prism:ViewModelLocator.AutoWireViewModel="True">
20
20
  <Grid>
21
21
  <StackPanel>
@@ -30,7 +30,7 @@
30
30
  </DataTemplate>
31
31
  </DataGridTemplateColumn.CellTemplate>
32
32
  </DataGridTemplateColumn>
33
- <DataGridTextColumn Header="ファイル名" Binding="{Binding FileName}" MinWidth="300" Width="*"/>
33
+ <DataGridTextColumn Header="名" Binding="{Binding FileName}" MinWidth="300" Width="*"/>
34
34
  <DataGridTextColumn Header="担当" Binding="{Binding Person}" Width="75"/>
35
35
  <DataGridTextColumn Header="ステータス" Binding="{Binding Status}" Width="50"/>
36
36
  <DataGridTemplateColumn Width="50">
@@ -40,13 +40,6 @@
40
40
  </DataTemplate>
41
41
  </DataGridTemplateColumn.CellTemplate>
42
42
  </DataGridTemplateColumn>
43
- <DataGridTemplateColumn Width="50">
44
- <DataGridTemplateColumn.CellTemplate>
45
- <DataTemplate>
46
- <Button Content="開く"/>
47
- </DataTemplate>
48
- </DataGridTemplateColumn.CellTemplate>
49
- </DataGridTemplateColumn>
50
43
  </DataGrid.Columns>
51
44
  </DataGrid>
52
45
  <Button Content="実行" Margin="430,5,5,5"/>
@@ -56,47 +49,6 @@
56
49
 
57
50
  ```
58
51
 
59
- [UsercontrolのViewModel]
60
- ```C#
61
- public class WIPListViewModel : BindableBase
62
- {
63
- MainWindowViewModel _mainWindowViewModel;
64
-
65
- public WIPListViewModel(MainWindowViewModel mainWindowViewModel)
66
- {
67
- _mainWindowViewModel = mainWindowViewModel;
68
- foreach(var elm in WorkInProcessList.DB)
69
- {
70
- _activeFiles.Add
71
- (
72
- new ActiveFileList { FileName = elm.File, Person = elm.Member, Status = elm.Order.ToString() }
73
- );
74
- }
75
- ShowStatusCheck = new DelegateCommand(ShowStatusCheckExecute);
76
- }
77
-
78
- private ObservableCollection<ActiveFileList> _activeFiles = new ObservableCollection<ActiveFileList>();
79
- public ObservableCollection<ActiveFileList> ActiveFiles
80
- {
81
- get { return _activeFiles; }
82
- set { SetProperty(ref _activeFiles, value); }
83
- }
84
-
85
- public DelegateCommand ShowStatusCheck { get; }
86
- private void ShowStatusCheckExecute()
87
- {
88
- _mainWindowViewModel.StatusCheckExecute();
89
- }
90
- }
91
-
92
-   public class ActiveFileList
93
- {
94
- public string FileName { get; set; }
95
- public string Person { get; set; }
96
- public string Status { get; set; }
97
- }
98
- ```
99
-
100
52
  ### 試したこと
101
53
 
102
54
  以前の質問の回答から応用して解決できると思っていたのですが、まだ理解が及んでおらず行き詰っております。