Skip to content

Commit

Permalink
Merge pull request #3 from HakamFostok/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
HakamFostok authored May 5, 2020
2 parents 7622397 + b77bed7 commit 7c13730
Show file tree
Hide file tree
Showing 31 changed files with 62 additions and 40 deletions.
14 changes: 14 additions & 0 deletions Core/Core.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWPF>true</UseWPF>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Prism.Core" Version="7.2.0.1422" />
<PackageReference Include="Prism.Wpf" Version="7.2.0.1422" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;

namespace SharedModule
namespace Core
{
public interface IFileDialogService
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;

namespace SharedModule
namespace Core
{
public interface ILogService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Windows;

namespace SharedModule
namespace Core
{
/// <summary>
/// Service which provide access to the MessageBox methods and FileDialogs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Prism.Services.Dialogs;
using System;

namespace SharedModule
namespace Core
{
public class BaseDialogViewModel : BaseViewModel, IDialogAware
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using CommonServiceLocator;
using Domain;
using Prism;
using Prism.Events;
using Prism.Mvvm;
Expand All @@ -9,7 +8,7 @@
using System.Linq;
using System.Runtime.CompilerServices;

namespace SharedModule
namespace Core
{
public abstract class BaseViewModel : BindableBase, IActiveAware
{
Expand All @@ -25,7 +24,7 @@ public abstract class BaseViewModel : BindableBase, IActiveAware

protected BaseViewModel()
{
_messageBoxService = ServiceLocator.Current.GetInstance<IMessageBoxService>();
_messageBoxService = ServiceLocator.Current.GetInstance<IMessageBoxService>();
_fileDialogService = ServiceLocator.Current.GetInstance<IFileDialogService>();
_logService = ServiceLocator.Current.GetInstance<ILogService>();

Expand All @@ -42,8 +41,7 @@ protected void ShowParameterNullError([CallerMemberName] string callerName = nul
protected void HandleException(Exception ex)
{
_messageBoxService.ShowError(ex.Message);
if (!(ex is BusinessException))
_logService.LogError(ex.ToString());
_logService.LogError(ex.ToString());
}

protected void ActivateRegionWithView<T>(string regionName)
Expand Down
4 changes: 2 additions & 2 deletions SharedModule/Utility/Events.cs → Core/Utility/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
using System.Collections.Generic;
using System.Text;

namespace SharedModule
namespace Core
{
// define all the events of the application here
// public class SomeEvent : PubSubEvent { }
public class SomeEvent : PubSubEvent { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Collections.ObjectModel;
using System.Text;

namespace SharedModule
namespace Core
{
public static class Extensions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;

namespace SharedModule
namespace Core
{
public static class RegionNames
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using NLog;
using Core;
using NLog;
using Prism.Ioc;
using Prism.Modularity;
using System;

namespace SharedModule
{
public class SharedModule : IModule
public class CommonServicesModule : IModule
{
public void OnInitialized(IContainerProvider containerProvider)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
Expand All @@ -12,6 +12,10 @@
<PackageReference Include="Prism.Wpf" Version="7.2.0.1422" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Core\Core.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="nlog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Win32;
using Core;
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Text;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NLog;
using Core;
using NLog;
using System;
using System.Collections.Generic;
using System.Text;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Windows;
using Core;
using System.Windows;

namespace SharedModule
{
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions MainModule/MainModule.cs → Modules/MainModule/MainModule.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using MainModule.Views;
using Core;
using MainModule.Views;
using Prism.Ioc;
using Prism.Modularity;
using Prism.Regions;
using SharedModule;
using System;

namespace MainModule
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
Expand All @@ -10,7 +10,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SharedModule\SharedModule.csproj" />
<ProjectReference Include="..\..\Core\Core.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using MainModule.Views;
using Core;
using MainModule.Views;
using Prism.Commands;
using Prism.Services.Dialogs;
using SharedModule;
using System;
using System.Collections.Generic;
using System.Text;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using SharedModule;
using System;
using System.Collections.Generic;
using System.Text;
using Core;

namespace MainModule.ViewModels
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions WpfCoreApp/App.xaml.cs → Shell/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Prism.Ioc;
using Prism.Modularity;
using SharedModule;
using System.Windows;

namespace WpfCoreApp
Expand All @@ -21,9 +22,7 @@ protected override void RegisterTypes(IContainerRegistry containerRegistry)

protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
{
base.ConfigureModuleCatalog(moduleCatalog);

moduleCatalog.AddModule<SharedModule.SharedModule>();
moduleCatalog.AddModule<CommonServicesModule>();
moduleCatalog.AddModule<MainModule.MainModule>();
}
}
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions WpfCoreApp/MainWindow.xaml → Shell/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:prism="http://prismlibrary.com/"
xmlns:shared="clr-namespace:SharedModule;assembly=SharedModule"
xmlns:core="clr-namespace:Core;assembly=Core"
prism:ViewModelLocator.AutoWireViewModel="True"
mc:Ignorable="d"
Title="First WPF Core App" Height="450" Width="800">
Title="WPF .NET Core Shell" Height="450" Width="800">
<Grid>
<ContentControl prism:RegionManager.RegionName="{x:Static shared:RegionNames.MainRegion}" />
<ContentControl prism:RegionManager.RegionName="{x:Static core:RegionNames.MainRegion}" />
</Grid>
</Window>
File renamed without changes.
4 changes: 2 additions & 2 deletions WpfCoreApp/WpfCoreApp.csproj → Shell/Shell.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\MainModule\MainModule.csproj" />
<ProjectReference Include="..\SharedModule\SharedModule.csproj" />
<ProjectReference Include="..\Modules\CommonServicesModule\CommonServicesModule.csproj" />
<ProjectReference Include="..\Modules\MainModule\MainModule.csproj" />
</ItemGroup>

</Project>
12 changes: 9 additions & 3 deletions WpfCoreApp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30011.22
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfCoreApp", "WpfCoreApp\WpfCoreApp.csproj", "{CFC5C94B-87FB-46D3-AA88-87372A1D5314}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shell", "Shell\Shell.csproj", "{CFC5C94B-87FB-46D3-AA88-87372A1D5314}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{C61A656E-515E-4911-AE99-A84B699992BD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharedModule", "SharedModule\SharedModule.csproj", "{249554B8-60F8-4AEB-A033-F533D8C07B48}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommonServicesModule", "Modules\CommonServicesModule\CommonServicesModule.csproj", "{249554B8-60F8-4AEB-A033-F533D8C07B48}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MainModule", "MainModule\MainModule.csproj", "{7DF4675C-FD41-4B91-8F55-09CBA0791211}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MainModule", "Modules\MainModule\MainModule.csproj", "{7DF4675C-FD41-4B91-8F55-09CBA0791211}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core", "Core\Core.csproj", "{E274215D-3212-4598-ADC7-2CB224331B71}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -29,6 +31,10 @@ Global
{7DF4675C-FD41-4B91-8F55-09CBA0791211}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7DF4675C-FD41-4B91-8F55-09CBA0791211}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7DF4675C-FD41-4B91-8F55-09CBA0791211}.Release|Any CPU.Build.0 = Release|Any CPU
{E274215D-3212-4598-ADC7-2CB224331B71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E274215D-3212-4598-ADC7-2CB224331B71}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E274215D-3212-4598-ADC7-2CB224331B71}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E274215D-3212-4598-ADC7-2CB224331B71}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 7c13730

Please sign in to comment.