Created
March 29, 2011 23:18
-
-
Save vquaiato/893551 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void dashboard_MouseRightButtonDown(object sender, MouseButtonEventArgs e) | |
| { | |
| if (toolBox.PossuiComponenteSelecionado) | |
| { | |
| var position = e.GetPosition(this.dashboard); | |
| var selecionado = toolBox.ComponenteSelecionado; | |
| var template = this.FindResource("templateControlesDashboard") as ControlTemplate; | |
| var newComponente = new Thumb(); | |
| newComponente.Template = template; | |
| newComponente.ApplyTemplate(); | |
| var texto = newComponente.Template.FindName("textoComponente", newComponente) as TextBlock; | |
| texto.Text = selecionado; | |
| Canvas.SetTop(newComponente, position.Y); | |
| Canvas.SetLeft(newComponente, position.X); | |
| newComponente.DragDelta += thumb_DragDelta; | |
| this.dashboard.Children.Add(newComponente); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment