using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Avalonia.Controls; using Avalonia.Interactivity; using Avalonia.Markup.Xaml; using Avalonia.Platform.Storage; using Avalonia.ReactiveUI; using data; using data.Repository; using domain.Service; using Microsoft.Extensions.DependencyInjection; using Presence.Desktop.DI; using Presence.Desktop.ViewModels; using ReactiveUI; namespace Presence.Desktop.Views { public partial class GroupView : Window { public GroupView() { InitializeComponent(); } private void SelectingItemsControl_OnSelectionChanged(object? sender, SelectionChangedEventArgs e) { if (DataContext is GroupViewModel viewModel) { viewModel.UpdateSelectionStates(); } } private void SwapToPresences(object? sender, RoutedEventArgs e) { try { var serviceCollection = new ServiceCollection(); serviceCollection.AddPresenceService(); var services = serviceCollection.BuildServiceProvider(); var presenceViewModel = services.GetRequiredService(); var window = new PresenceView { DataContext = presenceViewModel }; window.Show(); } catch (Exception ex) { } } } }