예제 #1
0
        public void Loaded(ViewLoadedParams parameters)
        {
            // Save a reference to your loaded parameters.
            // You'll need these later when you want to use
            // the supplied workspaces
            vm = parameters.DynamoWindow.DataContext as DynamoViewModel;
            pandamoMenuItem = new MenuItem {
                Header = "Pandamo"
            };

            pandamoMenuItem.Click += (sender, args) =>
            {
                pandamoViewModel = new PandamoWindowViewModel(parameters);
                var window = new PandamoWindow(pandamoViewModel)
                {
                    DataContext = pandamoViewModel,
                    Owner       = parameters.DynamoWindow
                };

                // Show a modeless window.
                window.Show();
            };

            //parameters.AddSeparator(MenuBarType.View, new Separator());
            //parameters.AddMenuItem(MenuBarType.View, pandamoMenuItem);
            parameters.dynamoMenu.Items.Add(pandamoMenuItem);
            pandamoViewModel.StartServer();
        }
예제 #2
0
 private void StartServerButton_Click(object sender, RoutedEventArgs e)
 {
     pandamoVm.StartServer();
 }