/// </summary>
public partial class FooterNormalStatus : Grid
{
- static ContextPopup popup;
private bool isPopupShowing = false;
+ /// <summary>
+ /// A command will be executed if the Pin option is selected
+ /// </summary>
public static readonly BindableProperty PinAppCommandProperty = BindableProperty.Create("PinAppCommand", typeof(Command), typeof(FooterNormalStatus), null);
public ICommand PinAppCommand
{
set { SetValue(PinAppCommandProperty, value); }
}
+ /// <summary>
+ /// A command will be executed if the Delete option is selected
+ /// </summary>
public static readonly BindableProperty DeleteAppCommandProperty = BindableProperty.Create("DeleteAppCommand", typeof(Command), typeof(FooterNormalStatus), null);
public ICommand DeleteAppCommand
{
set { SetValue(DeleteAppCommandProperty, value); }
}
-
/// <summary>
/// A constructor
/// </summary>
public FooterNormalStatus()
{
InitializeComponent();
+ }
- popup = new ContextPopup
+ void OnOptionsClicked(object sender, EventArgs e)
+ {
+ if (isPopupShowing)
+ {
+ return;
+ }
+
+ ContextPopup popup = new ContextPopup
{
IsAutoHidingEnabled = true,
Orientation = ContextPopupOrientation.Vertical,
popup.Items.Add(new ContextPopupItem("DELETE"));
//TODO: need to change the event callback
- popup.SelectedIndexChanged += (s, e) =>
+ popup.SelectedIndexChanged += (s, args) =>
{
var ctxPopup = s as ContextPopup;
DebuggingUtils.Dbg("selected item : " + (ctxPopup.SelectedItem as ContextPopupItem).Label + " (" + ctxPopup.SelectedIndex + ")");
switch (ctxPopup.SelectedIndex)
{
- case 0: //PIN
+ case 0:
+ //PIN
PinAppCommand?.Execute("");
break;
- case 1: //DELETE
+ case 1:
+ //DELETE
DeleteAppCommand?.Execute("");
break;
default:
popup.Dismiss();
};
- popup.Dismissed += (s, e) =>
+ popup.Dismissed += (s, args) =>
{
isPopupShowing = false;
};
- }
-
- void OnOptionsClicked(object sender, EventArgs e)
- {
- if (isPopupShowing)
- {
- return;
- }
popup.Show(sender as View);
isPopupShowing = true;