MainWindow.cs | Drag Object To Scroll In WPF C# | Amit Padhiyar | Saatody
MainWindow.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.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; 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.Navigation; using System.Windows.Shapes; namespace EffectFeatures { public partial class MainWindow : Window { public static UIElement UI = new UIElement(); public MainWindow() { InitializeComponent(); UI = Container; MyRowControl MRC = new MyRowControl(); MRC.HorizontalAlignment = HorizontalAlignment.Center; MRC.VerticalAlignment = VerticalAlignment.Top; MRC.Margin = new Thickness(0, 0, 0, 0); MRC.Width = 1400; MRC.Height = 100; MRC.Background = new SolidColorBrush(Color.FromRgb(240, 240, 240)); Container.Children.Add(MRC); MRC.Initialize(); MyRowTest MRT = new MyRowTest(); MRT.HorizontalAlignment = HorizontalAlignment.Center; MRT.VerticalAlignment = VerticalAlignment.Top; MRT.Margin = new Thickness(0, 100, 0, 0); MRT.Width = 1400; MRT.Height = 700; MRT.Background = new SolidColorBrush(Color.FromRgb(0, 0, 0)); Container.Children.Add(MRT); MRT.Initialize(); } } }
- 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