1
좋아요, 그래서 탭 컨트롤 템플릿을 수정하여 두 개의 버튼을 추가했습니다. 하나는 열리고 다른 하나는 다른 탭과 함께 저장됩니다.WPF OnMouse 템플릿에서 위로
내가해야 할 일은 버튼이 창 내부에있는 OpenSave/CloseSave 기능을 실행하도록하는 것입니다. 각각의 윈도우는 윈도우에서 함수를 사용해야하는 이유가 무엇인지에 따라 다른 방식으로 자신 만의 열기 및 저장 기능을 갖게됩니다.
<Style x:Key="EditorTabControl" TargetType="{x:Type TabControl}">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabControl}">
<Grid SnapsToDevicePixels="True">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="0" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Border Grid.Row="2" Panel.ZIndex="1" Background="#fafafa" Padding="10" BorderBrush="#ededed" BorderThickness="0 1 0 0">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button Content="Open" Style="{StaticResource EditorButtonStyle}"/>
<Button Content="Save" Style="{StaticResource EditorButtonStyle}"/>
<TabPanel IsItemsHost="True"/>
</StackPanel>
</Border>
<Border Grid.Row="0" BorderThickness="0" BorderBrush="#696969" Background="#FFF">
<ContentPresenter Content="{TemplateBinding SelectedContent}" />
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
그렇다면 제어 템플릿이 사용되는 창에있는 함수를 실행하게하려면 어떻게해야합니까?
귀하의 질문은 ...이 같은 창을 가질 수 있습니까? – David
그렇다면 컨트롤 템플릿이 사용되는 창에있는 함수를 실행하게하려면 어떻게해야합니까? –
'ICommand'바인딩이 작동하지 않습니까? –