private void ProfileMenuItem_Click(object sender, RoutedEventArgs e) { AppViewModel vm = (AppViewModel)NotifyIcon.DataContext; MenuItem obMenuItem = e.OriginalSource as MenuItem; ProxyProfile p = (ProxyProfile)(obMenuItem.DataContext); vm.ChangeProxy(p); }
private void SwitchToProfile_Click(object sender, RoutedEventArgs e) { ProxyProfile profile = (ProxyProfile)((Button)e.Source).DataContext; _appViewModel.ChangeProxy(profile); }