migration
All checks were successful
All checks were successful
This commit is contained in:
22
SimpleToolkit.UI.WinUI.Converters/ObjectToIntConverter.cs
Normal file
22
SimpleToolkit.UI.WinUI.Converters/ObjectToIntConverter.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SimpleToolkit.UI.WinUI.Converters
|
||||
{
|
||||
public class ObjectToIntConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
return (int)value;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
19
SimpleToolkit.UI.WinUI.Converters/ObjectToStringConverter.cs
Normal file
19
SimpleToolkit.UI.WinUI.Converters/ObjectToStringConverter.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SimpleToolkit.UI.WinUI.Converters
|
||||
{
|
||||
public class ObjectToStringConverter : IValueConverter
|
||||
{
|
||||
#region METHODS
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, string language) => value.ToString();
|
||||
public object ConvertBack(object value, Type targetType, object parameter, string language) => throw new NotImplementedException();
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
57
SimpleToolkit.UI.WinUI.Converters/README.md
Normal file
57
SimpleToolkit.UI.WinUI.Converters/README.md
Normal file
@@ -0,0 +1,57 @@
|
||||
# SimpleToolkit.UI.WinUI.Converters
|
||||
|
||||
### Set of helpers, class extensions, UI controls used in my other C# projects
|
||||
|
||||
SimpleToolkit is package of useful classes, helpers, extensions and UI controls, I use in my C# projects. UI.WinUI.Converters subpackage contains XAML value converters for WinUI applications.
|
||||
|
||||
---
|
||||
|
||||
## NuGet registry status
|
||||
|
||||
| Subpackage | Status |
|
||||
|--------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| **SimpleToolkit.UI.WinUI.Converters** | [](https://www.nuget.org/packages/SimpleToolkit.UI.WinUI.Converters/) |
|
||||
| SimpleToolkit.Extensions | [](https://www.nuget.org/packages/SimpleToolkit.Extensions/) |
|
||||
| SimpleToolkit.Attributes | [](https://www.nuget.org/packages/SimpleToolkit.Attributes/) |
|
||||
| SimpleToolkit.MVVM | [](https://www.nuget.org/packages/SimpleToolkit.MVVM/) |
|
||||
| SimpleToolkit.UI.Models | [](https://www.nuget.org/packages/SimpleToolkit.UI.Models/) |
|
||||
| SimpleToolkit.UI.WinUI.Behaviors | [](https://www.nuget.org/packages/SimpleToolkit.UI.WinUI.Behaviors/) |
|
||||
| SimpleToolkit.UI.WinUI.Controls | [](https://www.nuget.org/packages/SimpleToolkit.UI.WinUI.Controls/) |
|
||||
| SimpleToolkit.UI.WinUI.Helpers | [](https://www.nuget.org/packages/SimpleToolkit.UI.WinUI.Helpers/) |
|
||||
|
||||
## Features
|
||||
|
||||
- **ObjectToIntConverter** - converts any object to int (e.g. enums)
|
||||
- **ObjectToStringConverter** - converts any object to string
|
||||
|
||||
## Dependencies
|
||||
|
||||
Dependencies should be installed automatically with this package
|
||||
|
||||
- Microsoft.WindowsAppSDK 1.4.240211001
|
||||
|
||||
## Installation and usage
|
||||
|
||||
You can download package from official NuGet registry or .nupkg file itself from Releases tab.
|
||||
|
||||
**CLI:**
|
||||
|
||||
```
|
||||
dotnet add package SimpleToolkit.UI.WinUI.Converters
|
||||
```
|
||||
|
||||
**Package reference in .csproj file:**
|
||||
|
||||
```
|
||||
<PackageReference Include="SimpleToolkit.UI.WinUI.Converters" Version="<version>" />
|
||||
```
|
||||
|
||||
## Attribution and contribution
|
||||
|
||||
This project is open source on MIT License, so you can just copy and upload again to your repository. But according to the license, you must include information about the original author. You can find license [here](https://repos.mateuszskoczek.com/SimpleToolkit/SimpleToolkit.UI.WinUI.Converters/src/branch/main/LICENSE).
|
||||
|
||||
However, the preferred way to contribute would be to propose improvements in a pull request, through issues, or through other means of communication.
|
||||
|
||||
**Other sources:**
|
||||
|
||||
- Icon by [Icons8](icons8.com)
|
||||
@@ -0,0 +1,40 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
|
||||
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
|
||||
<RootNamespace>SimpleToolkit.UI.WinUI.Converters</RootNamespace>
|
||||
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
|
||||
<UseWinUI>true</UseWinUI>
|
||||
<UseRidGraph>true</UseRidGraph>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
<EnableCoreMrtTooling Condition=" '$(BuildingInsideVisualStudio)' != 'true' ">false</EnableCoreMrtTooling>
|
||||
<Nullable>enable</Nullable>
|
||||
<Title>SimpleToolkit.UI.WinUI.Converters</Title>
|
||||
<Authors>Mateusz Skoczek</Authors>
|
||||
<Copyright>Mateusz Skoczek</Copyright>
|
||||
<PackageProjectUrl>https://repos.mateuszskoczek.com/SimpleToolkit/</PackageProjectUrl>
|
||||
<PackageLicenseUrl>https://repos.mateuszskoczek.com/SimpleToolkit/SimpleToolkit.UI.WinUI.Converters/src/branch/main/LICENSE</PackageLicenseUrl>
|
||||
<PackageIcon>icon.png</PackageIcon>
|
||||
<RepositoryUrl>https://repos.mateuszskoczek.com/SimpleToolkit/SimpleToolkit.UI.WinUI.Converters</RepositoryUrl>
|
||||
<Description>Set of helpers, class extensions, UI controls used in my other C# projects - XAML value converters for WinUI applications</Description>
|
||||
<EnableWindowsTargeting>true</EnableWindowsTargeting>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="icon.png">
|
||||
<Pack>True</Pack>
|
||||
<PackagePath></PackagePath>
|
||||
</None>
|
||||
<None Update="README.md">
|
||||
<Pack>True</Pack>
|
||||
<PackagePath></PackagePath>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.240211001" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
</Project>
|
||||
BIN
SimpleToolkit.UI.WinUI.Converters/icon.png
Normal file
BIN
SimpleToolkit.UI.WinUI.Converters/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.7 KiB |
Reference in New Issue
Block a user