void SetSfPopupText(string HeaderText, string BodyText, AppearanceMode appearanceMode = AppearanceMode.OneButton, string AcceptText = "ACCEPT", string DeclineText = "DECLINE") { Label popupContent; DataTemplate dataTemplate = new DataTemplate(() => { popupContent = new Label(); popupContent.Text = BodyText; popupContent.FontFamily = "Poppins"; popupContent.FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)); popupContent.FontAttributes = FontAttributes.Bold; popupContent.BackgroundColor = Color.White; return(popupContent); }); SfPopupLayout sfPopup = new SfPopupLayout(); sfPopup.PopupView.AppearanceMode = appearanceMode; sfPopup.PopupView.AcceptButtonText = AcceptText; sfPopup.PopupView.DeclineButtonText = DeclineText; sfPopup.PopupView.HeaderTitle = HeaderText; sfPopup.PopupView.ContentTemplate = dataTemplate; sfPopup.PopupView.AnimationMode = AnimationMode.SlideOnTop; sfPopup.PopupView.AcceptCommand = new Command(() => ShowChangePassword()); sfPopup.PopupView.DeclineCommand = new Command(() => DirectShowHomeview()); sfPopup.Show(); }
public ContextMenu() { //Button and Images Name's Contained in array this.contextMenuButtonNames = new string[] { "Sort Ascending", "Sort Descending", "Clear Sorting", "seperator", "Group this Column", "Clear Grouping" }; this.contextMenuImageNames = new string[] { "Images/Sort_Ascending_Icons.png", "Images/Sort_descending_Icons.png", "Images/Clear_sorting_Icon.png", "seperator", "Images/Grouping_Icon.png", "Images/Clear_grouping_icon.png" }; this.sfGrid = new SfDataGrid(); this.sfGrid.AutoGenerateColumns = true; this.contextMenuItem = new ContextMenuViewModel(); this.sfGrid.ItemsSource = this.contextMenuItem.Products; this.sfPopup = new SfPopupLayout(); this.sfPopup.Content = this.sfGrid; //Event Handling this.sfGrid.GridLongPressed += SfGrid_GridLongPressed; //Popup Initializing InitializingPopContent(); //ContextMenu Initializing InitializingContextMenuLayout(); //Adding the poppup view as rootView this.Add(this.sfPopup); }
private void SetUp() { PopUpContents = new DataTemplate(() => { SfTextInputLayout rideCreditsInputLayout = new SfTextInputLayout { Hint = "Amount", FocusedColor = Color.Black, UnfocusedColor = Color.Black, ContainerType = ContainerType.Outlined, OutlineCornerRadius = 8 }; amount = new Entry(); rideCreditsInputLayout.InputView = amount; rideCreditsInputLayout.ErrorText = "Field cant be left blank"; rideCreditsInputLayout.FocusedColor = Color.Black; return(new StackLayout { VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center, Children = { rideCreditsInputLayout } }); }); PopupLayout = new SfPopupLayout(); PopupLayout.PopupView.HeaderTitle = "Puchase Ride Credits"; PopupLayout.PopupView.ContentTemplate = PopUpContents; PopupLayout.PopupView.AnimationMode = AnimationMode.Fade; PopupLayout.PopupView.AppearanceMode = AppearanceMode.TwoButton; PopupLayout.PopupView.HorizontalOptions = LayoutOptions.CenterAndExpand; PopupLayout.PopupView.VerticalOptions = LayoutOptions.Center; PopupLayout.Closed += PopupLayout_Closed; PopupLayout.Opened += PopupLayout_Opened; PopupLayout.PopupView.AcceptCommand = new Command(() => { Purchase_Ride_Credits(); }); RhodesDataBase = new RhodesDataBase(); }
private void sfChat_ImageTapped(object sender, ImageTappedEventArgs e) { popup = new SfPopupLayout(); popup.PopupView.ShowHeader = false; DataTemplate bodyTemplateView = new DataTemplate(() => { var imageView = new Image(); imageView.BackgroundColor = Color.Black; imageView.Source = e.Message.Source; imageView.Margin = new Thickness(0, 20, 0, 20); return(imageView); }); DataTemplate footerTemplateView = new DataTemplate(() => { var backButton = new Button(); backButton.Text = "Go back to chat"; backButton.Clicked += BackButton_Clicked; return(backButton); }); popup.PopupView.ContentTemplate = bodyTemplateView; popup.PopupView.FooterTemplate = footerTemplateView; popup.Show(true); }
// Generation of add new note popup content public SfPopupLayout PopupContent() { SfPopupLayout popup = new SfPopupLayout(); DataTemplate templateView = new DataTemplate(() => { StackLayout popupLayout = new StackLayout { Children = { new Label { Text = "Title", TextColor = Color.Black }, NoteTitleEnt, new Label { Text = "Note", TextColor = Color.Black }, NoteContentEnt, } }; return(popupLayout); }); popup.PopupView.ContentTemplate = templateView; popup.PopupView.AnimationMode = AnimationMode.SlideOnBottom; popup.PopupView.HeaderTitle = "Add new note"; popup.PopupView.AcceptButtonText = "Save"; //Bind Command for saving note (when tapped save btn) popup.PopupView.AcceptCommand = SaveNoteCommand; return(popup); }
public MainPage() { InitializeComponent(); SaveNoteCommand = new Command(SaveNote); addNotePopup = PopupContent(); }
/// <summary> /// Action to be performed when decline button is clicked. /// </summary> /// <param name="popupObject">Popup's object in view</param> private void OnDeclineButtonClicked(SfPopupLayout popupObject) { if (popupObject != null) { popupObject.Dismiss(); } }
public void Dispose() { northwindEntity = null; popup = null; progress.Dispose(); progress = null; }
private async void DeleteEventMethod(SfPopupLayout obj) { await RunnerServices.DeleteRunner(RunnerToDelete); GetRunners(); }
internal void DisplayInitialPopup() { if (pageExited) { return; } initialPopup = new SfPopupLayout(cont); initialPopup.PopupView.AppearanceMode = AppearanceMode.OneButton; initialPopup.PopupView.ShowFooter = true; initialPopup.PopupView.ShowCloseButton = false; initialPopup.PopupView.HeaderTitle = "Book tickets !"; initialPopup.PopupView.AcceptButtonText = "OK"; initialPopup.PopupView.PopupStyle.HeaderTextSize = 16; initialPopup.StaysOpen = true; TextView messageView = new TextView(this.cont); messageView.Text = "Click on the book button to start booking tickets"; messageView.SetTextColor(Color.Black); messageView.SetBackgroundColor(Color.White); messageView.TextSize = 14; initialPopup.PopupView.ContentView = messageView; initialPopup.PopupView.ContentView.SetPadding((int)(10 * density), (int)(10 * density), (int)(10 * density), (int)(10 * density)); initialPopup.PopupView.PopupStyle.CornerRadius = 3; initialPopup.PopupView.HeightRequest = 180; initialPopup.Show(); }
private void DisplayInitialPopup() { initialPopup = new SfPopupLayout(); initialPopup.PopupView.AppearanceMode = AppearanceMode.OneButton; initialPopup.PopupView.PopupStyle.HeaderBackgroundColor = UIColor.White; initialPopup.PopupView.FooterHeight = initialPopup.PopupView.FooterHeight - 10; initialPopup.PopupView.ShowFooter = true; initialPopup.PopupView.ShowCloseButton = false; initialPopup.PopupView.HeaderTitle = "Book tickets !"; initialPopup.PopupView.AcceptButtonText = "OK"; initialPopup.StaysOpen = true; UILabel messageView = new UILabel(); messageView.Text = "Click on the book button to start booking tickets"; messageView.TextColor = UIColor.Black; messageView.LineBreakMode = UILineBreakMode.WordWrap; messageView.Lines = 5; messageView.TextAlignment = UITextAlignment.Center; messageView.BackgroundColor = UIColor.White; if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { initialPopup.PopupView.PopupStyle.HeaderFontSize = 14; messageView.Font = UIFont.PreferredCaption1; initialPopup.PopupView.Frame = new CGRect(-1, -1, (UIScreen.MainScreen.ApplicationFrame.Width / 10) * 8, 180); } else { initialPopup.PopupView.PopupStyle.HeaderFontSize = 20; messageView.Font = UIFont.PreferredBody; initialPopup.PopupView.Frame = new CGRect(-1, -1, -1, 200); } initialPopup.PopupView.ContentView = messageView; initialPopup.Show(); }
private void DisplayInfoPopup() { infopopup = new SfPopupLayout(); infopopup.IsOpen = false; infopopup.PopupView.AppearanceMode = AppearanceMode.OneButton; infopopup.PopupView.HeaderTitle = (rowData as TicketBookingInfo).TheaterName; infopopup.PopupView.BackgroundColor = UIColor.White; infopopup.PopupView.ShowCloseButton = true; infopopup.PopupView.PopupStyle.HeaderTextColor = UIColor.Black; infopopup.PopupView.PopupStyle.HeaderTextAlignment = UIKit.UITextAlignment.Center; infopopup.PopupView.PopupStyle.HeaderBackgroundColor = UIColor.White; infopopup.PopupView.ShowFooter = false; infopopup.PopupView.FooterHeight = 35; infopopup.PopupView.HeaderHeight = 30; infopopup.StaysOpen = false; infopopup.PopupView.PopupStyle.HeaderFontSize = 16; infopopup.PopupView.ShowHeader = true; infopopup.PopupView.Frame = new CGRect(-1, -1, this.DataColumn.Renderer.DataGrid.Frame.Width - 40, this.DataColumn.Renderer.DataGrid.Frame.Height / 2); if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { infopopup.PopupView.PopupStyle.HeaderFontSize = 14; infopopup.PopupView.Frame = new CGRect(-1, -1, this.DataColumn.Renderer.DataGrid.Frame.Width - 20, this.DataColumn.Renderer.DataGrid.Frame.Height / 1.75); } else { infopopup.PopupView.PopupStyle.HeaderFontSize = 20; infopopup.PopupView.Frame = new CGRect(-1, -1, (this.DataColumn.Renderer.DataGrid.Frame.Width / 10) * 6, this.DataColumn.Renderer.DataGrid.Frame.Height / 3.5); } infopopup.PopupView.ContentView = CreateInfoPopupContent(); infopopup.IsOpen = true; }
private async void LoopView() { System.Drawing.Point point1 = new System.Drawing.Point(0, 0); animationPopup = new SfPopupLayout(); animationPopup.PopupView.AnimationMode = AnimationMode.None; if (LoadImage("Images/Popup_DateSelected.png", new CGRect(10 + 5, 70 + 5, 175, 75))) { await Task.Delay(1800); } animationPopup.Dismiss(); await Task.Delay(300); animationPopup.PopupView.AnimationMode = AnimationMode.SlideOnLeft; if (LoadImage("Images/Popup_TheatrInfo.png", new CGRect(UIScreen.MainScreen.Bounds.Width - 200, 180, 150, 35))) { await Task.Delay(1800); } animationPopup.Dismiss(); await Task.Delay(300); animationPopup.PopupView.AnimationMode = AnimationMode.Zoom; if (LoadImage("Images/Popup_SelectSeats.png", new CGRect(10, 180 + 30, 175, 75))) { await Task.Delay(1800); } animationPopup.Dismiss(); await Task.Delay(200); backgroundView.RemoveFromSuperview(); }
private async void DeleteEventMethod(SfPopupLayout parameter) { await EventServices.DeleteEvent(EventToDelete); GetEvents(); }
protected override void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.View> e) { base.OnElementChanged(e); editText = new EditText(this.Context); editText.Touch += OnEditTextTouch; popupLayout = new SfPopupLayout(this.Context); EditText popupContentView = new EditText(this.Context) { Hint = "Please enter the contact number" }; popupContentView.SetTextColor(Android.Graphics.Color.Black); popupLayout.PopupView.ContentView = popupContentView; popupLayout.PopupView.ShowHeader = false; popupLayout.PopupView.AcceptButtonText = "Ok"; LinearLayout linearLayout = new LinearLayout(this.Context); linearLayout.Orientation = Orientation.Vertical; linearLayout.Enabled = false; linearLayout.AddView(popupLayout); linearLayout.AddView(editText); this.SetNativeControl(linearLayout); }
private void DisplayInfoPopup(View bodyView, string headerText) { bodyView.SetPadding(10, 0, 10, 0); infoPopup = new SfPopupLayout(context); infoPopup.PopupView.HeaderTitle = headerText; infoPopup.PopupView.PopupStyle.HeaderTextColor = Color.Black; infoPopup.PopupView.PopupStyle.HeaderTextSize = 18; infoPopup.PopupView.AppearanceMode = AppearanceMode.OneButton; infoPopup.PopupView.PopupStyle.HeaderBackgroundColor = Color.White; infoPopup.PopupView.ShowHeader = true; infoPopup.PopupView.ShowCloseButton = true; infoPopup.StaysOpen = false; infoPopup.PopupView.ShowFooter = false; if (MainActivity.IsTablet) { infoPopup.PopupView.WidthRequest = 450; } else { infoPopup.PopupView.WidthRequest = 300; } infoPopup.PopupView.HeightRequest = 250; infoPopup.PopupView.ContentView = bodyView; infoPopup.PopupView.PopupStyle.BorderThickness = 1; infoPopup.IsOpen = true; }
private void InitializePopupLayout() { popupLayout = new SfPopupLayout(); popupLayout.PopupView.HeightRequest = 70; popupLayout.PopupView.WidthRequest = 100; popupLayout.PopupView.ContentTemplate = new DataTemplate(() => { var mainStack = new StackLayout() { BackgroundColor = Color.FromHex("#a6a9b6"), Spacing = 1 }; var deletedButton = new Button() { Text = "Delete", HeightRequest = 35, BackgroundColor = Color.FromHex("#e8e8e8") }; deletedButton.Clicked += DeletedButton_Clicked; var editButton = new Button() { Text = "Edit", HeightRequest = 35, BackgroundColor = Color.FromHex("#e8e8e8") }; editButton.Clicked += EditButton_Clicked; mainStack.Children.Add(deletedButton); mainStack.Children.Add(editButton); return(mainStack); }); popupLayout.PopupView.ShowHeader = false; popupLayout.PopupView.ShowFooter = false; }
public IncrementalLoadingViewModel(Context context) { progress = new SfLinearProgressBar(context); popup = new SfPopupLayout(context); string uri = "http://services.odata.org/Northwind/Northwind.svc/"; if (CheckConnection(uri).Result) { popup.PopupView.ContentView = progress; popup.PopupView.HeaderTitle = "Fetching Data... "; popup.PopupView.ShowCloseButton = false; popup.PopupView.ShowFooter = false; popup.PopupView.HeightRequest = 125; popup.StaysOpen = true; progress.Progress = 100; progress.IsIndeterminate = true; popup.Show(); gridSource = new IncrementalList <Order>(LoadMoreItems) { MaxItemsCount = 1000 }; northwindEntity = new NorthwindEntities(new Uri(uri)); } else { NoNetwork = true; IsBusy = false; } }
public override View GetSampleContent(Context context) { this.context = context; density = context.Resources.DisplayMetrics.Density; viewModel = new ContatsViewModel(); mainPopupLayout = new SfPopupLayout(context); linearLayout = new LinearLayout(context); linearLayout.Orientation = Android.Widget.Orientation.Vertical; mainPopupLayout.Content = linearLayout; listView = new ListView(context); listView.SetPadding((int)(16 * density), (int)(10 * density), (int)(16 * density), 0); listView.DividerHeight = 16; listView.Divider.Alpha = 0; listView.SetBackgroundColor(Color.ParseColor("#F4F4F4")); listView.ItemClick += ListView_ItemClick; listView.Adapter = new CustomPopupAdapter(viewModel, context, mainPopupLayout); Label1 = new TextView(context); Label1.Gravity = GravityFlags.CenterVertical; Label1.Alpha = 221; Label1.SetTextColor(Color.Gray); Label1.SetBackgroundColor(Color.ParseColor("#F4F4F4")); Label1.TextSize = 20; Label1.Text = "Today"; Label1.SetTypeface(Typeface.Default, TypefaceStyle.Bold); Label1.SetPadding((int)(16 * density), 0, 0, 0); linearLayout.AddView(Label1, LinearLayout.LayoutParams.MatchParent, (int)(50 * density)); linearLayout.AddView(listView); return(mainPopupLayout); }
public override Android.Views.View GetSampleContent(Android.Content.Context context) { // Initializing grid with required properties this.sfGrid = new SfDataGrid(context); this.sfGrid.AutoGenerateColumns = true; this.itemViewModel = new ContextMenuModel(); this.sfGrid.ItemsSource = itemViewModel.OrderInfo; this.sfPopupLayout = new SfPopupLayout(context); //Calculation for the image and gridHeight this.displayDensity = (sfPopupLayout.Resources.DisplayMetrics.Density); this.imagesHeight = (int)(initialValue * displayDensity); this.gridHeight = (int)(198.5 * displayDensity) / 5; //Initializing SfPoplayout with required properties this.InitializePopLayout(context); //Initializing the layout to be displayed inside popup this.InitializingContextMenuLayout(context); this.sfGrid.GridLongPressed += SfGrid_GridLongPressed; //RootView is Poplayout so sfgrid view added as child to poppup this.sfPopupLayout.Content = this.sfGrid; return(sfPopupLayout); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. //// Initialize SfCalendar calendar = new SFCalendar(); calendar.MonthChanged += Calendar_MonthChanged; calendar.HeaderHeight = 0; calendar.MonthViewSettings.TodaySelectionBackgroundColor = UIColor.FromRGB(137, 82, 83); //// Initialize SfPopUpLayout popupLayout = new SfPopupLayout(); headerContent = new UILabel(); headerContent.TextAlignment = UITextAlignment.Center; headerContent.BackgroundColor = UIColor.FromRGB(137, 82, 83); headerContent.TextColor = UIColor.White; headerContent.Font = UIFont.FromName("Helvetica-Bold", 16); // Adding Header view of the SfPopupLayout popupLayout.PopupView.HeaderView = headerContent; popupLayout.PopupView.ShowCloseButton = false; // Adding Calendar as ContentView of the SfPopupLayout popupLayout.PopupView.ContentView = calendar; clearButton = new UIButton(); clearButton.SetTitle("Clear", UIControlState.Normal); clearButton.SetTitleColor(UIColor.White, UIControlState.Normal); clearButton.BackgroundColor = UIColor.Gray; clearButton.Frame = new CGRect(100, 10, 80, 30); clearButton.Layer.CornerRadius = 10; clearButton.ClipsToBounds = true; okButton = new UIButton(); okButton.SetTitle("Ok", UIControlState.Normal); okButton.SetTitleColor(UIColor.White, UIControlState.Normal); okButton.BackgroundColor = UIColor.Gray; okButton.Frame = new CGRect(190, 10, 80, 30); okButton.Layer.CornerRadius = 10; okButton.ClipsToBounds = true; clearButton.TouchDown += ClearButton_TouchDown; okButton.TouchDown += OkButton_TouchDown; uIStackView = new UIStackView(); uIStackView.Axis = UILayoutConstraintAxis.Horizontal; uIStackView.UserInteractionEnabled = true; uIStackView.Add(clearButton); uIStackView.Add(okButton); // Adding Footer view of the SfPopupLayout popupLayout.PopupView.FooterView = uIStackView; rootView = new UIView(); rootView = GetContentOfPopup(); this.View.AddSubview(rootView); }
private void MovieList_ViewDetachedFromWindow(object sender, View.ViewDetachedFromWindowEventArgs e) { if (initialPopup != null) { initialPopup.Dispose(); initialPopup = null; } }
/// <summary> /// Action to be performed when accept button is clicked. /// </summary> /// <param name="ticketBookingPopup">Popup to be displayed.</param> private async void OnAcceptButtonClicked(SfPopupLayout ticketBookingPopup) { this.CloseCurrentTermsAndConditionsPopup(); await Task.Delay(200); this.currentTicketBookingPopup = ticketBookingPopup; this.currentTicketBookingPopup.Show(); }
protected override void OnAttachedTo(ContentPage bindable) { page = bindable; popupLayout = bindable.FindByName <SfPopupLayout>("popupLayout"); button = bindable.FindByName <Button>("ShowPopup"); button.Clicked += Button_Clicked; base.OnAttachedTo(bindable); }
/// <summary> /// You can override this method to subscribe to AssociatedObject events and initialize properties. /// </summary> /// <param name="bindAble">SampleView type parameter bindAble</param> protected override void OnAttachedTo(SampleView bindAble) { (bindAble.Resources["NotificationPopUp"] as SfPopupLayout).Show(); this.listview = bindAble.FindByName <SfListView>("listView"); this.listview.ItemTapped += this.ListView_ItemTapped; this.popupLayout = bindAble.FindByName <SfPopupLayout>("popUp"); }
/// <summary> /// You can override this method while View was detached from window /// </summary> /// <param name="bindAble">SampleView type parameter named as bindAble</param> protected override void OnDetachingFrom(SampleView bindAble) { this.datagrid.AutoGeneratingColumn -= this.Datagrid_AutoGeneratingColumn; this.datagrid.GridLoaded -= this.Datagrid_GridLoaded; this.popupLayout.Dispose(); this.popupLayout = null; base.OnDetachingFrom(bindAble); }
public MovieAdapter(Activity context, List <TableItem> items, FrameLayout view, SfPopupLayout pop) : base() { this.context = context; this.items = items; this.mainView = view; this.popup = pop; }
/// <summary> /// You can override this method to subscribe to AssociatedObject events and initialize properties. /// </summary> /// <param name="bindAble">SampleView type parameter named as bindAble</param> protected override void OnAttachedTo(SampleView bindAble) { base.OnAttachedTo(bindAble); this.popupLayout = bindAble.Content.FindByName <SfPopupLayout>("popupLayout"); this.datagrid = bindAble.Content.FindByName <SfDataGrid>("dataGrid"); this.datagrid.GridLoaded += this.Datagrid_GridLoaded; this.datagrid.AutoGeneratingColumn += this.Datagrid_AutoGeneratingColumn; }
private void SfGrid_ViewDetachedFromWindow(object sender, View.ViewDetachedFromWindowEventArgs e) { pageExited = true; sfPopUp.Opened -= SfPopUp_PopupOpened; sfPopUp.Closed -= SfPopUp_PopupClosed; sfPopUp.PopupView.ClearAnimation(); sfPopUp.Dispose(); sfPopUp = null; }
public void OnNavigatedTo(NavigationParameters parameters) { if (App.Current.MainPage != null) { SfPopupLayout popup = new SfPopupLayout(); // Popup will be displayed when navigated to this page. popup.Show(); } }