mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
28 lines
755 B
C#
28 lines
755 B
C#
using System;
|
|
using System.Reactive.Disposables;
|
|
using Artemis.UI.Shared;
|
|
using Avalonia.ReactiveUI;
|
|
using Avalonia.Threading;
|
|
using FluentAvalonia.UI.Controls;
|
|
using ReactiveUI;
|
|
|
|
namespace Artemis.UI.Screens.Settings;
|
|
|
|
public partial class SettingsView : ReactiveUserControl<SettingsViewModel>
|
|
{
|
|
public SettingsView()
|
|
{
|
|
InitializeComponent();
|
|
this.WhenActivated(d => { ViewModel.WhenAnyValue(vm => vm.Screen).WhereNotNull().Subscribe(Navigate).DisposeWith(d); });
|
|
}
|
|
|
|
private void Navigate(ViewModelBase viewModel)
|
|
{
|
|
TabFrame.NavigateFromObject(viewModel);
|
|
}
|
|
|
|
private void NavigationView_OnBackRequested(object? sender, NavigationViewBackRequestedEventArgs e)
|
|
{
|
|
ViewModel?.GoBack();
|
|
}
|
|
} |