Пример #1
0
        private static void FindAndLaunchByHash(MainWindowViewModel viewModel, string hash)
        {
            ApplicationLink applicationLink = viewModel.ApplicationLinks.FirstOrDefault(i => i.GetHashCode().ToString(CultureInfo.InvariantCulture) == hash);
            if (applicationLink == null)
            {
                return;
            }

            viewModel.SelectedLink = applicationLink;
            viewModel.Connect.Execute(null);
        }
Пример #2
0
        public MainWindow()
        {
            InitializeComponent();

            ViewModel = new MainWindowViewModel();
                        DataContext = ViewModel;
            ApplicationListBox.Events().MouseDoubleClick
                .InvokeCommand(this, v => v.ViewModel.Connect);
            ApplicationListBox.Events().KeyUp.Where(i => i.Key == Key.Enter)
                .InvokeCommand(this, v => v.ViewModel.Connect);
        }