[]
        
(Showing Draft Content)

C1.Win.TouchToolKit.C1ZoomCommandProvider.OwnerGcZoom

OwnerGcZoom Property

OwnerGcZoom

Gets the C1Zoom that owns this C1ZoomCommandProvider.

Declaration
[Browsable(false)]
public C1Zoom OwnerGcZoom { get; }
Examples

The following code example shows how to use this property.

This code example is part of a larger example provided for the C1ZoomCommandProvider class.

public class MyUserControl : UserControl
{
	private GcZoomCommandProvider commands = new GcZoomCommandProvider();
	private Button _zoomInButton;
	private Button _zoomOutButton;
	private Button _getButton;

	public MyUserControl()
	{
		InitializeComponent();

		commands.Target = this;
		commands.SetZoomCommands(_zoomInButton, ZoomCommands.ZoomIn);
		Console.WriteLine(commands.GetZoomCommands(_zoomInButton).ToString());

		commands.SetZoomCommands(_zoomOutButton, ZoomCommands.ZoomOut);
		Console.WriteLine(commands.GetZoomCommands(_zoomOutButton).ToString());

		_getButton.Click += _getButton_Click;
	}

	void _getButton_Click(object sender, EventArgs e)
	{
		Console.WriteLine(commands.OwnerGcZoom.ToString());
	}

	private void InitializeComponent()
	{
		_zoomInButton = new Button();
		_zoomInButton.Text = "+";
		_zoomInButton.Size = new Size(40, 40);
		_zoomInButton.Location = new Point(10, 10);

		_zoomOutButton = new Button();
		_zoomOutButton.Text = "_";
		_zoomOutButton.Size = new Size(40, 40);
		_zoomOutButton.Location = new Point(60, 10);

		_getButton = new Button();
		_getButton.Text = "Get";
		_getButton.Size = new Size(40, 40);
		_getButton.Location = new Point(110, 10);

		this.Controls.Add(_zoomInButton);
		this.Controls.Add(_zoomOutButton);
		this.Controls.Add(_getButton);
	}
}
Public Class MyUserControl
	Inherits UserControl
	Private commands As New GcZoomCommandProvider()
	Private _zoomInButton As Button
	Private _zoomOutButton As Button
	Private _getButton As Button

	Public Sub New()
 		InitializeComponent()

		commands.Target = Me
		commands.SetZoomCommands(_zoomInButton, ZoomCommands.ZoomIn)
		Console.WriteLine(commands.GetZoomCommands(_zoomInButton).ToString())

		commands.SetZoomCommands(_zoomOutButton, ZoomCommands.ZoomOut)
		Console.WriteLine(commands.GetZoomCommands(_zoomOutButton).ToString())

		AddHandler _getButton.Click, AddressOf _getButton_Click
	End Sub

	Private Sub _getButton_Click(sender As Object, e As EventArgs)
		Console.WriteLine(commands.OwnerGcZoom.ToString())
	End Sub

	Private Sub InitializeComponent()
 		_zoomInButton = New Button()
 		_zoomInButton.Text = "+"
 		_zoomInButton.Size = New Size(40, 40)
 		_zoomInButton.Location = New Point(10, 10)

 		_zoomOutButton = New Button()
 		_zoomOutButton.Text = "_"
 		_zoomOutButton.Size = New Size(40, 40)
 		_zoomOutButton.Location = New Point(60, 10)

 		_getButton = New Button()
 		_getButton.Text = "Get"
 		_getButton.Size = New Size(40, 40)
 		_getButton.Location = New Point(110, 10)

 		Me.Controls.Add(_zoomInButton)
 		Me.Controls.Add(_zoomOutButton)
 		Me.Controls.Add(_getButton)
	End Sub
End Class