Does anyone know if it is possible to share viewmodels between a WPF and Xamarin Forms app? Below is a snippet of a Xamarin Forms viewmodel. There are some interfaces that are unique to the Forms app such as the IPageDialogService and also the way navigation is handled so it doesn't seem as though we can do this but wanted to check.
using System;
using System.Threading.Tasks;
using Prism.Commands;
using Prism.Mvvm;
using Prism.Navigation;
using Prism.Services;
namespace PrismSample.ViewModels
{
public class MainPageViewModel : BindableBase, IInitialize, IConfirmNavigation,
INavigationAware
{
private INavigationService _navigationService { get; }
private IPageDialogService _dialogs { get; }
public MainPageViewModel(INavigationService navigationService, IPageDialogService
dialogs)
{
_navigationService = navigationService;
_dialogs = dialogs;
NavigateCommand = new DelegateCommand<string>(OnNavigateCommandExecuted);
}
}