Dear Guys, I have used the below code for the hit test. It always showing no suitable method found to override error on "protected override void OnInitialized(EventArgs e) Code is below
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace InputExamples2
{
public partial class MousePosition
{
public MousePosition()
{
this.InitializeComponent();
// Insert code required on object creation below this point.
}
protected override void OnInitialized(EventArgs e)
{
base.OnInitialized(e);
DragEllipse.RenderTransform = ellipseTransform;
CompositionTarget.Rendering += this.CompositionTarget\_Rendering;
}
private void CompositionTarget\_Rendering(object sender, EventArgs e)
{
Point mouse1 = Mouse.GetPosition(firstEllipse);
Point mouse2 = Mouse.GetPosition(secondEllipse);
Point mouse3 = Mouse.GetPosition(thirdEllipse);
Point mouse4 = Mouse.GetPosition(fourthEllipse);
firstCoordinates.Content = mouse1.ToString();
secondCoordinates.Content = mouse2.ToString();
thirdCoordinates.Content = mouse3.ToString();
fourthCoordinates.Content = mouse4.ToString();
Point position = Mouse.GetPosition(DragEllipse);
ellipseTransform.X += position.X - (DragEllipse.Width / 2);
ellipseTransform.Y += position.Y - (DragEllipse.Height / 2);
}
}
}
Please help me to resolve this error
Ahamed Azeem software Programmer