using System; using Xamarin.CommunityToolkit.UI.Views; using Xamarin.Forms.Xaml; namespace TINK.View { [XamlCompilation(XamlCompilationOptions.Compile)] public partial class FeedbackPopup : Popup { /// Constructs user feedback popup. /// Co2 saving information. public FeedbackPopup(string co2Saving = null) { InitializeComponent(); if (string.IsNullOrEmpty(co2Saving)) Co2SavingFrame.IsVisible = false; else Co2SavingLabel.Text = co2Saving; } protected override FeedbackPopup.Result GetLightDismissResult() { return new Result { Message = feedbackMessage.Text, IsBikeBroken = brockenCheckBox.IsChecked }; } private void OnOkClicked(object sender, EventArgs eventArgs) { var result = new Result { Message = feedbackMessage.Text, IsBikeBroken = brockenCheckBox.IsChecked }; Dismiss(result); } /// /// Feedback given by user when returning bike. /// #if USCSHARP9 public class Result : IViewService.IUserFeedback #else public new class Result : IUserFeedback #endif { /// /// Holds whether bike is broken or not. /// public bool IsBikeBroken { get; set; } /// /// Holds either /// - general feedback /// - error description of broken bike /// or both. /// public string Message { get; set; } } } }