Class ContextMenuControl
Inheritance
Implements
Namespace: pdftron.PDF.Tools.Controls
Assembly: pdftron.PDF.Tools.dll
Syntax
public sealed class ContextMenuControl : UserControl, IDependencyObject, IDependencyObject2, IUIElement, IUIElement2, IUIElement3, IUIElement4, IUIElement5, IUIElement7, IUIElement8, IUIElement9, IUIElement10, IUIElementOverrides, IUIElementOverrides7, IUIElementOverrides8, IUIElementOverrides9, IAnimationObject, IVisualElement, IFrameworkElement, IFrameworkElement2, IFrameworkElement3, IFrameworkElement4, IFrameworkElement6, IFrameworkElement7, IFrameworkElementProtected7, IFrameworkElementOverrides, IFrameworkElementOverrides2, IControl, IControl2, IControl3, IControl4, IControl5, IControl7, IControlProtected, IControlOverrides, IControlOverrides6, IUserControl, IDisposable
Constructors
ContextMenuControl(PDFViewCtrl)
Creates a new ContextMenuControl with preset buttons
Declaration
public ContextMenuControl(PDFViewCtrl ctrl)
Parameters
Type | Name | Description |
---|---|---|
pdftron.PDF.PDFViewCtrl | ctrl |
ContextMenuControl(PDFViewCtrl, Dictionary<String, String>)
Creates a new ContextMenuControl with user defined buttons
Declaration
public ContextMenuControl(PDFViewCtrl ctrl, Dictionary<string, string> buttonDictionary)
Parameters
Type | Name | Description |
---|---|---|
pdftron.PDF.PDFViewCtrl | ctrl | |
Dictionary<System.String, System.String> | buttonDictionary | Keys are used for the Button's Content(converted to an icon), and Tag to handle events Values are used for tooltips |
Properties
ButtonCollection
Button collection
Declaration
public ObservableCollection<Button> ButtonCollection { get; }
Property Value
Type | Description |
---|---|
ObservableCollection<Windows.UI.Xaml.Controls.Button> |
HorizontalOffset
Horizontal position
Declaration
public double HorizontalOffset { get; }
Property Value
Type | Description |
---|---|
System.Double |
IsOpen
Visibilty of the ContextMenuControl
Declaration
public bool IsOpen { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
MaxButtonsPerRow
Maximum amount of buttons allowed per row from the ButtonCollection
Declaration
public int MaxButtonsPerRow { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
OverflowCollection
Overflow item collection
Declaration
public ObservableCollection<MenuFlyoutItem> OverflowCollection { get; }
Property Value
Type | Description |
---|---|
ObservableCollection<Windows.UI.Xaml.Controls.MenuFlyoutItem> |
OverflowContainerRow
Position of the OverflowCollection, above or below the ButtonCollection
Declaration
public int OverflowContainerRow { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
ShowOverflow
Visibilty of overflow menu
Declaration
public bool ShowOverflow { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
VerticalOffset
Vertical position (top of application window to top of control)
Declaration
public double VerticalOffset { get; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
AddButtonToCollection(Button)
Add a single Button to the ObservableCollection based on a button dictionary
Declaration
public void AddButtonToCollection(Button button)
Parameters
Type | Name | Description |
---|---|---|
Windows.UI.Xaml.Controls.Button | button | The button to be added to the collection |
AddItemToOverflowCollection(MenuFlyoutItem)
Adds a pre-made MenuFlyoutItem to an ObservableCollection.
Declaration
public void AddItemToOverflowCollection(MenuFlyoutItem flyoutItem)
Parameters
Type | Name | Description |
---|---|---|
Windows.UI.Xaml.Controls.MenuFlyoutItem | flyoutItem |
ClearButtonCollection()
Clears the Button collection.
Declaration
public void ClearButtonCollection()
ClearOverflowCollection()
Clears the overflow collection.
Declaration
public void ClearOverflowCollection()
CreateButtonsFromDictionary(Dictionary<String, String>)
Add buttons to the observable collection based on a button dictionary.
Declaration
public void CreateButtonsFromDictionary(Dictionary<string, string> buttonDictionary)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<System.String, System.String> | buttonDictionary | Keys will be used for Button Tags and Icons, values will be used for text Content and Tooltips |
CreateOverflowFromDictionary(Dictionary<String, String>)
Creates and Adds multiple MenuFlyOutItems to an ObservableCollection.
Declaration
public void CreateOverflowFromDictionary(Dictionary<string, string> overflowDictionary)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<System.String, System.String> | overflowDictionary | Keys are used for tags, Values are used for Text |
Dispose()
Declaration
public void Dispose()
Hide(Boolean)
Hides the ContextMenuControl
Declaration
public void Hide(bool shouldDispose = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | shouldDispose |
InitBaseTools()
Initializes a base set tools.
Declaration
public void InitBaseTools()
Show()
Show the ContextMenuControl as long the TargetSquare
or TargetPoint
has been set
Declaration
public void Show()
Remarks
A base set of tools will be initialized if the ButtonCollection is empty
Show(Point)
Shows the ContextMenuControl
Declaration
public void Show(Point point)
Parameters
Type | Name | Description |
---|---|---|
Windows.Foundation.Point | point |
Remarks
A base set of tools will be initialized if the ButtonCollection is empty
TargetPoint(Point)
Provide a point in screen space that the menu should be attached to.
Declaration
public void TargetPoint(Point pt)
Parameters
Type | Name | Description |
---|---|---|
Windows.Foundation.Point | pt |
TargetSquare(Double, Double, Double, Double)
Gives a target rectangle as 4 points in PDFViewCtrl space
Declaration
public void TargetSquare(double x1, double y1, double x2, double y2)
Parameters
Type | Name | Description |
---|---|---|
System.Double | x1 | |
System.Double | y1 | |
System.Double | x2 | |
System.Double | y2 |
Events
ItemClicked
Declaration
public event ContextMenuControlViewModel.ItemClickedDelegate ItemClicked
Event Type
Type | Description |
---|---|
ContextMenuControlViewModel.ItemClickedDelegate |