Reputation: 191
I've been stuck for couple of hours already finding how i can activate a datepickerDialog from clicking on a menu item. I would like to link the clicked event of the button to the activation of the Datepickerpage.
Is this possible? what are my options ?
Upvotes: 2
Views: 596
Reputation: 29792
If you are using standard DatePicker then one way to do it may be (also completely in XAML) to use another DatePickerFlyout and bind its Date:
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<DatePicker Date="{Binding ElementName=myDatePickerFlyout,Path=Date, Mode=TwoWay}"/>
</Grid>
<Page.BottomAppBar>
<CommandBar>
<CommandBar.PrimaryCommands>
<AppBarButton Icon="Setting">
<AppBarButton.Flyout>
<DatePickerFlyout x:Name="myDatePickerFlyout" />
</AppBarButton.Flyout>
</AppBarButton>
</CommandBar.PrimaryCommands>
</CommandBar>
</Page.BottomAppBar>
Upvotes: 4