Bug 37376 - DatePicker unfocused event is fired when focused
Summary: DatePicker unfocused event is fired when focused
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.0.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
: 45533 ()
Depends on:
Blocks:
 
Reported: 2016-01-04 12:24 UTC by Adam Hartley [MSFT]
Modified: 2017-02-05 00:46 UTC (History)
6 users (show)

Tags: Windows ac
Is this bug a regression?: ---
Last known good build:


Attachments
Sample project and logs (102.30 KB, application/x-rar)
2016-01-04 12:24 UTC, Adam Hartley [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 37376 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Adam Hartley [MSFT] 2016-01-04 12:24:34 UTC
Created attachment 14431 [details]
Sample project and logs

## Steps to reproduce

1. Download and run attached sample
2. Tap on the date picker entry

## Expected result

Unfocused event should not be fired

## Actual result

Unfocused event is fired (Line 17 of App.cs)

## Notes

Verified on a Lumia 535 running WP 8.1
Comment 1 Mihail 2016-01-04 12:34:31 UTC
I am also able to reproduce the issue. The device is Lumia 925 running WP 8.1
Comment 2 E.Z. Hart [MSFT] 2016-02-03 21:35:46 UTC
Still happening in 2.0.1.6505
Comment 3 Paul DiPietro [MSFT] 2016-10-18 17:20:33 UTC
*** Bug 45533 has been marked as a duplicate of this bug. ***
Comment 4 Maxime GUITTET 2016-10-19 21:12:49 UTC
Hi, anything new about this? Barely 10 months since the first report..
Comment 5 Andreas 2017-02-03 09:00:09 UTC
Come on, please fix this! 
13 months since report... And counting...
Comment 6 Maxime GUITTET 2017-02-05 00:46:00 UTC
I might have found a trick.

Put a layout like that:

<!--  DATE  -->
<AbsoluteLayout
    x:Name="DateButton"
    AbsoluteLayout.LayoutBounds="0, 0.5, 0.1, 1"
    AbsoluteLayout.LayoutFlags="All"
    BackgroundColor="{x:StaticResource NL_OrangeBeer}"
    Opacity="0.8">
        <control:CustomLabel
            AbsoluteLayout.LayoutBounds="0.5, 0.5, 1, 1"
            AbsoluteLayout.LayoutFlags="All"
            FontFamily="{extension:FontFamily Roboto_Light}"
            FontSize="20"
            HorizontalTextAlignment="Center"
            Text="{Binding DaySelected}"
            TextColor="White"
            VerticalTextAlignment="Center" />
        <DatePicker
            AbsoluteLayout.LayoutBounds="0.5, 0.5, 1, 1"
            AbsoluteLayout.LayoutFlags="All"
            Date="{Binding CurrentDate}"
            Format="dd"
            MinimumDate="{Binding CurrentDate}"
            Opacity="0" />
</AbsoluteLayout>

So behind, in the C# part, you will need a `public DateTime CurrentDate { get; set; }`. Initialize it like that => `CurrentDate = DateTime.Now();`

Second, you will need the selected/current day (DaySelected).
public string DaySelected
{
    get { return String.Format("{0}", CurrentDate.Day); }
}

PS: I do CurrentDate.Day but you can do DateTime.Now().Day, the thing is, if you update from the date picker CurrentDate, then it does the update properly ;)

xoxo