저는 WPF 개발 초보자입니다. 프레임이있는 창을 만듭니다. 프레임을위한 템플릿을 작성했는데 성공하지 못했던 템플릿 명령 내에서 버튼에 바인딩하려고합니다.명령 바인딩이 작동하지 않습니다.
<Grid.Resources>
<ControlTemplate TargetType="Frame" x:Key="NavigationButtonsTemplates">
<DockPanel>
<StackPanel
Margin="7"
Orientation="Horizontal"
DockPanel.Dock="Bottom"
HorizontalAlignment="Right"
>
<Button
Content="Back"
Command="{x:Static NavigationCommands.BrowseBack}"
Margin="5,0,5,0" Width="80" />
<Button
Content="Next"
Command="{Binding Path=NavigateToPersonalDataCommand}"
Margin="5,0,5,0" Width="80"></Button>
</StackPanel>
<Border
BorderBrush="LightBlue"
Margin="7,8,9,0"
BorderThickness="7"
Padding="5"
CornerRadius="7"
Background="White"
>
<ContentPresenter />
</Border>
</DockPanel>
</ControlTemplate>
</Grid.Resources>
버튼의 바인딩이 작동하지 않는 것 같습니다 :
다음 코드를 참조하십시오. 태그 외부에 단추를 넣으면 완벽하게 작동합니다. 에있는 버튼에 명령을 바인딩하려면 어떻게합니까?감사
아직도 작동하지 않습니다. 두 가지 옵션을 시도했습니다. 단추는 명령을 실행하지 않습니다. – Ofir
다른 아이디어가 있습니까? – Ofir
@CharlieGrinvald 템플릿을 사용하는 코드를 게시 할 수 있습니까? 더 많은 정보가 필요해. –