Hello,
I have problem with accessing selector buttons in DatePicker and TimePicker too. When I'm running my app in emulator, than I see buttons. But when I run app on my test device (Lumia 550), buttons are hidden with navigation bar. How can I set DatePicker for soft navigation bar?
Best Regards
Miroslav Mareš
9 Answers, 1 is accepted
As I am not completely sure what exactly you are trying to achieve, could you please elaborate more or send me some project or screenshot with additional explanation?
I am looking forward to your reply.
Regards,
Ivaylo Gergov
Telerik
Hello,
I send you screenshots from my phone Lumia 550.
Best Regards
Miroslav Mareš
I am afraid we are not able to reproduce the issue at hand. Still, here is a suggestion -- you can attach to Opened event of RadDatePicker and use ApplicationView.PreferredLaunchWindowingMode property. Set it to ApplicationViewWindowingMode.FullScreen. In addition, you might want to set it back to Auto when RadDatePicker closes.
Best regards,
Ves
Telerik
Hello,
this workaround not worked. Result is still same as on screens, what I posted before.
Best Regards
Miroslav Mareš
We will need some more time to investigate this and I will get back to you as soon as we have some resolution or a workaround.
Regards,
Ivaylo Gergov
Telerik
Any update on this? I'm experiencing it on a Lumia 550 and have clients who are experiencing it too.
I have gotten around it by changing the entire app to full screen when running on Windows 10 Mobile like this:
if (Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Mobile")
{
ApplicationView.TryEnterFullScreenMode();
}
I don't think this is a great solution though.
Thanks,
Greg
This is unrelated to Telerik controls specifically, but rather it's a general Windows Mobile programming scenario you need to account for when your app is running on a device that does not use hardware buttons.
Fortunately, there is a way you can detect and manage this using a little logic (usually put within your root frame). Here is an example:
First, hook into the VisibleBoundsChanged event:
var appView = ApplicationView.GetForCurrentView();
appView.VisibleBoundsChanged += VisibleBoundsChanged;
Then in the event handler, detect if the on-screen buttons are visible, if they are determine the occulded rect and adjust the height of your UI. Here's an example:
private
void
VisibleBoundsChanged(ApplicationView sender,
object
args)
{
if
(Windows.Foundation.Metadata.ApiInformation.IsTypePresent(
"Windows.UI.ViewManagement.StatusBar"
))
{
var statusBar = StatusBar.GetForCurrentView();
var appView = ApplicationView.GetForCurrentView();
var inputPane = InputPane.GetForCurrentView();
double
newHeight;
double
newWidth;
var orientation = DisplayInformation.GetForCurrentView().CurrentOrientation;
Debug.WriteLine($
"CurrentOrientation: {orientation}"
);
switch
(orientation)
{
case
DisplayOrientations.None:
break
;
case
DisplayOrientations.Landscape:
newWidth = appView.VisibleBounds.Width +
(statusBar?.OccludedRect.Width) ?? 0 +
(inputPane?.OccludedRect.Width) ?? 0;
if
((inputPane?.OccludedRect.Width ?? 0) <= 0 || newWidth <
this
.Width)
this
.Width = newWidth;
//NOTE: If you see that the Frame is centered and there is space at the top and the bottom is still clipped, you may need to shift it over
this
.HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Left;
this
.VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Top;
break
;
case
DisplayOrientations.Portrait:
newHeight = appView.VisibleBounds.Height +
(statusBar?.OccludedRect.Height) ?? 0 +
(inputPane?.OccludedRect.Height) ?? 0;
if
((inputPane?.OccludedRect.Height ?? 0) <= 0 || newHeight <
this
.Height)
this
.Height = newHeight;
this
.VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Top;
this
.HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Stretch;
break
;
case
DisplayOrientations.LandscapeFlipped:
newWidth = appView.VisibleBounds.Width +
(statusBar?.OccludedRect.Width) ?? 0 +
(inputPane?.OccludedRect.Width) ?? 0;
if
((inputPane?.OccludedRect.Width ?? 0) <= 0 || newWidth <
this
.Width)
this
.Width = newWidth;
this
.HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Right;
this
.VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Top;
break
;
case
DisplayOrientations.PortraitFlipped:
newHeight = appView.VisibleBounds.Height +
(statusBar?.OccludedRect.Height) ?? 0 +
(inputPane?.OccludedRect.Height) ?? 0;
if
((inputPane?.OccludedRect.Height ?? 0) <= 0 || newHeight <
this
.Height)
this
.Height = newHeight;
this
.VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Bottom;
this
.HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Stretch;
break
;
default
:
break
;
}
}
}
We are active investigating if this is something we can add into the product, however it is unlikely we will add this approach affects the entire application, not just the modal for the picker.
Once the engineering team has completed the investigation into how we can mitigate this just for the UI for UWP pickers, they will come back and update this thread.
Thank you for your patience and understanding while we investigate this further.
Regards,
Lance | Tech Support Engineer, Sr.
Telerik by Progress
A suggestion to Telerik Engineering...(since it seems to be on all windows phones now)
Can you set a setting in the control that simply shortens the height of the control by 100px, and center it.... that would certainly do it and be a super fast super easy fix.
Thank you for the suggestions. With the upcoming Beta (due in the the next couple of weeks) we have addressed this issue. Now, the DatePicker popup opens in the visible screen bounds.
Please excuse us for the delay on this issue.
Regards,
Tsvyatko
Telerik by Progress