0
새 캘린더 컨트롤을 만들고 있습니다. 선택한 날짜를 단추 텍스트로 설정했습니다. 날짜가 선택되면 캘린더를 닫아야합니다.날짜 선택시 캘린더 닫기
<Window x:Class="DemoApp2.Views.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Window.Resources>
</Window.Resources>
<Grid>
<ToggleButton x:Name="btn" Content="{Binding SelectedDate, ElementName=CalendarControl}" Background="Red" Margin="50,103,55,130">
</ToggleButton>
<Popup IsOpen="{Binding ElementName=btn, Path=IsChecked}" StaysOpen="False" PopupAnimation="Scroll" PlacementRectangle="50,53,50,50">
<Calendar x:Name="CalendarControl"
HorizontalAlignment="Center"
VerticalAlignment="Center">
</Calendar>
</Popup>
</Grid>
</Window>
나는 xaml 코드를 선호합니다. 당신의 소중한 도움을 기다리고 있습니다. 미리 감사드립니다.
내가 .NET 프레임 워크 4.5을 사용하고 있습니다. System.Windows.Interactivity.dll을 설치할 수 없습니다. 우리는 4.5 버전을 지원합니까? – user3065219
업데이트 된 코드를 참조하십시오. Blend SDK 4 다운로드 링크가 게시되었습니다. – AnjumSKhan
해결책 주셔서 감사합니다. 패키지 관리자 콘솔에서 System.Windows.Interactivity.dll을 설치 한 후 제대로 작동합니다. – user3065219