bitfoundation / bitplatform

Build all of your apps using what you already know and love ❤️
https://bitplatform.dev
MIT License
1.08k stars 225 forks source link

BitDateTimePicker Initialization #186

Closed ehsangfl closed 4 years ago

ehsangfl commented 4 years ago

Hi System.IndexOutOfRangeException: 'No Page in PopupStack' on Initialization

This error happended when DateTimePicker.AutoClose = "True" and datetime property of ViewModel has initial value.

for example, in your sample solution, if change this line <bit:BitDateTimePicker SelectedDateTime="{Binding SelectedDateTime}" Text="Please select a date!"/> To <bit:BitDateTimePicker SelectedDateTime="{Binding SelectedDateTime}" Text="Please select a date!" AutoClose="True"/> on BitDateTimePickerSampleView.xaml, this exception will throw on initialization of page

Bit CSharp client

BR

ysmoradi commented 4 years ago

We're not facing the same issue because there is a workaround in Bit.Client.Xamarin.Prism I'll move that workaround to Bit.Client.Xamarin.Controls in the upcoming release. That exception happens in many cases, and in the end, I had to do a trick!

Note that there is a sample with AutoClose="True" in samples. I tested that and it's working fine.

Re clone/download bitframework repo and test the latest version of sample app and let me know if you're facing that issue or not.

ehsangfl commented 4 years ago

this exception thrown if 1- Autoclose="True" 2-bind SelectedDate to a property ( for example property of viewmodel class ) 3-Property of viewmodel must have value. not null or empty value. Not only AutoClose="true" I downloaded all repo after release version 5 . if you want to see this exception, you must change this line on your sample. and then run it. dont use hotreload <bit:BitDateTimePicker SelectedDateTime="{Binding SelectedDateTime}" Text="Please select a date!" AutoClose="True"/>

Thx

ysmoradi commented 4 years ago

Bit 5.2 has been released. You can use that to solve your issue

lock[bot] commented 4 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem. Read more about our automatic conversation locking policy.