Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions maui/samples/Gallery/ControlList.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<Assembly Name="NumericEntry" />
<Assembly Name="NumericUpDown" />
<Assembly Name="Calendar" />
<Assembly Name="Popup"/>
<Assembly Name="Cards" />
</Assemblies>
</SampleBrowser>
Binary file added maui/samples/Gallery/Resources/Images/popup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions maui/samples/Gallery/SampleList/PopupSamplesList.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<SyncfusionControls>
<ControlCategory Name="Layouts">
<Control Title="Popup" ControlName="SfPopup" Image="popup.png" Description="Enables custom alert messages or loading specific views in a popup.">
<Sample SearchTags="popup, pop, up, alert, dialogue, toast" SampleName="GettingStarted" Title="Getting Started" />
</Control>
</ControlCategory>
</SyncfusionControls>
828 changes: 828 additions & 0 deletions maui/samples/Gallery/Samples/Popup/GettingStarted/GettingStarted.xaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Syncfusion.Maui.ControlsGallery.Popup.SfPopup
{
public partial class GettingStarted : SampleView
{
public GettingStarted()
{
InitializeComponent();
}
}
}
71 changes: 71 additions & 0 deletions maui/samples/Gallery/Samples/Popup/Helper/Behavior.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
using Syncfusion.Maui.ControlsGallery;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace Syncfusion.Maui.ControlsGallery.Popup.SfPopup
{
public class SampleViewBehavior : Behavior<SampleView>
{
#region Private Fields

Syncfusion.Maui.Toolkit.Popup.SfPopup? _actionSheetPopup;

#endregion

#region Methods

internal static Size GetScaledScreenSize(DisplayInfo info)
{
return new Size(info.Width / info.Density, info.Height / info.Density);
}
protected override void OnAttachedTo(SampleView sampleView)
{
_actionSheetPopup = sampleView.Resources["Actionsheet"] as Syncfusion.Maui.Toolkit.Popup.SfPopup;

sampleView.SizeChanged += SampleView_SizeChanged;

base.OnAttachedTo(sampleView);
}

protected override void OnDetachingFrom(SampleView sampleView)
{
// Unsubscribe from SizeChanged
sampleView.SizeChanged -= SampleView_SizeChanged;
_actionSheetPopup = null;
}

void SampleView_SizeChanged(object? sender, EventArgs e)
{
if (sender is SampleView sampleView)
{
var displayInfo = DeviceDisplay.Current.MainDisplayInfo;
var screenWidth = GetScaledScreenSize(displayInfo).Width;
var screenHeight = GetScaledScreenSize(displayInfo).Height;

#if ANDROID || IOS
if (DeviceDisplay.Current.MainDisplayInfo.Orientation == DisplayOrientation.Portrait)
{
_actionSheetPopup!.WidthRequest = screenWidth;
}
else
{
_actionSheetPopup!.WidthRequest = 360;
}

_actionSheetPopup!.StartY = (int)(screenHeight - _actionSheetPopup!.HeightRequest);
#else
_actionSheetPopup!.WidthRequest = 360;
#endif
#if IOS || MACCATALYST
_actionSheetPopup.Refresh();
#endif
}
}
}

#endregion
}
45 changes: 45 additions & 0 deletions maui/samples/Gallery/Samples/Popup/Helper/SfEffectsViewAdv.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using Syncfusion.Maui.Toolkit.EffectsView;
using Syncfusion.Maui.Toolkit.Internals;
using PointerEventArgs = Syncfusion.Maui.Toolkit.Internals.PointerEventArgs;

