コード例 #1
0
        public async void DirectConnectPressed()
        {
            if (!TryGetWindow(out var window))
            {
                return;
            }

            var res = await new DirectConnectDialog().ShowDialog <string>(window);

            if (res == null)
            {
                return;
            }

            ConnectingViewModel.StartConnect(MainWindowViewModel, res);
        }
コード例 #2
0
ファイル: MainViewModel.cs プロジェクト: Ifry/win-app
        public MainViewModel(
            UserAuth userAuth,
            IVpnManager vpnManager,
            IActiveUrls urls,
            IEventAggregator eventAggregator,
            AppExitHandler appExitHandler,
            IModals modals,
            IDialogs dialogs,
            IPopupWindows popups,
            MapViewModel mapViewModel,
            ConnectingViewModel connectingViewModel,
            OnboardingViewModel onboardingViewModel,
            FlashNotificationViewModel flashNotificationViewModel,
            TrayNotificationViewModel trayNotificationViewModel)
        {
            _eventAggregator = eventAggregator;
            _vpnManager      = vpnManager;
            _urls            = urls;
            _userAuth        = userAuth;
            _appExitHandler  = appExitHandler;
            _modals          = modals;
            _dialogs         = dialogs;
            _popups          = popups;

            Map               = mapViewModel;
            Connection        = connectingViewModel;
            Onboarding        = onboardingViewModel;
            TrayNotification  = trayNotificationViewModel;
            FlashNotification = flashNotificationViewModel;

            eventAggregator.Subscribe(this);

            AboutCommand          = new RelayCommand(AboutAction, CanClick);
            AccountCommand        = new RelayCommand(AccountAction, CanClick);
            ProfilesCommand       = new RelayCommand(ProfilesAction, CanClick);
            SettingsCommand       = new RelayCommand(SettingsAction, CanClick);
            HelpCommand           = new RelayCommand(HelpAction);
            ReportBugCommand      = new RelayCommand(ReportBugAction, CanClick);
            DeveloperToolsCommand = new RelayCommand(DeveloperToolsAction);
            LogoutCommand         = new RelayCommand(LogoutAction);
            ExitCommand           = new RelayCommand(ExitAction);

            SetDeveloperToolsVisibility();
        }
コード例 #3
0
 public void ConnectPressed()
 {
     ConnectingViewModel.StartConnect(_updater, _cfg, (Window)Control?.GetVisualRoot() !, Address);
 }
コード例 #4
0
 public void ConnectPressed()
 {
     ConnectingViewModel.StartConnect(_windowVm, Address);
 }