public DynaThanosWindow() { InitializeComponent(); this.Snap.Visibility = Visibility.Hidden; DynaThanosViewModel.ZoomToFit(); this.Icon = new BitmapImage( new Uri("pack://application:,,,/DynaThanosViewExtension;component/Resources/thanosEmoji.png")); }
private void TimerOnTick(object sender, EventArgs e) { DynaThanosViewModel.RespondToSnap(); DispatcherTimer timer = (DispatcherTimer)sender; timer.Stop(); timer.Tick -= TimerOnTick; Close(); }
public void Loaded(ViewLoadedParams p) { // Save a reference to your loaded parameters. // You'll need these later when you want to use // the supplied workspaces view = p.DynamoWindow as DynamoView; dynaThanosMenuItem = new MenuItem { Header = "DynaThanos" }; dynaThanosMenuItem.Foreground = Brushes.BlueViolet; dynaThanosMenuItem.Icon = new System.Windows.Controls.Image { Source = new BitmapImage(new Uri("pack://application:,,,/DynaThanosViewExtension;component/Resources/thanosEmoji.png")) }; dynaThanosMenuItem.Click += (sender, args) => { var viewModel = new DynaThanosViewModel(p); var window = new DynaThanosWindow { // Set the data context for the main grid in the window. MainGrid = { DataContext = viewModel }, // Set the owner of the window to the Dynamo window. Owner = p.DynamoWindow }; window.Left = window.Owner.Left + 400; window.Top = window.Owner.Top + 200; // Show a modeless window. window.Show(); }; p.AddMenuItem(MenuBarType.Help, dynaThanosMenuItem, 0); //p.dynamoMenu.Items.Add(dynaThanosMenuItem); }