1 using System.ComponentModel;
2 using System.Runtime.CompilerServices;
5 namespace Tizen.Xamarin.Forms.Extension
8 /// The class for the items in a ContextPopup.
9 /// Each item can have a label and an icon.
13 /// new ContextPopupItem("Text only item");
14 /// new ContextPopupItem("Home icon", "home");
15 /// new ContextPopupItem("Car", "car.png");
16 /// new ContextPopupItem("Chat", StandardIconResource.MenuChat.Name);
19 public class ContextPopupItem : INotifyPropertyChanged
22 FileImageSource _icon;
25 /// Creates a ContextPopupItem with only a label.
27 /// <param name="label">The label of the ContextPopupItem.</param>
28 public ContextPopupItem(string label)
34 /// Creates a ContextPopupItem with a label and an icon. The icon may be an image or a standard icon.<br>
35 /// To create a ContextPopupItem with only an icon, set the label to an empty string.<br>
36 /// The available standard icons that can be used are specified in the StandardIconResource class.
37 /// The name property of the StandardIconResource class can be used to specify a standard icon.
39 /// <param name="label">The label of the ContextPopupItem.</param>
40 /// <param name="icon">The icon of the ContextPopupItem.</param>
42 /// new ContextPopupItem("Text only item");
43 /// new ContextPopupItem("Home icon", "home");
44 /// new ContextPopupItem("Car", "car.png");
45 /// new ContextPopupItem("Chat", StandardIconResource.MenuChat.Name);
47 public ContextPopupItem(string label, FileImageSource icon)
56 /// Occurs when the label or an icon of a ContextPopupItem is changed.
58 public event PropertyChangedEventHandler PropertyChanged;
61 /// Gets or sets the label of a ContextPopupItem.
80 /// Gets or sets the icon of a ContextPopupItem. The icon may be an image or a standard icon.<br>
81 /// The available standard icons that can be used are specified in the StandardIconResource class.
82 /// The name property of the StandardIconResource class can be used to specify a standard icon.
85 /// Icon is only supported on the mobile profile.
86 /// Icon does not always work as expected on the TV profile.
88 public FileImageSource Icon
105 /// Called when a bindable property has changed.
107 protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
109 PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));