-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
69 changed files
with
3,036 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Projektmappenelemente", "Projektmappenelemente", "{658BD492-33FF-4995-AAE7-4F6894E92F0C}" | ||
ProjectSection(SolutionItems) = preProject | ||
MVVM_Tutorial.props = MVVM_Tutorial.props | ||
MVVM_Tutorial_net.props = MVVM_Tutorial_net.props | ||
EndProjectSection | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MVVM_BaseLib", "..\Libraries\MVVM_BaseLib\MVVM_BaseLib.csproj", "{890CF504-3814-443B-9EE6-E8BCACF68203}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{AF041458-CF94-4D6D-BB0F-8BC50F4F099C}" | ||
ProjectSection(SolutionItems) = preProject | ||
..\Libraries\Libraries_net.props = ..\Libraries\Libraries_net.props | ||
EndProjectSection | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MVVM_BaseLibTests", "..\Libraries\MVVM_BaseLibTests\MVVM_BaseLibTests.csproj", "{66EB60F2-523D-47C8-95EA-C7E10759E239}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MVVM_00_IoCTemplate", "MVVM_00_IoCTemplate\MVVM_00_IoCTemplate.csproj", "{16A3E367-674C-4959-8B31-7681B0E8258C}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MVVM_00_IoCTemplate_net", "MVVM_00_IoCTemplate\MVVM_00_IoCTemplate_net.csproj", "{D6BFC652-822A-4E7D-9846-7F529C584BAC}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MVVM_00_IoCTemplate_netTests", "MVVM_00_IoCTemplateTests\MVVM_00_IoCTemplate_netTests.csproj", "{A7844F45-74D9-4A81-9C27-D0E17ED0F851}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MVVM_00_IoCTemplateTests", "MVVM_00_IoCTemplateTests\MVVM_00_IoCTemplateTests.csproj", "{7FF12BBB-AA2E-48C1-B283-0665570902F8}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{890CF504-3814-443B-9EE6-E8BCACF68203}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{890CF504-3814-443B-9EE6-E8BCACF68203}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{890CF504-3814-443B-9EE6-E8BCACF68203}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{890CF504-3814-443B-9EE6-E8BCACF68203}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{66EB60F2-523D-47C8-95EA-C7E10759E239}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{66EB60F2-523D-47C8-95EA-C7E10759E239}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{66EB60F2-523D-47C8-95EA-C7E10759E239}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{66EB60F2-523D-47C8-95EA-C7E10759E239}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{16A3E367-674C-4959-8B31-7681B0E8258C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{16A3E367-674C-4959-8B31-7681B0E8258C}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{16A3E367-674C-4959-8B31-7681B0E8258C}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{16A3E367-674C-4959-8B31-7681B0E8258C}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{D6BFC652-822A-4E7D-9846-7F529C584BAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{D6BFC652-822A-4E7D-9846-7F529C584BAC}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{D6BFC652-822A-4E7D-9846-7F529C584BAC}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{D6BFC652-822A-4E7D-9846-7F529C584BAC}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{A7844F45-74D9-4A81-9C27-D0E17ED0F851}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{A7844F45-74D9-4A81-9C27-D0E17ED0F851}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{A7844F45-74D9-4A81-9C27-D0E17ED0F851}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{A7844F45-74D9-4A81-9C27-D0E17ED0F851}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{7FF12BBB-AA2E-48C1-B283-0665570902F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{7FF12BBB-AA2E-48C1-B283-0665570902F8}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{7FF12BBB-AA2E-48C1-B283-0665570902F8}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{7FF12BBB-AA2E-48C1-B283-0665570902F8}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(NestedProjects) = preSolution | ||
{890CF504-3814-443B-9EE6-E8BCACF68203} = {AF041458-CF94-4D6D-BB0F-8BC50F4F099C} | ||
{66EB60F2-523D-47C8-95EA-C7E10759E239} = {AF041458-CF94-4D6D-BB0F-8BC50F4F099C} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Application x:Class="MVVM_00_IoCTemplate.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:MVVM_00_IoCTemplate" | ||
StartupUri="MainWindow.xaml"> | ||
<Application.Resources> | ||
|
||
</Application.Resources> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// *********************************************************************** | ||
// Assembly : MVVM_00_IoCTemplate | ||
// Author : Mir | ||
// Created : 08-11-2022 | ||
// | ||
// Last Modified By : Mir | ||
// Last Modified On : 08-24-2022 | ||
// *********************************************************************** | ||
// <copyright file="App.xaml.cs" company="JC-Soft"> | ||
// Copyright © JC-Soft 2022 | ||
// </copyright> | ||
// <summary></summary> | ||
// *********************************************************************** | ||
using BaseLib.Helper; | ||
using BaseLib.Interfaces; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using MVVM.View.Extension; | ||
using MVVM_00_IoCTemplate.Models; | ||
using System.Windows; | ||
|
||
namespace MVVM_00_IoCTemplate | ||
{ | ||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
protected override void OnStartup(StartupEventArgs e) | ||
{ | ||
var sc = new ServiceCollection() | ||
.AddTransient<ISysTime, SysTime>() | ||
.AddTransient<ILog, SimpleLog>() | ||
.AddSingleton<ITemplateModel, TemplateModel>(); | ||
|
||
var bc = sc.BuildServiceProvider(); | ||
|
||
IoC.Configure(bc); | ||
} | ||
} | ||
} | ||
namespace MVVM_00_IoCTemplate.Models { } | ||
namespace MVVM_00_IoCTemplate.ValueConverter { } | ||
namespace MVVM_00_IoCTemplate.Services { } |
10 changes: 10 additions & 0 deletions
10
CSharpBible/MVVM_Tutorial/MVVM_00_IoCTemplate/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Windows; | ||
|
||
[assembly: ThemeInfo( | ||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located | ||
//(used if a resource is not found in the page, | ||
// or application resource dictionaries) | ||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located | ||
//(used if a resource is not found in the page, | ||
// app, or any theme specific resource dictionaries) | ||
)] |
40 changes: 40 additions & 0 deletions
40
CSharpBible/MVVM_Tutorial/MVVM_00_IoCTemplate/MVVM_00_IoCTemplate.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<Project> | ||
<Import Project="..\MVVM_Tutorial.props" /> | ||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFrameworks>net462-windows;net472-windows;net48-windows;net481-windows</TargetFrameworks> | ||
<UseWPF>true</UseWPF> | ||
</PropertyGroup> | ||
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" /> | ||
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" /> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\Libraries\MVVM_BaseLib\MVVM_BaseLib.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Update="Properties\Resources.Designer.cs"> | ||
<DesignTime>True</DesignTime> | ||
<AutoGen>True</AutoGen> | ||
<DependentUpon>Resources.resx</DependentUpon> | ||
</Compile> | ||
<Compile Update="Properties\Settings.Designer.cs"> | ||
<DesignTimeSharedInput>True</DesignTimeSharedInput> | ||
<AutoGen>True</AutoGen> | ||
<DependentUpon>Settings.settings</DependentUpon> | ||
</Compile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<EmbeddedResource Update="Properties\Resources.resx"> | ||
<Generator>PublicResXFileCodeGenerator</Generator> | ||
<LastGenOutput>Resources.Designer.cs</LastGenOutput> | ||
</EmbeddedResource> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Update="Properties\Settings.settings"> | ||
<Generator>PublicSettingsSingleFileGenerator</Generator> | ||
<LastGenOutput>Settings.Designer.cs</LastGenOutput> | ||
</None> | ||
</ItemGroup> | ||
</Project> |
40 changes: 40 additions & 0 deletions
40
CSharpBible/MVVM_Tutorial/MVVM_00_IoCTemplate/MVVM_00_IoCTemplate_net.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<Project> | ||
<Import Project="..\MVVM_Tutorial_net.props" /> | ||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFrameworks>net6.0-windows;net7.0-windows;net8.0-windows</TargetFrameworks> | ||
<UseWPF>true</UseWPF> | ||
</PropertyGroup> | ||
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" /> | ||
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" /> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\Libraries\MVVM_BaseLib\MVVM_BaseLib.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Update="Properties\Resources.Designer.cs"> | ||
<DesignTime>True</DesignTime> | ||
<AutoGen>True</AutoGen> | ||
<DependentUpon>Resources.resx</DependentUpon> | ||
</Compile> | ||
<Compile Update="Properties\Settings.Designer.cs"> | ||
<DesignTimeSharedInput>True</DesignTimeSharedInput> | ||
<AutoGen>True</AutoGen> | ||
<DependentUpon>Settings.settings</DependentUpon> | ||
</Compile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<EmbeddedResource Update="Properties\Resources.resx"> | ||
<Generator>PublicResXFileCodeGenerator</Generator> | ||
<LastGenOutput>Resources.Designer.cs</LastGenOutput> | ||
</EmbeddedResource> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Update="Properties\Settings.settings"> | ||
<Generator>PublicSettingsSingleFileGenerator</Generator> | ||
<LastGenOutput>Settings.Designer.cs</LastGenOutput> | ||
</None> | ||
</ItemGroup> | ||
</Project> |
33 changes: 33 additions & 0 deletions
33
CSharpBible/MVVM_Tutorial/MVVM_00_IoCTemplate/MainWindow.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<Window x:Class="MVVM_00_IoCTemplate.MainWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:MVVM_00_IoCTemplate" | ||
xmlns:p="clr-namespace:MVVM_00_IoCTemplate.Properties" | ||
xmlns:mvvm="clr-namespace:MVVM_00_IoCTemplate.ViewModels" | ||
mc:Ignorable="d" | ||
Title="{x:Static p:Resources.Title}" | ||
ToolTip="{x:Static p:Resources.Description}" | ||
Height="450" Width="800"> | ||
<Window.DataContext> | ||
<mvvm:MainWindowViewModel/> | ||
</Window.DataContext> | ||
<TabControl> | ||
<TabItem Header="{x:Static p:Resources.Title}"> | ||
<Frame Source="/Views/TemplateView.xaml"/> | ||
</TabItem> | ||
<TabItem Header="Xaml"> | ||
<DockPanel> | ||
<TextBlock DockPanel.Dock="Top" Text="the Xaml-Code" /> | ||
<TextBox Text="{x:Static p:Resources.TemplateView}" IsReadOnly="True" AllowDrop="False" VerticalScrollBarVisibility="Visible"/> | ||
</DockPanel> | ||
</TabItem> | ||
<TabItem Header="ViewModel"> | ||
<DockPanel> | ||
<TextBlock DockPanel.Dock="Top" Text="the ViewModel-Code" /> | ||
<TextBox Text="{x:Static p:Resources.TemplateViewModel}" IsReadOnly="True" AllowDrop="False" VerticalScrollBarVisibility="Visible"/> | ||
</DockPanel> | ||
</TabItem> | ||
</TabControl> | ||
</Window> |
31 changes: 31 additions & 0 deletions
31
CSharpBible/MVVM_Tutorial/MVVM_00_IoCTemplate/MainWindow.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// *********************************************************************** | ||
// Assembly : MVVM_00_IoCTemplate | ||
// Author : Mir | ||
// Created : 08-11-2022 | ||
// | ||
// Last Modified By : Mir | ||
// Last Modified On : 08-24-2022 | ||
// *********************************************************************** | ||
// <copyright file="MainWindow.xaml.cs" company="JC-Soft"> | ||
// Copyright © JC-Soft 2022 | ||
// </copyright> | ||
// <summary></summary> | ||
// *********************************************************************** | ||
using System.Windows; | ||
|
||
namespace MVVM_00_IoCTemplate | ||
{ | ||
/// <summary> | ||
/// Interaction logic for MainWindow.xaml | ||
/// </summary> | ||
public partial class MainWindow : Window | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="MainWindow"/> class. | ||
/// </summary> | ||
public MainWindow() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Folder for Models |
41 changes: 41 additions & 0 deletions
41
CSharpBible/MVVM_Tutorial/MVVM_00_IoCTemplate/Models/ITemplateModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// *********************************************************************** | ||
// Assembly : MVVM_00_IoCTemplate | ||
// Author : Mir | ||
// Created : 05-19-2023 | ||
// | ||
// Last Modified By : Mir | ||
// Last Modified On : 05-19-2023 | ||
// *********************************************************************** | ||
// <copyright file="ITemplateModel.cs" company="JC-Soft"> | ||
// Copyright © JC-Soft 2023 | ||
// </copyright> | ||
// <summary></summary> | ||
// *********************************************************************** | ||
using System; | ||
using System.ComponentModel; | ||
|
||
/// <summary> | ||
/// The Models namespace. | ||
/// </summary> | ||
/// <autogeneratedoc /> | ||
namespace MVVM_00_IoCTemplate.Models | ||
{ | ||
/// <summary> | ||
/// Interface ITemplateModel | ||
/// </summary> | ||
/// <autogeneratedoc /> | ||
public interface ITemplateModel | ||
{ | ||
/// <summary> | ||
/// Gets the now. | ||
/// </summary> | ||
/// <value>The now.</value> | ||
/// <autogeneratedoc /> | ||
DateTime Now { get; } | ||
/// <summary> | ||
/// Occurs when [property changed]. | ||
/// </summary> | ||
/// <autogeneratedoc /> | ||
event PropertyChangedEventHandler PropertyChanged; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
CSharpBible/MVVM_Tutorial/MVVM_00_IoCTemplate/Models/SimpleLog.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// *********************************************************************** | ||
// Assembly : MVVM_00_IoCTemplate | ||
// Author : Mir | ||
// Created : 08-11-2022 | ||
// | ||
// Last Modified By : Mir | ||
// Last Modified On : 08-24-2022 | ||
// *********************************************************************** | ||
// <copyright file="App.xaml.cs" company="JC-Soft"> | ||
// Copyright © JC-Soft 2022 | ||
// </copyright> | ||
// <summary></summary> | ||
// *********************************************************************** | ||
using BaseLib.Interfaces; | ||
using System; | ||
using System.Diagnostics; | ||
using System.Globalization; | ||
|
||
namespace MVVM_00_IoCTemplate; | ||
|
||
public class SimpleLog(ISysTime sysTime):ILog | ||
{ | ||
ISysTime _sysTime { get; } = sysTime; | ||
|
||
public void Log(string message) | ||
=> Debug.WriteLine($"{_sysTime.Now.ToString(CultureInfo.InvariantCulture)}: Msg: {message}"); | ||
public void Log(string message, Exception exception) | ||
=> Debug.WriteLine($"{_sysTime.Now.ToString(CultureInfo.InvariantCulture)}: Err: {message}, {exception}"); | ||
} |
Oops, something went wrong.