namespace Syncfusion.Maui.ControlsGallery.Popup.SfPopup
{
internal class SfEffectsViewAdv : SfEffectsView, ITouchListener
{

#region Constructor

public SfEffectsViewAdv()
{

}

#endregion

#region Methods
public new void OnTouch(PointerEventArgs e)
{
#if ANDROID
{
return;
}
#else

if (e.Action == PointerActions.Entered)
{
ApplyEffects(SfEffects.Highlight, RippleStartPosition.Default, new System.Drawing.Point((int)e.TouchPoint.X, (int)e.TouchPoint.Y), false);
}
else if (e.Action == PointerActions.Pressed)
{
ApplyEffects(SfEffects.Ripple, RippleStartPosition.Default, new System.Drawing.Point((int)e.TouchPoint.X, (int)e.TouchPoint.Y), false);
}
else if (e.Action == PointerActions.Released || e.Action == PointerActions.Cancelled || e.Action == PointerActions.Exited)
{
Reset();
}
#endif
}

#endregion
}
}
248 changes: 248 additions & 0 deletions maui/samples/Gallery/Samples/Popup/Model/GettingStartedModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Syncfusion.Maui.ControlsGallery.Popup.SfPopup
{
public class SimpleModel : INotifyPropertyChanged
{
#region Fields

string? _userName;
string? _mailId;
string? _image;
bool _isSelected;

#endregion

#region Properties

public string? UserName
{
get { return _userName; }
set
{
if (value is not null)
{
_userName = value;
OnPropertyChanged("UserName");
}
}
}

public string? MailId
{
get { return _mailId; }
set
{
if (value is not null)
{
_mailId = value;
OnPropertyChanged("MailId");
}
}
}

public string? Image
{
get { return _image; }
set
{
if (value is not null)
{
_image = value;
OnPropertyChanged("Image");
}
}
}

public bool IsSelected
{
get { return _isSelected; }
set
{
_isSelected = value;
OnPropertyChanged("IsSelected");
}
}

#endregion

#region Constructor

public SimpleModel()
{

}

#endregion

#region Interface Member

public event PropertyChangedEventHandler? PropertyChanged;

public void OnPropertyChanged(string name)
{
if (PropertyChanged is not null)
{
PropertyChanged(this, new PropertyChangedEventArgs(name));
}
}

#endregion
}

public class ConfirmationModel : INotifyPropertyChanged
{
#region Fields

string? _ringtone;
bool _selectedRingtone;

#endregion

#region Properties

public string? Ringtone
{
get { return _ringtone; }
set
{
if (value is not null)
{
_ringtone = value;
OnPropertyChanged("Ringtone");
}
}
}

public bool SelectedRingtone
{
get { return _selectedRingtone; }
set
{
_selectedRingtone = value;
OnPropertyChanged("SelectedRingtone");
}
}

#endregion

#region Constructor

public ConfirmationModel()
{

}
#endregion

#region Interface Member

public event PropertyChangedEventHandler? PropertyChanged;

public void OnPropertyChanged(string name)
{
if (PropertyChanged is not null)
{
PropertyChanged(this, new PropertyChangedEventArgs(name));
}
}

#endregion
}

public class FullScreenModel : INotifyPropertyChanged
{
#region Fields
string? _userName;
string? _email;
string? _password;
string? _rePassword;
#endregion

#region Properties
[Display(Prompt = "Pick your username")]
public string? UserName
{
get { return _userName; }
set
{
if (value is not null)
{
_userName = value;
OnPropertyChanged("UserName");
}
}
}

[Display(Prompt = "Enter your email address")]
public string? Email
{
get { return _email; }
set
{
if (value is not null)
{
_email = value;
OnPropertyChanged("Email");
}
}
}

[Display(Prompt = "Enter your password", Name = "Password")]
[DataType(DataType.Password)]
public string? Password
{
get { return _password; }
set
{
if (value is not null)
{
_password = value;
OnPropertyChanged("Password");
}
}
}

[Display(Prompt = "Re-enter your password", Name = "RePassword")]
[DataType(DataType.Password)]
public string? RePassword
{
get { return _rePassword; }
set
{
if (value is not null)
{
_rePassword = value;
OnPropertyChanged("RePassword");
}
}
}
#endregion

#region Constructor
public FullScreenModel()
{
UserName = string.Empty;
Email = string.Empty;
Password = string.Empty;
RePassword = string.Empty;
}
#endregion

#region Interface Member
public event PropertyChangedEventHandler? PropertyChanged;
public void OnPropertyChanged(string name)
{
if (PropertyChanged is not null)
{
PropertyChanged(this, new PropertyChangedEventArgs(name));
}
}
#endregion
}
}
Loading