RightEffectRowContainer.cs | Drag Object To Scroll In WPF C# | Amit Padhiyar | Saatody
RightEffectRowContainer.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.Windows.Threading; namespace EffectFeatures { public class RightEffectRowContainer : Grid { public void Initialize() { try { this.Children.Clear(); Repaint(); Resize(); Event(); Refresh(); } catch (Exception e) { } } public void Repaint() { try { LinearGradientBrush gradientBrush = new LinearGradientBrush(Color.FromRgb(100, 0, 0), Color.FromRgb(0, 0, 100), 0); this.Background = gradientBrush; //this.Background = new SolidColorBrush(Color.FromRgb(20, 15, 0)); } catch (Exception e) { } } public void Resize() { try { } catch (Exception e) { } } public void Event() { try { } catch (Exception e) { } } public static double Left = 0.0; public void Refresh() { try { this.LayoutUpdated += (sender, e) => { Resize(); }; DispatcherTimer timer = new DispatcherTimer(); timer.Interval = new TimeSpan(0, 0, 0, 0, 0); timer.IsEnabled = false; timer.Tick += (sender, e) => { Left = this.Margin.Left; }; timer.Start(); } catch (Exception e) { } } } }
- 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