This commit is contained in:
Javier Suárez Ruiz 2022-04-26 10:39:15 +02:00
Родитель 3d79ee836e
Коммит 4c81ef79c8
29 изменённых файлов: 128 добавлений и 139 удалений

Просмотреть файл

@ -13,9 +13,9 @@
<PropertyGroup>
<Summary>Library to draw MAUI controls.</Summary>
<PackageTag>xamarin,ios,android,uwp,xamarin.forms,controls,watchos,tvos,tizen,draw</PackageTag>
<Description>Library to draw MAUI controls.</Description>
<Description>Library to draw .NET MAUI controls.</Description>
<Company>Microsoft</Company>
<Product>Microsoft MAUI Graphics Controls</Product>
<Product>Microsoft .NET MAUI Graphics Controls</Product>
<Authors>Microsoft</Authors>
<Owners>microsoft</Owners>
<NeutralLanguage>en</NeutralLanguage>

Просмотреть файл

@ -1,90 +1,89 @@
<Project>
<ItemGroup Condition="$(TargetFramework.StartsWith('Xamarin.iOS')) != true AND $(TargetFramework.StartsWith('net6.0-ios')) != true AND $(TargetFramework.StartsWith('net6.0-maccatalyst')) != true ">
<Compile Remove="**\**\*.iOS.cs" />
<None Include="**\**\*.iOS.cs" />
<Compile Remove="**\iOS\**\*.cs" />
<None Include="**\iOS\**\*.cs" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('Xamarin.Mac')) != true ">
<Compile Remove="**\*.Mac.cs" />
<None Include="**\*.Mac.cs" />
<Compile Remove="**\Mac\**\*.cs" />
<None Include="**\Mac\**\*.cs" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('Xamarin.Mac')) != true AND $(TargetFramework.StartsWith('Xamarin.iOS')) != true AND $(TargetFramework.StartsWith('net6.0-ios')) != true AND $(TargetFramework.StartsWith('net6.0-maccatalyst')) != true">
<Compile Remove="**\*.MaciOS.cs" />
<None Include="**\*.MaciOS.cs" />
<Compile Remove="**\MaciOS\**\*.cs" />
<None Include="**\MaciOS\**\*.cs" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('MonoAndroid')) != true AND $(TargetFramework.StartsWith('net6.0-android')) != true ">
<Compile Remove="**\**\*.Android.cs" />
<None Include="**\**\*.Android.cs" />
<Compile Remove="**\Android\**\*.cs" />
<None Include="**\Android\**\*.cs" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard')) != true ">
<Compile Remove="**\*.Standard.cs" />
<None Include="**\*.Standard.cs" />
<Compile Remove="**\Standard\**\*.cs" />
<None Include="**\Standard\**\*.cs" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.Contains('-windows')) != true ">
<Compile Remove="**\*.Windows.cs" />
<None Include="**\*.Windows.cs" />
<Compile Remove="**\Windows\**\*.cs" />
<None Include="**\Windows\**\*.cs" />
<Compile Remove="**\*.uwp.cs" />
<None Include="**\*.uwp.cs" />
<MauiXaml Remove="**\*.Windows.xaml" />
<None Include="**\*.Windows.xaml" />
<Compile Remove="**\*.Windows.xaml.cs" />
<None Include="**\*.Windows.xaml.cs" />
<MauiXaml Remove="**\Windows\**\*.xaml" />
<None Include="**\Windows\**\*.xaml" />
<Compile Remove="**\Windows\**\*.xaml.cs" />
<None Include="**\Windows\**\*.xaml.cs" />
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('uap10.0')) ">
<Compile Remove="**\*.uwp.cs" />
<None Include="**\*.uwp.cs" />
</ItemGroup>
<ItemGroup>
<Compile Remove="bin\**;obj\**" />
<None Remove="bin\**;obj\**" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('Xamarin.iOS')) != true AND $(TargetFramework.StartsWith('net6.0-ios')) != true AND $(TargetFramework.StartsWith('net6.0-maccatalyst')) != true ">
<Compile Remove="**\**\*.iOS.cs" />
<None Include="**\**\*.iOS.cs" />
<Compile Remove="**\iOS\**\*.cs" />
<None Include="**\iOS\**\*.cs" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('Xamarin.Mac')) != true ">
<Compile Remove="**\*.Mac.cs" />
<None Include="**\*.Mac.cs" />
<Compile Remove="**\Mac\**\*.cs" />
<None Include="**\Mac\**\*.cs" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('Xamarin.Mac')) != true AND $(TargetFramework.StartsWith('Xamarin.iOS')) != true AND $(TargetFramework.StartsWith('net6.0-ios')) != true AND $(TargetFramework.StartsWith('net6.0-maccatalyst')) != true">
<Compile Remove="**\*.MaciOS.cs" />
<None Include="**\*.MaciOS.cs" />
<Compile Remove="**\MaciOS\**\*.cs" />
<None Include="**\MaciOS\**\*.cs" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('MonoAndroid')) != true AND $(TargetFramework.StartsWith('net6.0-android')) != true ">
<Compile Remove="**\**\*.Android.cs" />
<None Include="**\**\*.Android.cs" />
<Compile Remove="**\Android\**\*.cs" />
<None Include="**\Android\**\*.cs" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard')) != true ">
<Compile Remove="**\*.Standard.cs" />
<None Include="**\*.Standard.cs" />
<Compile Remove="**\Standard\**\*.cs" />
<None Include="**\Standard\**\*.cs" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.Contains('-windows')) != true ">
<Compile Remove="**\*.Windows.cs" />
<None Include="**\*.Windows.cs" />
<Compile Remove="**\Windows\**\*.cs" />
<None Include="**\Windows\**\*.cs" />
<Compile Remove="**\*.uwp.cs" />
<None Include="**\*.uwp.cs" />
<MauiXaml Remove="**\*.Windows.xaml" />
<None Include="**\*.Windows.xaml" />
<Compile Remove="**\*.Windows.xaml.cs" />
<None Include="**\*.Windows.xaml.cs" />
<MauiXaml Remove="**\Windows\**\*.xaml" />
<None Include="**\Windows\**\*.xaml" />
<Compile Remove="**\Windows\**\*.xaml.cs" />
<None Include="**\Windows\**\*.xaml.cs" />
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('uap10.0')) ">
<Compile Remove="**\*.uwp.cs" />
<None Include="**\*.uwp.cs" />
</ItemGroup>
<ItemGroup>
<Compile Remove="bin\**;obj\**" />
<None Remove="bin\**;obj\**" />
</ItemGroup>
<!-- Android -->
<PropertyGroup Condition="$(TargetFramework.StartsWith('net6.0-android'))">
<DefineConstants>$(DefineConstants);MONOANDROID</DefineConstants>
</PropertyGroup>
<!-- Android -->
<PropertyGroup Condition="$(TargetFramework.StartsWith('net6.0-android'))">
<DefineConstants>$(DefineConstants);MONOANDROID</DefineConstants>
</PropertyGroup>
<!-- iOS -->
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0-ios' ">
<DefineConstants>$(DefineConstants);IOS</DefineConstants>
</PropertyGroup>
<!-- iOS -->
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0-ios' ">
<DefineConstants>$(DefineConstants);IOS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0-maccatalyst' ">
<DefineConstants>$(DefineConstants);MACCATALYST;IOS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0-maccatalyst' ">
<DefineConstants>$(DefineConstants);MACCATALYST;IOS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard2.0|AnyCPU'">
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.Contains('-windows')) == true ">
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<DefineConstants>WINDOWS;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" $(TargetFramework.StartsWith('uap10.0')) ">
<DefineConstants>WINDOWS_UWP;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<ItemGroup Condition="$(TargetFramework.Contains('-windows')) == true ">
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.0.0.30" />
<PackageReference Include="Microsoft.Maui.Graphics.Win2D.WinUI.Desktop" Version="6.0.200-preview.14.1079" />
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard2.0|AnyCPU'">
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.Contains('-windows')) == true ">
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<DefineConstants>WINDOWS;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" $(TargetFramework.StartsWith('uap10.0')) ">
<DefineConstants>WINDOWS_UWP;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<ItemGroup Condition="$(TargetFramework.Contains('-windows')) == true ">
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.0.1" />
<PackageReference Include="Microsoft.Maui.Graphics.Win2D.WinUI.Desktop" Version="6.0.300-rc.3.1315" />
</ItemGroup>
</Project>

