Jeroen Brock
Jeroen Brock

Reputation: 191

Windows Phone 8.1 Datepicker show on click

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 ?

Thanks in advance! Button that activates the Datepicker

Upvotes: 2

Views: 596

Answers (1)

Romasz
Romasz

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

Related Questions