Skip to content

Commit

Permalink
Merge pull request #9 from MichaeIDietrich/release/2.0
Browse files Browse the repository at this point in the history
Release 2.0.0
  • Loading branch information
MichaeIDietrich authored Jul 14, 2022
2 parents 346f473 + fbe25e8 commit adbbc6e
Show file tree
Hide file tree
Showing 123 changed files with 6,808 additions and 82 deletions.
31 changes: 25 additions & 6 deletions .ci/build.ps1
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@
$project = "$PSScriptRoot\..\src\SmartMvvm.Xaml\SmartMvvm.Xaml.csproj"
$sharedBuildProps = "$PSScriptRoot\..\src\Directory.Build.props"
$wpfProject = "$PSScriptRoot\..\src\SmartMvvm.Xaml\SmartMvvm.Xaml.csproj"
$avaloniaProject = "$PSScriptRoot\..\src\SmartMvvm.Avalonia.Xaml\SmartMvvm.Avalonia.Xaml.csproj"


$version = & "$PSScriptRoot\common\Get-VersionPrefix.ps1" -projectFilePath $project
$version = & "$PSScriptRoot\common\Get-VersionPrefix.ps1" -projectFilePath $sharedBuildProps

$branch = & "$PSScriptRoot\common\Get-CurrentBranch.ps1"
$versionSuffix = & "$PSScriptRoot\common\Get-VersionSuffix.ps1" -branch $branch


$props = @($project, '-o', 'artifacts', '-c', 'Release')
$wpfProjectProps = @($wpfProject, '-o', 'artifacts', '-c', 'Release', '-p:ContinuousIntegrationBuild=true')
$avaloniaProjectProps = @($avaloniaProject, '-o', 'artifacts', '-c', 'Release', '-p:ContinuousIntegrationBuild=true')

if ($versionSuffix)
{
$props = $props += "-p:VersionSuffix=$versionSuffix"
$wpfProjectProps += "-p:VersionSuffix=$versionSuffix"
$avaloniaProjectProps += "-p:VersionSuffix=$versionSuffix"
$version = "$version-$versionSuffix"
}

Update-AppveyorBuild -Version "$version"
if (Test-Path env:APPVEYOR)
{
Update-AppveyorBuild -Version "$version"
}

dotnet pack $wpfProjectProps

if ($LASTEXITCODE)
{
exit $LASTEXITCODE
}

dotnet pack $props
dotnet pack $avaloniaProjectProps

if ($LASTEXITCODE)
{
exit $LASTEXITCODE
}
11 changes: 8 additions & 3 deletions .ci/test.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
$project = "$PSScriptRoot\..\src\SmartMvvm.Xaml.UnitTests\SmartMvvm.Xaml.UnitTests.csproj"
$solution = "$PSScriptRoot\..\src\SmartMvvm.Xaml.sln"


$props = @($project, '-c', 'Release')
$props = @($solution, '-c', 'Release')

dotnet test $props
dotnet test $props

