1 // Copyright (c) Microsoft Corporation. 2 // Licensed under the MIT License. 3 4 using System.ComponentModel; 5 using System.Windows; 6 using System.Windows.Controls; 7 8 namespace Microsoft.PowerShell.Commands.ShowCommandInternal 9 { 10 /// <summary> 11 /// Interaction logic for AllModulesControl.xaml. 12 /// </summary> 13 public partial class AllModulesControl : UserControl 14 { 15 #region Construction and Destructor 16 17 /// <summary> 18 /// Initializes a new instance of the AllModulesControl class. 19 /// </summary> 20 public AllModulesControl() 21 { 22 InitializeComponent(); 23 24 this.Loaded += (obj, args) => 25 { 26 this.ModulesCombo.Focus(); 27 }; 28 } 29 30 #endregion 31 /// <summary> 32 /// Gets current control of the ShowModuleControl. 33 /// </summary> 34 internal ShowModuleControl CurrentShowModuleControl 35 { 36 get { return this.ShowModuleControl; } 37 } 38 39 private void RefreshButton_Click(object sender, System.Windows.RoutedEventArgs e) 40 { 41 AllModulesViewModel viewModel = this.DataContext as AllModulesViewModel; 42 if (viewModel == null) 43 { 44 return; 45 } 46 47 viewModel.OnRefresh(); 48 } 49 } 50 }