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 framework 4.5を使用しています。 System.Windows.Interactivity.dllをインストールできません。 4.5でサポートされているバージョンはありますか? – user3065219
更新されたコードをご覧ください。私はBlend SDK 4のダウンロードリンクを投稿しました。 – AnjumSKhan
あなたの解決に感謝します。パッケージマネージャコンソールからSystem.Windows.Interactivity.dllをインストールした後で正常に動作しています。 – user3065219