Issue
In my app I have a DatePicker. My xaml code is this:
<StackLayout Orientation="Horizontal">
<DatePicker x:Name="startDate"
Date="{Binding CurrentCourse.Start}"
TextColor="Red"/>
<DatePicker/>
<DatePicker x:Name="endDate"
Date="{Binding CurrentCourse.End}"
TextColor="Blue"/>
<DatePicker/>
</StackLayout>
Both controls get rendered properly, but next to each is another DatePicker for some reason. This duplicate DatePicker doesn't share the TextColor property either, so it's extra weird.
Does anyone know what could be happening here? I don't have any code elsewhere that does anything with DatePickers, so it's not happening in another module or something.
The Picture below shows the strange behavior.
Solution
You have 4 complete <DatePicker />
entries in your XML.
It's doing exactly as you tell it.
This first one is complete in itself:
<DatePicker x:Name="startDate"
Date="{Binding CurrentCourse.Start}"
TextColor="Red"/>
See the /
by the closing angle bracket? That's the end of the element, and it's a valid DatePicker Element.
Then you have a complete new one, with no styling or binding:
<DatePicker/>
That's the one that shows black.
Just delete the two stand-alone entries.
Answered By - GregHNZ
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.