1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00
Artemis/src/Artemis.UI/Screens/Settings/SettingsView.axaml.cs
RobertBeekman 962b13c6ed
UI - Added routing (#802)
ColorGradient - Fixed GetColor returning the first stop if position was after the last stop
2023-07-02 22:15:38 +02:00

24 lines
776 B
C#

using System;
using System.Reactive.Disposables;
using Artemis.UI.Shared;
using Avalonia.ReactiveUI;
using Avalonia.Threading;
using FluentAvalonia.UI.Media.Animation;
using FluentAvalonia.UI.Navigation;
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)
{
Dispatcher.UIThread.Invoke(() => TabFrame.NavigateFromObject(viewModel, new FrameNavigationOptions {TransitionInfoOverride = new SlideNavigationTransitionInfo()}));
}
}