I am building a borderless application. What i need to achieve is to move the window by simply click and drag on an image it contains but i also want to do something when clicked.
Just a button, i have functionality for left and right clicks but can't figure how to implement drag now.
This is what my code looks like
private void btnHome_MouseDown(object sender, MouseButtonEventArgs e)
{
if(e.LeftButton == MouseButtonState.Released)
{
toggle();
}
else if(e.LeftButton == MouseButtonState.Pressed)
{
DragMove();
}
}
Right now only drag works, If i rearrange their occurrence then only left click would work. Right click functionality is working as expected right now.