RightEffectControl.cs | Drag Object To Scroll In WPF C# | Amit Padhiyar | Saatody
RightEffectControl.cs
Drag object using MouseLeftButtonDown, MouseLeftButtonUp and MouseMove. When we drag object using mouse and if object's any part is going outside parent panel then the parent panel margin automatically update and try to in that object.
using System; using System.Windows; using System.Windows.Controls; using System.Windows.Shapes; using System.Windows.Media; using System.Windows.Input; using System.Collections.Generic; namespace EffectFeatures { public class RightEffectControl { public RightEffectRowContainer RERC = new RightEffectRowContainer(); public List<RightEffectRow> RER = new List<RightEffectRow>(); private double Y = 0; private int Counter = 0; public void AddRow() { RightEffectRow _RER = new RightEffectRow(); _RER.HorizontalAlignment = HorizontalAlignment.Left; _RER.VerticalAlignment = VerticalAlignment.Top; _RER.Margin = new Thickness(0, Y, 0, 0); _RER.Width = RERC.ActualWidth; _RER.Height = 70; _RER.Initialize(); _RER.Background = new SolidColorBrush(MyColor.Row[Counter]); RER.Add(_RER); RERC.Children.Add(RER[RER.Count - 1]); Y += 70; Counter++; if(Counter >= 5) { Counter = 0; } } } }
- MainWindow.cs | Drag Object To Scroll In WPF C# | Amit Padhiyar | Saatody
- MyRowControl.cs | Drag Object To Scroll In WPF C# | Amit Padhiyar | Saatody
- MyRowTest.cs | Drag Object To Scroll In WPF C# | Amit Padhiyar | Saatody
- MyColor.cs | Drag Object To Scroll In WPF C# | Amit Padhiyar | Saatody
- RightEffectControl.cs | Drag Object To Scroll In WPF C# | Amit Padhiyar | Saatody
- RightEffectRowContainer.cs | Drag Object To Scroll In WPF C# | Amit Padhiyar | Saatody
- RightEffectRow.cs | Drag Object To Scroll In WPF C# | Amit Padhiyar | Saatody
- RightEffect.cs | Drag Object To Scroll In WPF C# | Amit Padhiyar | Saatody
Comments
Post a Comment