/
EugenyCh7
/
AvaloniaRoutingExample
Обзор
Документация
Войти
/
EugenyCh7
/
AvaloniaRoutingExample
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
RoutingExample/AppViewLocator.cs
15 строк
426 B
Eugeny Chekmarev
Реализована маршрутизация
23 янв 2025, 18:13
23 янв 2025, 18:13
bfdb449
Код
Авторство
О чём код?
using ReactiveUI; using RoutingExample.ViewModels; using System; namespace RoutingExample { public class AppViewLocator : IViewLocator { public IViewFor ResolveView<T>(T viewModel, string contract = null) => viewModel switch { FirstViewModel context => new FirstView { DataContext = context }, _ => throw new ArgumentOutOfRangeException(nameof(viewModel)) }; } }