├── Sample-Outlookish.png ├── Sample-Outlookish-Annotated.png ├── source ├── SampleApp.Main │ ├── Assets │ │ └── avalonia-logo.ico │ ├── Modules │ │ └── SampleFooter │ │ │ ├── ViewModel │ │ │ └── SampleFooterViewModel.cs │ │ │ ├── Views │ │ │ ├── SampleFooterView.axaml.cs │ │ │ └── SampleFooterView.axaml │ │ │ └── SampleFooterModule.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Services │ │ ├── INotificationService.cs │ │ └── NotificationService.cs │ ├── ViewModels │ │ ├── SettingsViewModel.cs │ │ ├── MessageBoxViewModel.cs │ │ ├── DashboardViewModel.cs │ │ └── MainWindowViewModel.cs │ ├── Models │ │ └── MenuItem.cs │ ├── Views │ │ ├── MessageBoxView.axaml.cs │ │ ├── DashboardView.axaml.cs │ │ ├── SettingsView.axaml.cs │ │ ├── SettingsView.axaml │ │ ├── DashboardView.axaml │ │ ├── MainWindow.axaml.cs │ │ ├── MainWindow.axaml │ │ └── MessageBoxView.axaml │ ├── App.axaml │ ├── Program.cs │ ├── Core │ │ └── RegionAdapters │ │ │ ├── GridRegionAdapter.cs │ │ │ └── StackPanelRegionAdapter.cs │ ├── SampleApp.csproj │ ├── Helpers │ │ └── NotificationHelpers.cs │ └── App.axaml.cs ├── SampleApp.Modules.Mail │ ├── Assets │ │ └── avalonia-logo.ico │ ├── Views │ │ ├── MailView.axaml.cs │ │ ├── MailOtherView.axaml.cs │ │ ├── MailFocusedView.axaml.cs │ │ ├── MailOtherView.axaml │ │ ├── MailFocusedView.axaml │ │ └── MailView.axaml │ ├── ViewModels │ │ ├── MailOtherViewModel.cs │ │ ├── MailViewModel.cs │ │ └── MailFocusedViewModel.cs │ ├── SampleApp.Modules.Mail.csproj │ └── MailModule.cs ├── SampleApp.Modules.Calendar │ ├── Assets │ │ └── avalonia-logo.ico │ ├── ViewModels │ │ └── CalendarViewModel.cs │ ├── Views │ │ ├── CalendarView.axaml.cs │ │ └── CalendarView.axaml │ ├── CalendarModule.cs │ └── SampleApp.Modules.Calendar.csproj ├── SampleApp.Modules.Contacts │ ├── Assets │ │ └── avalonia-logo.ico │ ├── ViewModels │ │ └── ContactsViewModel.cs │ ├── Views │ │ ├── ContactsView.axaml.cs │ │ └── ContactsView.axaml │ ├── ContactsModule.cs │ └── SampleApp.Modules.Contacts.csproj ├── SampleApp.Modules.Message │ ├── Assets │ │ └── avalonia-logo.ico │ ├── ViewModels │ │ └── MessageViewModel.cs │ ├── Views │ │ ├── MessageView.axaml.cs │ │ └── MessageView.axaml │ ├── MessageModule.cs │ └── SampleApp.Modules.Message.csproj └── SampleApp.Common │ ├── SampleApp.Common.csproj │ ├── RegionNames.cs │ ├── Models │ └── Mail.cs │ ├── ViewModelBase.cs │ └── TabControlAdapter.cs ├── SampleApp.Services ├── IMailService.cs ├── SampleApp.Services.csproj └── MailService.cs ├── license ├── .gitignore ├── Settings.XamlStyler ├── CodeMaid.config ├── Outlookish.sln ├── readme.md └── .editorconfig /Sample-Outlookish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DamianSuess/Learn.PrismAvaloniaOutlookish/HEAD/Sample-Outlookish.png -------------------------------------------------------------------------------- /Sample-Outlookish-Annotated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DamianSuess/Learn.PrismAvaloniaOutlookish/HEAD/Sample-Outlookish-Annotated.png -------------------------------------------------------------------------------- /source/SampleApp.Main/Assets/avalonia-logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DamianSuess/Learn.PrismAvaloniaOutlookish/HEAD/source/SampleApp.Main/Assets/avalonia-logo.ico -------------------------------------------------------------------------------- /source/SampleApp.Modules.Mail/Assets/avalonia-logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DamianSuess/Learn.PrismAvaloniaOutlookish/HEAD/source/SampleApp.Modules.Mail/Assets/avalonia-logo.ico -------------------------------------------------------------------------------- /source/SampleApp.Modules.Calendar/Assets/avalonia-logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DamianSuess/Learn.PrismAvaloniaOutlookish/HEAD/source/SampleApp.Modules.Calendar/Assets/avalonia-logo.ico -------------------------------------------------------------------------------- /source/SampleApp.Modules.Contacts/Assets/avalonia-logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DamianSuess/Learn.PrismAvaloniaOutlookish/HEAD/source/SampleApp.Modules.Contacts/Assets/avalonia-logo.ico -------------------------------------------------------------------------------- /source/SampleApp.Modules.Message/Assets/avalonia-logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DamianSuess/Learn.PrismAvaloniaOutlookish/HEAD/source/SampleApp.Modules.Message/Assets/avalonia-logo.ico -------------------------------------------------------------------------------- /source/SampleApp.Modules.Contacts/ViewModels/ContactsViewModel.cs: -------------------------------------------------------------------------------- 1 | using SampleApp.Common; 2 | 3 | namespace SampleApp.Modules.Contacts.ViewModels 4 | { 5 | public class ContactsViewModel : ViewModelBase 6 | { 7 | public string Greeting => "Fake Contacts!"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /source/SampleApp.Modules.Message/ViewModels/MessageViewModel.cs: -------------------------------------------------------------------------------- 1 | using SampleApp.Common; 2 | 3 | namespace SampleApp.Modules.Message.ViewModels 4 | { 5 | public class MessageViewModel : ViewModelBase 6 | { 7 | public string Greeting => "Messages ViewModel!"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /source/SampleApp.Modules.Calendar/ViewModels/CalendarViewModel.cs: -------------------------------------------------------------------------------- 1 | using SampleApp.Common; 2 | 3 | namespace SampleApp.Modules.Calendar.ViewModels 4 | { 5 | public class CalendarViewModel : ViewModelBase 6 | { 7 | public string Greeting => "Welcome to Avalonia!"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /SampleApp.Services/IMailService.cs: -------------------------------------------------------------------------------- 1 | using SampleApp.Common.Models; 2 | 3 | namespace SampleApp.Services; 4 | 5 | public interface IMailService 6 | { 7 | IEnumerable Messages { get; set; } 8 | 9 | void GetMessages(int messageId); 10 | 11 | void Send(MailMessage message); 12 | } 13 | -------------------------------------------------------------------------------- /source/SampleApp.Main/Modules/SampleFooter/ViewModel/SampleFooterViewModel.cs: -------------------------------------------------------------------------------- 1 | using SampleApp.Common; 2 | 3 | namespace SampleApp.Modules.SampleFooter.ViewModels 4 | { 5 | public class SampleFooterViewModel : ViewModelBase 6 | { 7 | public string Message => "Hello footer"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /source/SampleApp.Main/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "SampleApp": { 4 | "commandName": "Project" 5 | }, 6 | "WSL": { 7 | "commandName": "Project", 8 | "environmentVariables": { 9 | "DISPLAY": ":0" 10 | }, 11 | "distributionName": "" 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /source/SampleApp.Main/Services/INotificationService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Avalonia.Controls; 3 | 4 | namespace SampleApp.Services; 5 | 6 | public interface INotificationService 7 | { 8 | int NotificationTimeout { get; set; } 9 | 10 | void SetHostWindow(Window window); 11 | 12 | void Show(string title, string message, Action? onClick = null); 13 | } 14 | -------------------------------------------------------------------------------- /source/SampleApp.Modules.Mail/Views/MailView.axaml.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Controls; 2 | using Avalonia.Markup.Xaml; 3 | 4 | namespace SampleApp.Modules.Mail.Views; 5 | 6 | public partial class MailView : UserControl 7 | { 8 | public MailView() 9 | { 10 | InitializeComponent(); 11 | } 12 | 13 | private void InitializeComponent() 14 | { 15 | AvaloniaXamlLoader.Load(this); 16 | } 17 | } -------------------------------------------------------------------------------- /source/SampleApp.Modules.Mail/ViewModels/MailOtherViewModel.cs: -------------------------------------------------------------------------------- 1 | using SampleApp.Common; 2 | using SampleApp.Services; 3 | 4 | namespace SampleApp.Modules.Mail.ViewModels; 5 | 6 | public class MailOtherViewModel : ViewModelBase 7 | { 8 | private IMailService _mailService; 9 | 10 | public MailOtherViewModel(IMailService mailService) 11 | { 12 | _mailService = mailService; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SampleApp.Services/SampleApp.Services.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /source/SampleApp.Main/ViewModels/SettingsViewModel.cs: -------------------------------------------------------------------------------- 1 | using Prism.Regions; 2 | using SampleApp.Common; 3 | 4 | namespace SampleApp.ViewModels; 5 | 6 | public class SettingsViewModel : ViewModelBase 7 | { 8 | private IRegionManager _regionManager; 9 | 10 | public SettingsViewModel(IRegionManager regionManager) 11 | { 12 | _regionManager = regionManager; 13 | 14 | Title = "Settings"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /source/SampleApp.Modules.Mail/Views/MailOtherView.axaml.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Controls; 2 | using Avalonia.Markup.Xaml; 3 | 4 | namespace SampleApp.Modules.Mail.Views; 5 | 6 | public partial class MailOtherView : UserControl 7 | { 8 | public MailOtherView() 9 | { 10 | InitializeComponent(); 11 | } 12 | 13 | private void InitializeComponent() 14 | { 15 | AvaloniaXamlLoader.Load(this); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /source/SampleApp.Modules.Mail/Views/MailFocusedView.axaml.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Controls; 2 | using Avalonia.Markup.Xaml; 3 | 4 | namespace SampleApp.Modules.Mail.Views; 5 | 6 | public partial class MailFocusedView : UserControl 7 | { 8 | public MailFocusedView() 9 | { 10 | InitializeComponent(); 11 | } 12 | 13 | private void InitializeComponent() 14 | { 15 | AvaloniaXamlLoader.Load(this); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /source/SampleApp.Main/Models/MenuItem.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Input; 2 | 3 | namespace SampleApp.Main.Models 4 | { 5 | public class MenuItem 6 | { 7 | public ICommand Command { get; set; } 8 | 9 | public string Icon { get; set; } = ""; 10 | 11 | public string Label { get; set; } = ""; 12 | 13 | public string MenuName { get; set; } = ""; 14 | 15 | public string ParentName { get; set; } = ""; 16 | } 17 | } -------------------------------------------------------------------------------- /source/SampleApp.Main/Views/MessageBoxView.axaml.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Controls; 2 | using Avalonia.Markup.Xaml; 3 | 4 | namespace SampleApp.Views 5 | { 6 | public partial class MessageBoxView : UserControl 7 | { 8 | public MessageBoxView() 9 | { 10 | InitializeComponent(); 11 | } 12 | 13 | private void InitializeComponent() 14 | { 15 | AvaloniaXamlLoader.Load(this); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /source/SampleApp.Modules.Message/Views/MessageView.axaml.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Controls; 2 | using Avalonia.Markup.Xaml; 3 | 4 | namespace SampleApp.Modules.Message.Views 5 | { 6 | public partial class MessageView : UserControl 7 | { 8 | public MessageView() 9 | { 10 | InitializeComponent(); 11 | } 12 | 13 | private void InitializeComponent() 14 | { 15 | AvaloniaXamlLoader.Load(this); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /source/SampleApp.Main/Views/DashboardView.axaml.cs: -------------------------------------------------------------------------------- 1 | using Avalonia; 2 | using Avalonia.Controls; 3 | using Avalonia.Markup.Xaml; 4 | 5 | namespace SampleApp.Views 6 | { 7 | public partial class DashboardView : UserControl 8 | { 9 | public DashboardView() 10 | { 11 | InitializeComponent(); 12 | } 13 | 14 | private void InitializeComponent() 15 | { 16 | AvaloniaXamlLoader.Load(this); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /source/SampleApp.Main/Views/SettingsView.axaml.cs: -------------------------------------------------------------------------------- 1 | using Avalonia; 2 | using Avalonia.Controls; 3 | using Avalonia.Markup.Xaml; 4 | 5 | namespace SampleApp.Views 6 | { 7 | public partial class SettingsView : UserControl 8 | { 9 | public SettingsView() 10 | { 11 | InitializeComponent(); 12 | } 13 | 14 | private void InitializeComponent() 15 | { 16 | AvaloniaXamlLoader.Load(this); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /source/SampleApp.Modules.Calendar/Views/CalendarView.axaml.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Controls; 2 | using Avalonia.Markup.Xaml; 3 | 4 | namespace SampleApp.Modules.Calendar.Views 5 | { 6 | public partial class CalendarView : UserControl 7 | { 8 | public CalendarView() 9 | { 10 | InitializeComponent(); 11 | } 12 | 13 | private void InitializeComponent() 14 | { 15 | AvaloniaXamlLoader.Load(this); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /source/SampleApp.Modules.Contacts/Views/ContactsView.axaml.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Controls; 2 | using Avalonia.Markup.Xaml; 3 | 4 | namespace SampleApp.Modules.Contacts.Views 5 | { 6 | public partial class ContactsView : UserControl 7 | { 8 | public ContactsView() 9 | { 10 | InitializeComponent(); 11 | } 12 | 13 | private void InitializeComponent() 14 | { 15 | AvaloniaXamlLoader.Load(this); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /source/SampleApp.Main/Modules/SampleFooter/Views/SampleFooterView.axaml.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Controls; 2 | using Avalonia.Markup.Xaml; 3 | 4 | namespace SampleApp.Modules.SampleFooter.Views 5 | { 6 | public partial class SampleFooterView : UserControl 7 | { 8 | public SampleFooterView() 9 | { 10 | InitializeComponent(); 11 | } 12 | 13 | private void InitializeComponent() 14 | { 15 | AvaloniaXamlLoader.Load(this); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /source/SampleApp.Main/App.axaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /source/SampleApp.Common/SampleApp.Common.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | ..\..\output 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /source/SampleApp.Modules.Contacts/ContactsModule.cs: -------------------------------------------------------------------------------- 1 | using Prism.Ioc; 2 | using Prism.Modularity; 3 | using Prism.Regions; 4 | using SampleApp.Common; 5 | using SampleApp.Modules.Contacts.Views; 6 | 7 | namespace SampleApp.Modules.Contacts; 8 | 9 | public class ContactsModule : IModule 10 | { 11 | public void OnInitialized(IContainerProvider containerProvider) 12 | { 13 | var regionManager = containerProvider.Resolve(); 14 | regionManager.RegisterViewWithRegion(RegionNames.RightRegion, typeof(ContactsView)); 15 | } 16 | 17 | public void RegisterTypes(IContainerRegistry containerRegistry) 18 | { 19 | } 20 | } -------------------------------------------------------------------------------- /source/SampleApp.Modules.Message/MessageModule.cs: -------------------------------------------------------------------------------- 1 | using Prism.Ioc; 2 | using Prism.Modularity; 3 | using Prism.Regions; 4 | using SampleApp.Common; 5 | using SampleApp.Modules.Message.Views; 6 | 7 | namespace SampleApp.Modules.Message 8 | { 9 | public class MessageModule : IModule 10 | { 11 | public void OnInitialized(IContainerProvider containerProvider) 12 | { 13 | containerProvider 14 | .Resolve() 15 | .RegisterViewWithRegion(RegionNames.RightRegion, typeof(MessageView)); 16 | } 17 | 18 | public void RegisterTypes(IContainerRegistry containerRegistry) 19 | { 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /source/SampleApp.Modules.Calendar/CalendarModule.cs: -------------------------------------------------------------------------------- 1 | using Prism.Ioc; 2 | using Prism.Modularity; 3 | using Prism.Regions; 4 | using SampleApp.Common; 5 | using SampleApp.Modules.Calendar.Views; 6 | 7 | namespace SampleApp.Modules.Calendar 8 | { 9 | public class CalendarModule : IModule 10 | { 11 | public void OnInitialized(IContainerProvider containerProvider) 12 | { 13 | var regionManager = containerProvider.Resolve(); 14 | regionManager.RegisterViewWithRegion(RegionNames.LeftRegion, typeof(CalendarView)); 15 | } 16 | 17 | public void RegisterTypes(IContainerRegistry containerRegistry) 18 | { 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /source/SampleApp.Common/RegionNames.cs: -------------------------------------------------------------------------------- 1 | namespace SampleApp.Common; 2 | 3 | public static class RegionNames 4 | { 5 | /// Main Window's Footer Status Bar. 6 | public const string FooterRegion = "FooterRegion"; 7 | 8 | /// Left Side Bar. 9 | public const string LeftRegion = "LeftRegion"; 10 | 11 | /// Main Window's content region. 12 | public const string ContentRegion = "ContentRegion"; 13 | 14 | /// Mail module tab region. 15 | public const string MailTabRegion = "MailTabRegion"; 16 | 17 | /// Right Side Bar. 18 | public const string RightRegion = "RightRegion"; 19 | } 20 | -------------------------------------------------------------------------------- /source/SampleApp.Modules.Mail/Views/MailOtherView.axaml: -------------------------------------------------------------------------------- 1 | 11 | 13 | -------------------------------------------------------------------------------- /source/SampleApp.Main/Modules/SampleFooter/Views/SampleFooterView.axaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source/SampleApp.Common/Models/Mail.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Prism.Mvvm; 3 | 4 | namespace SampleApp.Common.Models; 5 | 6 | public class MailMessage : BindableBase 7 | { 8 | private string _body = string.Empty; 9 | private DateTime _dateSent = DateTime.Now; 10 | private string _from = string.Empty; 11 | private string _subject = string.Empty; 12 | private string _to = string.Empty; 13 | 14 | public string Content { get => _body; set => SetProperty(ref _body, value); } 15 | 16 | public string From { get => _from; set => SetProperty(ref _from, value); } 17 | 18 | public int MailId { get; set; } 19 | 20 | public DateTime ReceivedOn { get => _dateSent; set => SetProperty(ref _dateSent, value); } 21 | 22 | public string Subject { get => _subject; set => SetProperty(ref _subject, value); } 23 | } -------------------------------------------------------------------------------- /source/SampleApp.Modules.Message/Views/MessageView.axaml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /source/SampleApp.Modules.Contacts/Views/ContactsView.axaml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /source/SampleApp.Modules.Calendar/Views/CalendarView.axaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /source/SampleApp.Main/Views/SettingsView.axaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /source/SampleApp.Main/Modules/SampleFooter/SampleFooterModule.cs: -------------------------------------------------------------------------------- 1 | using Prism.Ioc; 2 | using Prism.Modularity; 3 | using Prism.Regions; 4 | using SampleApp.Common; 5 | using SampleApp.Modules.SampleFooter.ViewModels; 6 | using SampleApp.Modules.SampleFooter.Views; 7 | 8 | namespace SampleApp.Modules.SampleFooter 9 | { 10 | public class SampleFooterModule : IModule 11 | { 12 | public void OnInitialized(IContainerProvider containerProvider) 13 | { 14 | var regionManager = containerProvider.Resolve(); 15 | regionManager.RegisterViewWithRegion(RegionNames.FooterRegion, typeof(SampleFooterView)); 16 | } 17 | 18 | public void RegisterTypes(IContainerRegistry containerRegistry) 19 | { 20 | // containerRegistry.Register(); 21 | containerRegistry.RegisterInstance(typeof(SampleFooterViewModel)); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /source/SampleApp.Main/Program.cs: -------------------------------------------------------------------------------- 1 | using Avalonia; 2 | using Avalonia.ReactiveUI; 3 | 4 | namespace SampleApp 5 | { 6 | internal class Program 7 | { 8 | // Avalonia configuration, don't remove; also used by visual designer. 9 | public static AppBuilder BuildAvaloniaApp() => AppBuilder 10 | .Configure() 11 | .UsePlatformDetect() 12 | .With(new X11PlatformOptions { 13 | EnableMultiTouch = false, 14 | UseDBusMenu = true 15 | }) 16 | .With(new Win32PlatformOptions { 17 | EnableMultitouch = true, 18 | AllowEglInitialization = true 19 | }) 20 | .UseSkia() 21 | .UseReactiveUI() 22 | .LogToTrace(); 23 | 24 | // Initialization code. Don't use any Avalonia, third-party APIs or any 25 | // SynchronizationContext-reliant code before AppMain is called: things aren't initialized 26 | // yet and stuff might break. 27 | public static void Main(string[] args) => BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /source/SampleApp.Modules.Mail/SampleApp.Modules.Mail.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | library 4 | net6.0 5 | enable 6 | ..\..\output 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /source/SampleApp.Modules.Mail/ViewModels/MailViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Controls; 2 | using Prism.Commands; 3 | using Prism.Regions; 4 | using SampleApp.Common; 5 | using SampleApp.Services; 6 | 7 | namespace SampleApp.Modules.Mail.ViewModels; 8 | 9 | public class MailViewModel : ViewModelBase 10 | { 11 | private IRegionManager _regionManager; 12 | private int _selectedTabIndex; 13 | private TabItem _selectedTabItem; 14 | 15 | public MailViewModel(IMailService mailService, IRegionManager regionManager) 16 | { 17 | _regionManager = regionManager; 18 | } 19 | 20 | public DelegateCommand CommandShowDashboard => new(OnShowDashboard); 21 | 22 | public string Greeting => "Mail Region"; 23 | 24 | public int SelectedTabIndex { get => _selectedTabIndex; set => SetProperty(ref _selectedTabIndex, value); } 25 | 26 | public TabItem SelectedTabItem { get => _selectedTabItem; set => SetProperty(ref _selectedTabItem, value); } 27 | 28 | private void OnShowDashboard() 29 | { 30 | _regionManager.RequestNavigate(RegionNames.ContentRegion, "DashboardView"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /source/SampleApp.Modules.Mail/ViewModels/MailFocusedViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.ObjectModel; 3 | using Prism; 4 | using SampleApp.Common; 5 | using SampleApp.Common.Models; 6 | using SampleApp.Services; 7 | 8 | namespace SampleApp.Modules.Mail.ViewModels; 9 | 10 | public class MailFocusedViewModel : ViewModelBase, IActiveAware 11 | { 12 | private bool _isActive; 13 | private IMailService _mailService; 14 | 15 | public MailFocusedViewModel(IMailService mailService) 16 | { 17 | _mailService = mailService; 18 | MailMessages = new ObservableCollection(_mailService.Messages); 19 | } 20 | 21 | public event EventHandler? IsActiveChanged; 22 | 23 | /// Xamarin.Forms only, this never gets hit. 24 | public bool IsActive { get => _isActive; set => SetProperty(ref _isActive, value, RaiseIsActiveChanged);} 25 | 26 | public ObservableCollection MailMessages { get; private set; } 27 | 28 | protected virtual void RaiseIsActiveChanged() 29 | { 30 | IsActiveChanged?.Invoke(this, EventArgs.Empty); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Xeno Innovations, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /source/SampleApp.Modules.Calendar/SampleApp.Modules.Calendar.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | library 4 | net6.0 5 | enable 6 | ..\..\output 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /source/SampleApp.Modules.Contacts/SampleApp.Modules.Contacts.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | library 4 | net6.0 5 | enable 6 | ..\..\output 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /source/SampleApp.Modules.Message/SampleApp.Modules.Message.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | library 4 | net6.0 5 | enable 6 | ..\..\output 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /source/SampleApp.Main/Core/RegionAdapters/GridRegionAdapter.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Controls; 2 | using Prism.Regions; 3 | 4 | namespace SampleApp.Main.Core.RegionAdapters 5 | { 6 | public class GridRegionAdapter : RegionAdapterBase 7 | { 8 | public GridRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory) 9 | : base(regionBehaviorFactory) 10 | { 11 | } 12 | 13 | protected override void Adapt(IRegion region, Grid regionTarget) 14 | { 15 | region.Views.CollectionChanged += (sender, e) => 16 | { 17 | if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add) 18 | { 19 | foreach (IControl item in e.NewItems) 20 | { 21 | regionTarget.Children.Add(item); 22 | } 23 | } 24 | if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove) 25 | { 26 | foreach (IControl item in e.OldItems) 27 | { 28 | regionTarget.Children.Remove(item); 29 | } 30 | } 31 | }; 32 | } 33 | 34 | protected override IRegion CreateRegion() => new SingleActiveRegion() { }; 35 | } 36 | } -------------------------------------------------------------------------------- /source/SampleApp.Main/Views/DashboardView.axaml: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 | 17 | 18 | 19 |