Просмотреть файл

@ -30,14 +30,14 @@ namespace GraphicsControls.Sample.Controls
LinearGradientPaint linearGradientPaint = new LinearGradientPaint
{
GradientStops = new Microsoft.Maui.Graphics.GradientStop[]
GradientStops = new PaintGradientStop[]
{
new Microsoft.Maui.Graphics.GradientStop(0.0f, new Color(255, 0, 0)),
new Microsoft.Maui.Graphics.GradientStop(0.2f, new Color(255, 255, 0)),
new Microsoft.Maui.Graphics.GradientStop(0.4f, new Color(0, 255, 0)),
new Microsoft.Maui.Graphics.GradientStop(0.6f, new Color(0, 255, 255)),
new Microsoft.Maui.Graphics.GradientStop(0.8f, new Color(255, 0, 255)),
new Microsoft.Maui.Graphics.GradientStop(1.0f, new Color(255, 0, 0))
new PaintGradientStop(0.0f, new Color(255, 0, 0)),
new PaintGradientStop(0.2f, new Color(255, 255, 0)),
new PaintGradientStop(0.4f, new Color(0, 255, 0)),
new PaintGradientStop(0.6f, new Color(0, 255, 255)),
new PaintGradientStop(0.8f, new Color(255, 0, 255)),
new PaintGradientStop(1.0f, new Color(255, 0, 0))
}
};

