MyRowTest.cs | Drag Object To Scroll In WPF C# | Amit Padhiyar | Saatody
MyRowTest.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; using System.Windows.Threading; namespace EffectFeatures { public class MyRowTest : Grid { public static RightEffectControl REC = new RightEffectControl(); public void Initialize() { try { this.Children.Clear(); Repaint(); Resize(); Event(); Refresh(); this.Children.Add(REC.RERC); REC.RERC.Initialize(); } catch (Exception e) { } } public void Repaint() { try { } catch (Exception e) { } } private static bool one = false; public void Resize() { try { if (one == false) { REC.RERC.Margin = new Thickness(-8600, 0, 0, 0); REC.RERC.Width = 10000; REC.RERC.Resize(); one = true; } } catch (Exception e) { } } public void Event() { try { } catch (Exception e) { } } public void Refresh() { try { this.LayoutUpdated += (sender, e) => { Resize(); }; DispatcherTimer timer = new DispatcherTimer(); timer.Interval = new TimeSpan(0, 0, 0, 0, 1); timer.IsEnabled = false; timer.Tick += (sender, e) => { Resize(); }; timer.Start(); } catch (Exception e) { } } public static void Go(double x) { REC.RERC.Margin = new Thickness(x, 0, 0, 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