Skip to content

Commit e01ec03

Browse files
committed
with example
1 parent b221e5f commit e01ec03

File tree

12 files changed

+196
-16
lines changed

12 files changed

+196
-16
lines changed

SimpleMVVM.Example/App.xaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Application x:Class="SimpleMVVM.Example.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="clr-namespace:SimpleMVVM.Example"
5+
StartupUri="MainWindow.xaml">
6+
<Application.Resources>
7+
8+
</Application.Resources>
9+
</Application>

SimpleMVVM.Example/App.xaml.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System.Configuration;
2+
using System.Data;
3+
using System.Windows;
4+
5+
namespace SimpleMVVM.Example;
6+
/// <summary>
7+
/// Interaction logic for App.xaml
8+
/// </summary>
9+
public partial class App : Application
10+
{
11+
}
12+

SimpleMVVM.Example/AssemblyInfo.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System.Windows;
2+
3+
[assembly: ThemeInfo(
4+
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5+
//(used if a resource is not found in the page,
6+
// or application resource dictionaries)
7+
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8+
//(used if a resource is not found in the page,
9+
// app, or any theme specific resource dictionaries)
10+
)]

SimpleMVVM.Example/MainWindow.xaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Window x:Class="SimpleMVVM.Example.MainWindow"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:local="clr-namespace:SimpleMVVM.Example"
7+
mc:Ignorable="d"
8+
Title="MainWindow" Height="450" Width="800">
9+
<Grid>
10+
11+
</Grid>
12+
</Window>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System.Text;
2+
using System.Windows;
3+
using System.Windows.Controls;
4+
using System.Windows.Data;
5+
using System.Windows.Documents;
6+
using System.Windows.Input;
7+
using System.Windows.Media;
8+
using System.Windows.Media.Imaging;
9+
using System.Windows.Navigation;
10+
using System.Windows.Shapes;
11+
12+
namespace SimpleMVVM.Example;
13+
/// <summary>
14+
/// Interaction logic for MainWindow.xaml
15+
/// </summary>
16+
public partial class MainWindow : Window
17+
{
18+
public MainWindow()
19+
{
20+
InitializeComponent();
21+
}
22+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>WinExe</OutputType>
5+
<TargetFramework>net9.0-windows</TargetFramework>
6+
<Nullable>enable</Nullable>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<UseWPF>true</UseWPF>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<ProjectReference Include="..\SimpleMVVM\SimpleMVVM.csproj" />
13+
<ProjectReference Include="..\ViewModelGenerator\ViewModelGenerator.csproj" />
14+
</ItemGroup>
15+
16+
</Project>

SimpleMVVM.sln

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
4-
VisualStudioVersion = 17.14.36203.30 d17.14
4+
VisualStudioVersion = 17.14.36203.30
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleMVVM", "SimpleMVVM\SimpleMVVM.csproj", "{BA71A860-3099-4D56-AF32-28E84C602E74}"
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ViewModelGenerator", "ViewModelGenerator\ViewModelGenerator.csproj", "{529954DF-428A-4403-8D15-3B0B266223D6}"
99
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleMVVM.Example", "SimpleMVVM.Example\SimpleMVVM.Example.csproj", "{303FBB60-B038-4B45-BEDA-C4C93E52B607}"
11+
EndProject
1012
Global
1113
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1214
Debug|Any CPU = Debug|Any CPU
@@ -21,6 +23,10 @@ Global
2123
{529954DF-428A-4403-8D15-3B0B266223D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
2224
{529954DF-428A-4403-8D15-3B0B266223D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
2325
{529954DF-428A-4403-8D15-3B0B266223D6}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{303FBB60-B038-4B45-BEDA-C4C93E52B607}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{303FBB60-B038-4B45-BEDA-C4C93E52B607}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{303FBB60-B038-4B45-BEDA-C4C93E52B607}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{303FBB60-B038-4B45-BEDA-C4C93E52B607}.Release|Any CPU.Build.0 = Release|Any CPU
2430
EndGlobalSection
2531
GlobalSection(SolutionProperties) = preSolution
2632
HideSolutionNode = FALSE

SimpleMVVM/BindAttribute.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
namespace SimpleMVVM;
22

33
[AttributeUsage(AttributeTargets.Class)]
4-
public class BindAttribute : Attribute
5-
{
6-
7-
}
4+
public sealed class BindAttribute : Attribute;

SimpleMVVM/CommandAttribute.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
namespace SimpleMVVM;
22

33
[AttributeUsage(AttributeTargets.Class)]
4-
public class CommandAttribute : Attribute
5-
{
6-
7-
}
4+
public sealed class CommandAttribute : Attribute;

SimpleMVVM/SimpleMVVM.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@
5959
<ItemGroup>
6060
<None Include="..\Icon.png" Pack="true" PackagePath="" />
6161
<None Include="..\README.md" Pack="true" PackagePath="" />
62-
<None Include="$(MSBuildThisFileDirectory)../ViewModelGenerator/bin/Release/netstandard2.0/ViewModelGenerator.dll" Pack="true" PackagePath="analyzers/dotnet/cs/" Condition="Exists('$(MSBuildThisFileDirectory)../ViewModelGenerator/bin/Release/netstandard2.0/ViewModelGenerator.dll')" />
62+
<None Include="$(MSBuildThisFileDirectory)../ViewModelGenerator/bin/Release/netstandard2.0/ViewModelGenerator.dll"
63+
Pack="true"
64+
PackagePath="analyzers/dotnet/cs/"
65+
Condition="Exists('$(MSBuildThisFileDirectory)../ViewModelGenerator/bin/Release/netstandard2.0/ViewModelGenerator.dll')" />
6366
</ItemGroup>
6467

6568
</Project>

0 commit comments

Comments
 (0)