Просмотреть файл

@ -46,8 +46,8 @@
<ItemGroup Condition="$(TargetFramework.Contains('-windows'))">
<!-- Required - WinUI does not yet have buildTransitive for everything -->
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.0" />
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.0.0.30" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.3" />
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.0.1" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -13,7 +13,7 @@
<PackageId>Microsoft.Maui.Graphics.Controls</PackageId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Maui.Graphics" Version="6.0.200-preview.14.1079" />
<PackageReference Include="Microsoft.Maui.Graphics" Version="6.0.300-rc.3.1315" />
</ItemGroup>
<Import Project="..\..\Microsoft.Maui.Graphics.Controls.MultiTargeting.targets" />
</Project>

Просмотреть файл

@ -1,5 +1,5 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Essentials;
using Microsoft.Maui.ApplicationModel;
namespace Microsoft.Maui.Graphics.Controls
{
@ -29,10 +29,10 @@ namespace Microsoft.Maui.Graphics.Controls
var fill = new LinearGradientPaint
{
GradientStops = new GradientStop[]
GradientStops = new PaintGradientStop[]
{
new GradientStop(0.0f, backgroundColor.Lighter()),
new GradientStop(0.9f, backgroundColor.Darker())
new PaintGradientStop(0.0f, backgroundColor.Lighter()),
new PaintGradientStop(0.9f, backgroundColor.Darker())
},
StartPoint = new Point(0, 0),
EndPoint = new Point(0, 1)

Просмотреть файл

@ -1,6 +1,6 @@
using Microsoft.Maui.Animations;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Essentials;
using Microsoft.Maui.ApplicationModel;
namespace Microsoft.Maui.Graphics.Controls
{

Просмотреть файл

@ -1,5 +1,5 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Essentials;
using Microsoft.Maui.ApplicationModel;
using Microsoft.Maui.Controls;
namespace Microsoft.Maui.Graphics.Controls
{

Просмотреть файл

@ -1,5 +1,5 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Essentials;
using Microsoft.Maui.ApplicationModel;
namespace Microsoft.Maui.Graphics.Controls
{

Просмотреть файл

@ -1,5 +1,5 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Essentials;
using Microsoft.Maui.ApplicationModel;
namespace Microsoft.Maui.Graphics.Controls
{

Просмотреть файл

@ -1,5 +1,5 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Essentials;
using Microsoft.Maui.ApplicationModel;
namespace Microsoft.Maui.Graphics.Controls
{

Просмотреть файл

@ -1,4 +1,5 @@
using System;
#nullable disable
using System;
using System.Collections.Generic;
namespace Microsoft.Maui.Graphics.Controls
@ -48,7 +49,7 @@ namespace Microsoft.Maui.Graphics.Controls
Chained = chained;
}
public DrawMapper? Chained { get; set; }
public DrawMapper Chained { get; set; }
public Action<ICanvas, RectF, TViewDrawable, TVirtualView> this[string key]
{
@ -56,7 +57,7 @@ namespace Microsoft.Maui.Graphics.Controls
value?.Invoke(canvas, rect, (TViewDrawable)drawable, (TVirtualView)virtualView);
}
public override Action<ICanvas, RectF, IViewDrawable, IView>? Get(string key)
public override Action<ICanvas, RectF, IViewDrawable, IView> Get(string key)
{
if (genericMap.TryGetValue(key, out var action))
return action;

Просмотреть файл

@ -10,8 +10,6 @@ namespace Microsoft.Maui.Graphics.Controls
{
public partial class EditorHandler : MixedGraphicsControlHandler<IEditorDrawable, IEditor, GraphicsEditor>
{
static ColorStateList? DefaultTextColors { get; set; }
EditorFocusChangeListener FocusChangeListener { get; } = new EditorFocusChangeListener();
protected override GraphicsEditor CreatePlatformView()
@ -34,8 +32,6 @@ namespace Microsoft.Maui.Graphics.Controls
else if (Drawable is CupertinoEditorDrawable)
nativeView.SetPadding(12, 12, 0, 0);
DefaultTextColors = nativeView.TextColors;
return nativeView;
}
@ -65,7 +61,7 @@ namespace Microsoft.Maui.Graphics.Controls
public static void MapTextColor(EditorHandler handler, IEditor editor)
{
handler.PlatformView?.UpdateTextColor(editor, DefaultTextColors);
handler.PlatformView?.UpdateTextColor(editor);
}
public static void MapCharacterSpacing(EditorHandler handler, IEditor editor)

Просмотреть файл

@ -1,5 +1,5 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Essentials;
using Microsoft.Maui.ApplicationModel;
namespace Microsoft.Maui.Graphics.Controls
{

Просмотреть файл

@ -1,6 +1,6 @@
using Microsoft.Maui.Animations;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Essentials;
using Microsoft.Maui.ApplicationModel;
namespace Microsoft.Maui.Graphics.Controls
{

Просмотреть файл

@ -12,8 +12,6 @@ namespace Microsoft.Maui.Graphics.Controls
{
public partial class EntryHandler : MixedGraphicsControlHandler<IEntryDrawable, IEntry, GraphicsEntry>
{
static ColorStateList? DefaultTextColors { get; set; }
TextWatcher Watcher { get; } = new TextWatcher();
EditorActionListener ActionListener { get; } = new EditorActionListener();
EntryFocusChangeListener FocusChangeListener { get; } = new EntryFocusChangeListener();
@ -32,8 +30,6 @@ namespace Microsoft.Maui.Graphics.Controls
else if (Drawable is CupertinoEntryDrawable)
nativeView.SetPadding(12, 12, 0, 0);
DefaultTextColors = nativeView.TextColors;
return nativeView;
}
@ -130,7 +126,7 @@ namespace Microsoft.Maui.Graphics.Controls
public static void MapTextColor(EntryHandler handler, IEntry entry)
{
handler.PlatformView?.UpdateTextColor(entry, DefaultTextColors);
handler.PlatformView?.UpdateTextColor(entry);
}
public static void MapCursorPosition(EntryHandler handler, IEntry entry)

Просмотреть файл

@ -7,8 +7,6 @@ namespace Microsoft.Maui.Graphics.Controls
{
public partial class EntryHandler : MixedGraphicsControlHandler<IEntryDrawable, IEntry, GraphicsEntry>
{
static UIColor? DefaultTextColor;
protected override GraphicsEntry CreatePlatformView()
{
UIEdgeInsets edgeInsets;
@ -24,8 +22,6 @@ namespace Microsoft.Maui.Graphics.Controls
var nativeView = new GraphicsEntry { GraphicsControl = this, EdgeInsets = edgeInsets };
DefaultTextColor = nativeView.TextColor;
return nativeView;
}
@ -114,7 +110,7 @@ namespace Microsoft.Maui.Graphics.Controls
public static void MapTextColor(EntryHandler handler, IEntry entry)
{
handler.PlatformView?.UpdateTextColor(entry, DefaultTextColor);
handler.PlatformView?.UpdateTextColor(entry);
}
public static void MapCursorPosition(EntryHandler handler, IEntry entry)

Просмотреть файл

@ -1,5 +1,5 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Essentials;
using Microsoft.Maui.ApplicationModel;
namespace Microsoft.Maui.Graphics.Controls
{

Просмотреть файл

@ -1,6 +1,6 @@
using Microsoft.Maui.Animations;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Essentials;
using Microsoft.Maui.ApplicationModel;
namespace Microsoft.Maui.Graphics.Controls
{

Просмотреть файл

@ -1,5 +1,5 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Essentials;
using Microsoft.Maui.ApplicationModel;
namespace Microsoft.Maui.Graphics.Controls
{

Просмотреть файл

@ -1,5 +1,5 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Essentials;
using Microsoft.Maui.ApplicationModel;
namespace Microsoft.Maui.Graphics.Controls
{

Просмотреть файл

@ -1,5 +1,6 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Essentials;
#nullable disable
using Microsoft.Maui.Controls;
using Microsoft.Maui.ApplicationModel;
using System.Collections.Generic;
using GHorizontalAlignment = Microsoft.Maui.Graphics.HorizontalAlignment;
using GVerticalAlignment = Microsoft.Maui.Graphics.VerticalAlignment;

Просмотреть файл

@ -1,5 +1,5 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Essentials;
using Microsoft.Maui.ApplicationModel;
namespace Microsoft.Maui.Graphics.Controls
{

Просмотреть файл

@ -1,6 +1,6 @@
using Microsoft.Maui.Animations;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Essentials;
using Microsoft.Maui.ApplicationModel;
namespace Microsoft.Maui.Graphics.Controls
{

Просмотреть файл

@ -1,5 +1,5 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Essentials;
using Microsoft.Maui.ApplicationModel;
namespace Microsoft.Maui.Graphics.Controls
{

Просмотреть файл

@ -1,6 +1,6 @@
using Microsoft.Maui.Animations;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Essentials;
using Microsoft.Maui.ApplicationModel;
namespace Microsoft.Maui.Graphics.Controls
{

Просмотреть файл

@ -1,5 +1,5 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Essentials;
using Microsoft.Maui.ApplicationModel;
using System;
using System.Globalization;

Просмотреть файл

@ -1,5 +1,5 @@
using Microsoft.Maui.Controls;
using Microsoft.Maui.Essentials;
using Microsoft.Maui.ApplicationModel;
using System;
namespace Microsoft.Maui.Graphics.Controls

Просмотреть файл

@ -1,6 +1,6 @@
using System;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Essentials;
using Microsoft.Maui.ApplicationModel;
namespace Microsoft.Maui.Graphics.Controls
{