|
@@ -58,8 +58,6 @@ namespace InABox.Mobile
|
|
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
|
|
public partial class MobileTimeButton
|
|
|
{
|
|
|
- private SfPopupLayout popup;
|
|
|
-
|
|
|
public event TimeButtonChanged Changed;
|
|
|
|
|
|
public static readonly BindableProperty PromptProperty = BindableProperty.Create(
|
|
@@ -184,50 +182,49 @@ namespace InABox.Mobile
|
|
|
public MobileTimeButton()
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
- popup = new SfPopupLayout();
|
|
|
}
|
|
|
|
|
|
private void _frame_OnClicked(object sender, EventArgs e)
|
|
|
{
|
|
|
|
|
|
- popup.PopupView.WidthRequest = 300;
|
|
|
- popup.PopupView.HeightRequest = 500;
|
|
|
- popup.PopupView.ShowHeader = false;
|
|
|
- popup.PopupView.ShowFooter = false;
|
|
|
- //popup.PopupView.PopupStyle.HasShadow = false;
|
|
|
- popup.PopupView.PopupStyle.CornerRadius = 5;
|
|
|
- //popup.PopupView.Background = new SolidColorBrush(Color.White);
|
|
|
MobileTimeSelector popupContent = new MobileTimeSelector();
|
|
|
popupContent.Time = Time;
|
|
|
popupContent.Changed += (o, args) =>
|
|
|
{
|
|
|
Time = args.Time;
|
|
|
DoChanged();
|
|
|
- popup.Closing -= RestrictClose;
|
|
|
- popup.Dismiss();
|
|
|
+ PopupManager.DismissPopup();
|
|
|
};
|
|
|
popupContent.Cancelled += (o, args) =>
|
|
|
{
|
|
|
- popup.Closing -= RestrictClose;
|
|
|
- popup.Dismiss();
|
|
|
+ PopupManager.DismissPopup();
|
|
|
};
|
|
|
- popup.Closing += RestrictClose;
|
|
|
- popupContent.Margin = new Thickness(10);
|
|
|
popupContent.HorizontalOptions = LayoutOptions.Fill;
|
|
|
popupContent.VerticalOptions = LayoutOptions.Fill;
|
|
|
- popup.PopupView.ContentTemplate = new DataTemplate(() => popupContent);
|
|
|
|
|
|
- popup.Show();
|
|
|
+ PopupManager.ShowPopup(
|
|
|
+ this,
|
|
|
+ () => popupContent,
|
|
|
+ new PopupManagerConfiguration()
|
|
|
+ {
|
|
|
+ Modal = true,
|
|
|
+ RequestedHeight = 500,
|
|
|
+ RequestedWidth = 350
|
|
|
+ }
|
|
|
+ );
|
|
|
+ // popup.PopupView.WidthRequest = 300;
|
|
|
+ // popup.PopupView.HeightRequest = 500;
|
|
|
+ // popup.PopupView.ShowHeader = false;
|
|
|
+ // popup.PopupView.ShowFooter = false;
|
|
|
+ // popup.PopupView.PopupStyle.CornerRadius = 5;
|
|
|
+ // popup.Closing += RestrictClose;
|
|
|
+ // popup.PopupView.ContentTemplate = new DataTemplate(() => popupContent);
|
|
|
+ // popup.Show();
|
|
|
}
|
|
|
|
|
|
protected virtual void DoChanged()
|
|
|
{
|
|
|
Changed?.Invoke(this,new TimeButtonChangedArgs(Time));
|
|
|
}
|
|
|
-
|
|
|
- private void RestrictClose(object sender, CancelEventArgs e)
|
|
|
- {
|
|
|
- e.Cancel = true;
|
|
|
- }
|
|
|
}
|
|
|
}
|