C# 프로젝트에서 WPF를 사용하고 있습니다.
ResourceDictionary로 작성된 파일을 다른 xaml에서 참조하려고 하는데 찾을수 없다고 에러가 납니다.
ToggleButtonEX.xaml 이란 파일안에
<ControlTemplate x:Key="ToggleButtonExTemplate" TargetType="{x:Type Button}"> .....</ControlTemplate>
<Style x:Key=" ToggleButtonEx " TargetType="{x:Type Button}">
<Setter Property="Template" Value="{StaticResource ToggleButtonExTemplate }" />
</Style>
이렇게 설정하고
WPF 다이얼로그를 만들어서 참조하게 했습니다.
<Window x:Class="WindowsFormsApplication2.Dialog"
<Window.Resources>
<Storyboard x:Key="StoryBoard_1">
<DoubleAnimation Storyboard.TargetName="uiGridMain" BeginTime="0:0:0.1"
Storyboard.TargetProperty="Opacity" From="0.00" To="1.00" AutoReverse="False" Duration="0:0:0.3" />
</Storyboard>
<Storyboard x:Key=" StoryBoard_2">
<DoubleAnimation Storyboard.TargetName="uiGridMain" BeginTime="0:0:0.5"
Storyboard.TargetProperty="Opacity" From="1.00" To="0.00" AutoReverse="False" />
</Storyboard>
<ResourceDictionary x:Key="aa">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source=" ToggleButtonEX .xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
</Window>
그런데
<Grid>
<Button Style="{StaticResource ToggleButtonEx }" FontSize="11">닫기 </Button>
</Grid>
이렇게 호출하니 ToggleButtonEx를 확인할수 없다고 나옵니다.
윈도우 리소스쪽에서 스토리보드 태그를 빼면 되긴 하는데..;;;
문법적인 오류인가요?..
[최초 등록일: ]
[최종 수정일: 2/12/2012]