ok das mit dem click funzt wie es soll aber es entsteht ein Nebeneffekt den ich nich verstehe :/
ich hab 2 Eventhändler auf meinen Thumb und für sich alleine funtkionieren beide auch ... ABER sobald ich
private void topBarThumb_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) aufrufe funktioniert in
private void onDragDelta(object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e) die wert-zuweisung von den Heightproperties nich mehr ...
hier erstmal der code:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46:
| private void onDragDelta(object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e) { double yadjust1 = TopBar.Height + e.VerticalChange; double yadjust2 = TopBarContainer.Height + e.VerticalChange; topBarDraged = true;
if (yadjust1 >= 10) { TopBar.Height = yadjust1; TopBarContainer.Height = yadjust2; } }
private void topBarThumb_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if (topBarDraged) { topBarDraged = false; } else { if (!topBarClosed) { DoubleAnimation da1 = new DoubleAnimation(0, new Duration(TimeSpan.FromMilliseconds(500))); da1.AccelerationRatio = 1; TopBar.BeginAnimation(WrapPanel.HeightProperty, da1);
DoubleAnimation da2 = new DoubleAnimation(15, new Duration(TimeSpan.FromMilliseconds(500))); da2.AccelerationRatio = 1; TopBarContainer.BeginAnimation(StackPanel.HeightProperty, da2);
topBarClosed = true; } else { DoubleAnimation da = new DoubleAnimation(100, new Duration(TimeSpan.FromMilliseconds(500))); da.AccelerationRatio = 1; TopBar.BeginAnimation(WrapPanel.HeightProperty, da);
DoubleAnimation da2 = new DoubleAnimation(115, new Duration(TimeSpan.FromMilliseconds(500))); da2.AccelerationRatio = 1; TopBarContainer.BeginAnimation(StackPanel.HeightProperty, da2);
topBarClosed = false; } } } |
wenn ich also zumbeispiel 2 mal nur drauf klicke dann geht mein "menü" zu und wieder auf (das funktioniert tadellos), wenn ich dann aber versuche das Thumb zu ziehen passiert folgendes:
Er springt wie gewohn in die onDragDelta methode und fürt alles aus bis auf (oder zumindest nich richtig) Codezeile 10 und 11.
in TopBar.Height steht dann zum Beispiel 115 und in yadjust1 steht 116 ... nach der zuweisung steht in TopBar.Height allerdings immer noch 115 und nicht 116! So als es schreibgeschützt oder so :/ ... und wie gesagt das passier NUR wenn vorher beim MouseDownEvent die animationen statt gefunden haben
hat jemand irgent ne ahnung was das soll? oder überseh ich hier einfach was banales??