if ($LASTEXITCODE)
{
exit $LASTEXITCODE
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ build/

# NuGet Packages
*.nupkg
*.snupkg

# The packages folder can be ignored because of Package Restore
**/packages/*

Expand Down
22 changes: 18 additions & 4 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
SmartMvvm.Xaml Changelog
SmartMvvm.Xaml + SmartMvvm.Avalonia.Xaml Changelog
========================

v2.0
------

- Breaking: Raised lower limit for supported .NET Core version to 3.1.
- Extended `{Use}` markup extension to also support `{StaticResource}` markup extension as constructor parameter.
(while this seems to be more boilerplate code tooling like R# will understand these as references)
- Added a new convinient constructor to `{Is}` markup extension that checks the passed value for being either true or not empty.
- Breaking: Unified naming for comparison modes of `{Is}` markup extension to always use `Non` instead of `Not` for negative naming.
- Breaking: Minor adjustment to several markup extension to behave more intuitive. (see commit 947d07c899346ff65e86adf4334b68a4eb11b5b2)
- Added `SourceLink` support to NuGet.
- Introduced a new `{IsTypeOf}` markup extension for simply checking a value for a specific type.
- Introduced a new `{Switch}` markup extension for checking a value for multiple cases such as the `switch` keyword in C#.
- Ported this NuGet over to Avalonia as a separate NuGet. (SmartMvvm.Avalonia.Xaml)

v1.2.0
------

Expand All @@ -13,17 +27,17 @@ v1.1.0

- Fixed a bug where any logic based markup extension failed if there wasn't at least one `Binding` in use.
- Fixed a bug where `{Less}` markup extension mistakenly also succeeded if both input values where equal to each other.
- Changed the behavior that the range defined by the `Epsilon` property for the `{Equal}` markup extension now also includes the range boundaries.
- Breaking: Changed the behavior that the range defined by the `Epsilon` property for the `{Equal}` markup extension now also includes the range boundaries.
(e.g. 2 is now equal to 3 if `Epsilon` is set to 1)
- Introduced a new `{Is}` markup extension that can be used to check for a specific property of a given value.

v1.0.0
------

- First real release (no pre-release tag any more).
- `{If}` markup extension now returns `boolean` values rather than `null`, if `Then` and `Else` properties are not set.
- Breaking: `{If}` markup extension now returns `boolean` values rather than `null`, if `Then` and `Else` properties are not set.
- Introduced new constructor to `{If}` markup extension to provide a convenient way of comparison two input values.
- Removed old constructor from `{If}` markup extension to prevent wrong constructor resolution from XAML markup parser.
- Breaking: Removed old constructor from `{If}` markup extension to prevent wrong constructor resolution from XAML markup parser.

v0.9.0
------
Expand Down
10 changes: 6 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
version: 1.0.0
image: Visual Studio 2019
version: 2.0.0.{build}
skip_tags: true
image: Visual Studio 2022
build_script:
- ps: ./.ci/build.ps1
test_script:
- ps: ./.ci/test.ps1
artifacts:
- path: artifacts/*.nupkg
- path: artifacts/*.snupkg
deploy:
- provider: NuGet
api_key:
secure: FS7OJwqKtXgQLcreC0htCtc30/5f6Hy8oipDyDg0/a1e70pA0uQ+0HxNk+EVdHNi
secure: 0bu/b9qP5vZJifyxR/C4D2HET/ZgE0UBXGx5QYZpmz8O7hrjT4vbAntHp4v20HVD
on:
branch: /^master|release\/.+$/
branch: /^master|release\/.+$/
18 changes: 10 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
# SmartMvvm.Xaml
# SmartMvvm.Xaml / SmartMvvm.Avalonia.Xaml

[![NuGet](https://img.shields.io/nuget/v/SmartMvvm.Xaml.svg)](https://www.nuget.org/packages/SmartMvvm.Xaml/)
[![Build status (master)](https://ci.appveyor.com/api/projects/status/mw21p6jogh4v4cgh/branch/master?svg=true&passingText=master%20-%20passing&pendingText=master%20-%20pending&failingText=master%20-%20FAILED)](https://ci.appveyor.com/project/FrecherxDachs/smartmvvm-xaml/branch/master)
[![Build status (develop)](https://ci.appveyor.com/api/projects/status/mw21p6jogh4v4cgh/branch/develop?svg=true&passingText=develop%20-%20passing&pendingText=develop%20-%20pending&failingText=develop%20-%20FAILED)](https://ci.appveyor.com/project/FrecherxDachs/smartmvvm-xaml/branch/develop)
[![NuGet](https://img.shields.io/nuget/v/SmartMvvm.Xaml.svg?label=nuget%20(WPF))](https://www.nuget.org/packages/SmartMvvm.Xaml/)
[![NuGet](https://img.shields.io/nuget/v/SmartMvvm.Avalonia.Xaml.svg?label=nuget%20(Avalonia))](https://www.nuget.org/packages/SmartMvvm.Avalonia.Xaml/)

[![Build status (master)](https://ci.appveyor.com/api/projects/status/mw21p6jogh4v4cgh/branch/master?svg=true&passingText=master%20-%20passing&pendingText=master%20-%20pending&failingText=master%20-%20FAILED)](https://ci.appveyor.com/project/MichaeIDietrich/SmartMvvm.Xaml/branch/master)
[![Build status (develop)](https://ci.appveyor.com/api/projects/status/mw21p6jogh4v4cgh/branch/develop?svg=true&passingText=develop%20-%20passing&pendingText=develop%20-%20pending&failingText=develop%20-%20FAILED)](https://ci.appveyor.com/project/MichaeIDietrich/SmartMvvm.Xaml/branch/develop)

Introduction
-------------

SmartMvvm.Xaml contains a set of useful markup extensions and other objects to simplify writing WPF XAML code without the need of code behind or unnecessary UI behavior logic in view model code.
SmartMvvm.Xaml contains a set of useful markup extensions and other objects to simplify writing **WPF** and **Avalonia** XAML code without the need of code behind or unnecessary UI behavior logic in view model code.

- Supported are projects using .NET Framework 4.5+ or .NET Core 3.0+
- Supported are projects using at least .NET Framework 4.5 or at least .NET Core 3.1 for **WPF** and at least .NET Standard 2.0 for **Avalonia**.

Getting Started
-------------------

To use these XAML utilities in your project, simply install the [SmartMvvm.Xaml](https://www.nuget.org/packages/SmartMvvm.Xaml) NuGet package to your project.
To use these XAML utilities in your project, simply install the [SmartMvvm.Xaml (WPF)](https://www.nuget.org/packages/SmartMvvm.Xaml) or [SmartMvvm.Avalonia.Xaml (Avalonia)](https://www.nuget.org/packages/SmartMvvm.Xaml) NuGet package to your project.

Check out the [sample application](https://github.com/FrecherxDachs/SmartMvvm.Xaml/tree/develop/src/SmartMvvm.Xaml.Sample) to see how you can use these utilities in your project.
Check out the [sample application (WPF)](https://github.com/MichaeIDietrich/SmartMvvm.Xaml/tree/develop/src/SmartMvvm.Xaml.Sample) or [sample application (Avalonia)](https://github.com/MichaeIDietrich/SmartMvvm.Xaml/tree/develop/src/SmartMvvm.Avalonia.Xaml.Sample) to see how you can use these utilities in your project.

Samples
-------
Expand Down
132 changes: 132 additions & 0 deletions src/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
###############################
# Core EditorConfig Options #
###############################
# All files
[*]
indent_style = space

# XML project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2

# XML config files
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
indent_size = 2

# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4
insert_final_newline = true
charset = utf-8-bom
###############################
# .NET Coding Conventions #
###############################
[*.{cs,vb}]
# Organize usings
dotnet_sort_system_directives_first = true
# this. preferences
dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_property = false:silent
dotnet_style_qualification_for_method = false:silent
dotnet_style_qualification_for_event = false:silent
# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
dotnet_style_predefined_type_for_member_access = true:silent
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
dotnet_style_readonly_field = true:suggestion
# Expression-level preferences
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
###############################
# Naming Conventions #
###############################
# Style Definitions
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# Use PascalCase for constant fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
dotnet_naming_symbols.constant_fields.required_modifiers = const
###############################
# C# Coding Conventions #
###############################
[*.cs]
# var preferences
csharp_style_var_for_built_in_types = true:silent
csharp_style_var_when_type_is_apparent = true:silent
csharp_style_var_elsewhere = true:silent
# Expression-bodied members
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
# Pattern matching preferences
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
# Null-checking preferences
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
# Modifier preferences
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
# Expression-level preferences
csharp_prefer_braces = true:silent
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_pattern_local_over_anonymous_function = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
###############################
# C# Formatting Rules #
###############################
# New line preferences
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = flush_left
# Space preferences
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_around_binary_operators = before_and_after
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
# Wrapping preferences
csharp_preserve_single_line_statements = true
csharp_preserve_single_line_blocks = true
###############################
# VB Coding Conventions #
###############################
[*.vb]
# Modifier preferences
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
18 changes: 18 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project>

<PropertyGroup>
<VersionPrefix>2.0.0</VersionPrefix>
<Copyright>Copyright © $([System.DateTime]::Now.Year) Michael Dietrich</Copyright>
<PackageProjectUrl>https://github.com/MichaeIDietrich/SmartMvvm.Xaml</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/MichaeIDietrich/SmartMvvm.Xaml</RepositoryUrl>
<Authors>Michael Dietrich</Authors>
<PackageReadmeFile>readme.md</PackageReadmeFile>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

</Project>
7 changes: 7 additions & 0 deletions src/SmartMvvm.Avalonia.Xaml.Sample/App.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="SmartMvvm.Avalonia.Xaml.Sample.App">
<Application.Styles>
<FluentTheme Mode="Light"/>
</Application.Styles>
</Application>
24 changes: 24 additions & 0 deletions src/SmartMvvm.Avalonia.Xaml.Sample/App.axaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;

namespace SmartMvvm.Avalonia.Xaml.Sample
{
public partial class App : Application
{
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
}

public override void OnFrameworkInitializationCompleted()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
desktop.MainWindow = new MainWindow();
}

base.OnFrameworkInitializationCompleted();
}
}
}
Loading

0 comments on commit adbbc6e

Please sign in to comment.