refactor(P5b-5): 버튼 Click 핸들러 10개 → 커맨드 바인딩
상호작용 핸들러 중 '커맨드화 가능한' 순수 버튼 클릭을 전부 RelayCommand + Command 바인딩으로 전환.
- 상단바 5개(Settings/Register/Diagnose/ExportLog/ClearAll) + 폴더선택/취소/미리보기열기
+ 항목제거(CommandParameter={Binding}) + 폴더열기(CommandParameter={Binding RevealPath}).
- OnRemoveQueueItem→RemoveQueueItem(QueueItem?), OnOpenFolderClick→OpenFolderForPath(string?) 추출
(sender.Tag 의존 제거 → CommandParameter).
- 검증: 빌드 0/0, 83 테스트 그린, publish 후 메인 창 크래시 없이 로드(언핸들드 로그 없음).
- 잔여 핸들러는 MVVM에서도 뷰/behavior 영역: 드래그앤드롭, SelectionChanged/ValueChanged,
미리보기 마우스클릭, 탭·충돌 ToggleButton 그룹(IsChecked 상호배제), 복합 상태 ProcessQueue 버튼.
This commit is contained in:
parent
fa385178b2
commit
a05bbcf709
2 changed files with 51 additions and 32 deletions
|
|
@ -161,7 +161,7 @@
|
|||
ToolTip="비워두면 원본 폴더 옆 서브폴더에 저장"/>
|
||||
<Button Grid.Column="1" Margin="8,0,0,0" Width="36"
|
||||
Content="…" Style="{StaticResource FsSecondaryButtonStyle}"
|
||||
Click="OnPickOutputFolderClick"/>
|
||||
Command="{Binding PickOutputFolderCommand, RelativeSource={RelativeSource AncestorType=Window}}"/>
|
||||
</Grid>
|
||||
<TextBlock x:Name="OutputDestHint" Margin="0,6,0,0"
|
||||
Style="{StaticResource FsCaptionStyle}"
|
||||
|
|
@ -300,7 +300,7 @@
|
|||
<Button x:Name="CancelProcessingButton" Grid.Column="1"
|
||||
Content="취소" Padding="10,2"
|
||||
Style="{StaticResource FsSecondaryButtonStyle}"
|
||||
Click="OnCancelProcessingClick"/>
|
||||
Command="{Binding CancelProcessingCommand, RelativeSource={RelativeSource AncestorType=Window}}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
|
|
@ -368,19 +368,19 @@
|
|||
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
||||
<Button Content="⚙ 설정" Margin="0,0,8,0"
|
||||
Style="{StaticResource FsSecondaryButtonStyle}"
|
||||
Click="OnSettingsClick"/>
|
||||
Command="{Binding SettingsCommand, RelativeSource={RelativeSource AncestorType=Window}}"/>
|
||||
<Button Content="Register Menu" Margin="0,0,8,0"
|
||||
Style="{StaticResource FsSecondaryButtonStyle}"
|
||||
Click="OnRegisterClick"/>
|
||||
Command="{Binding RegisterCommand, RelativeSource={RelativeSource AncestorType=Window}}"/>
|
||||
<Button Content="Diagnose" Margin="0,0,8,0"
|
||||
Style="{StaticResource FsSecondaryButtonStyle}"
|
||||
Click="OnDiagnoseClick"/>
|
||||
Command="{Binding DiagnoseCommand, RelativeSource={RelativeSource AncestorType=Window}}"/>
|
||||
<Button Content="Export Log" Margin="0,0,8,0"
|
||||
Style="{StaticResource FsSecondaryButtonStyle}"
|
||||
Click="OnExportLogClick"/>
|
||||
Command="{Binding ExportLogCommand, RelativeSource={RelativeSource AncestorType=Window}}"/>
|
||||
<Button x:Name="ClearAllButton" Content="Clear All"
|
||||
Style="{StaticResource FsSecondaryButtonStyle}"
|
||||
Click="OnClearAllClick"/>
|
||||
Command="{Binding ClearAllCommand, RelativeSource={RelativeSource AncestorType=Window}}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
|
@ -500,8 +500,8 @@
|
|||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"
|
||||
ToolTip="큐에서 제거"
|
||||
Click="OnRemoveQueueItem"
|
||||
Tag="{Binding}">
|
||||
Command="{Binding RemoveQueueItemCommand, RelativeSource={RelativeSource AncestorType=Window}}"
|
||||
CommandParameter="{Binding}">
|
||||
<Path Width="13" Height="13" Stretch="Uniform"
|
||||
Stroke="{StaticResource FsTextTertiary}"
|
||||
StrokeThickness="2"
|
||||
|
|
@ -618,8 +618,8 @@
|
|||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Padding="6"
|
||||
Click="OnOpenFolderClick"
|
||||
Tag="{Binding RevealPath}"
|
||||
Command="{Binding OpenFolderCommand, RelativeSource={RelativeSource AncestorType=Window}}"
|
||||
CommandParameter="{Binding RevealPath}"
|
||||
ToolTip="출력 파일이 있는 폴더 열기">
|
||||
<Path Width="14" Height="14" Stretch="Uniform"
|
||||
Stroke="{StaticResource FsTextTertiary}"
|
||||
|
|
@ -779,7 +779,7 @@
|
|||
|
||||
<Button Content="Open in Explorer" Margin="0,16,0,0"
|
||||
Style="{StaticResource FsSecondaryButtonStyle}"
|
||||
Click="OnPreviewOpenFolder"
|
||||
Command="{Binding PreviewOpenFolderCommand, RelativeSource={RelativeSource AncestorType=Window}}"
|
||||
HorizontalAlignment="Stretch"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue