c# - How DragMove works? (Which properties it changes?) -
i making simple window in wpf (like overwolf), in overwolf there circle in top-left of screen , when drag it, moving corner simple animation. tried make same effect using doubleanimation on leftproperty works once (the first time drag working, the second stay dragged it).
my xaml:
<window x:class="overwoof.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" name="main" width="200" height="200" allowstransparency="true" windowstyle='none' ishittestvisible="true" topmost="true" background="transparent" mouseleftbuttonup="ondragleave" windowstartuplocation="manual"> <grid ishittestvisible="true" name="maingrid" minheight="200" minwidth="200"> <ellipse mouseleftbuttondown="dragstart" name="logo" width="100" height="100" fill="red" opacity="0.5" margin="12,24,66,37" ismanipulationenabled="true" /> </grid>
my c# code:
private void dragstart(object sender, mouseeventargs e) { main.dragmove(); } private void ondragleave(object sender, mouseeventargs e) { doubleanimation da = new doubleanimation(); da.from = main.left; da.to = -20; da.duration = new duration(timespan.fromseconds(0.2)); da.completed += new eventhandler(animationcompleted); main.beginanimation(window.leftproperty, da); }
thx, bbln.
change da.to = -20;
toda.to -= 20;
Comments
Post a Comment