committed by
GitHub
676 changed files with 22807 additions and 17212 deletions
@ -1,16 +0,0 @@ |
|||||
<Project> |
|
||||
<ItemGroup Condition="'$(AndroidApplication)' == 'true'"> |
|
||||
<!-- WORKAROUND: The packages below are transitively referenced by System.Memory, |
|
||||
but Xamarin.Android applications need the newest versions directly referenced for the linker. --> |
|
||||
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.6.0" /> |
|
||||
<PackageReference Include="System.Buffers" Version="4.5.0" /> |
|
||||
</ItemGroup> |
|
||||
<Target Name="_RemoveNonExistingResgenFile" BeforeTargets="CoreCompile" Condition="'$(_SdkSetAndroidResgenFile)' == 'true' And '$(AndroidResgenFile)' != '' And !Exists('$(AndroidResgenFile)')"> |
|
||||
<ItemGroup> |
|
||||
<Compile Remove="$(AndroidResgenFile)"/> |
|
||||
</ItemGroup> |
|
||||
</Target> |
|
||||
<PropertyGroup> |
|
||||
<DesignTimeBuild>false</DesignTimeBuild> |
|
||||
</PropertyGroup> |
|
||||
</Project> |
|
||||
@ -1,5 +1,6 @@ |
|||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<ItemGroup> |
<ItemGroup> |
||||
<PackageReference Include="System.Drawing.Common" Version="4.5.0" /> |
<PackageReference Condition="'$(TargetFramework)'!='netstandard2.0'" Include="System.Drawing.Common" Version="6.0.0" /> |
||||
|
<PackageReference Condition="'$(TargetFramework)'=='netstandard2.0'" Include="System.Drawing.Common" Version="4.5.0" /> |
||||
</ItemGroup> |
</ItemGroup> |
||||
</Project> |
</Project> |
||||
|
|||||
@ -1,19 +0,0 @@ |
|||||
Any raw assets you want to be deployed with your application can be placed in |
|
||||
this directory (and child directories) and given a Build Action of "AndroidAsset". |
|
||||
|
|
||||
These files will be deployed with you package and will be accessible using Android's |
|
||||
AssetManager, like this: |
|
||||
|
|
||||
public class ReadAsset : Activity |
|
||||
{ |
|
||||
protected override void OnCreate (Bundle bundle) |
|
||||
{ |
|
||||
base.OnCreate (bundle); |
|
||||
|
|
||||
InputStream input = Assets.Open ("my_asset.txt"); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
Additionally, some Android functions will automatically load asset files: |
|
||||
|
|
||||
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); |
|
||||
@ -1,165 +1,46 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<Project Sdk="Microsoft.NET.Sdk"> |
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|
||||
<PropertyGroup> |
<PropertyGroup> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
<TargetFramework>net6.0-android</TargetFramework> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion> |
||||
<ProductVersion>8.0.30703</ProductVersion> |
<OutputType>Exe</OutputType> |
||||
<SchemaVersion>2.0</SchemaVersion> |
<Nullable>enable</Nullable> |
||||
<ProjectGuid>{29132311-1848-4FD6-AE0C-4FF841151BD3}</ProjectGuid> |
<ApplicationId>com.Avalonia.ControlCatalog</ApplicationId> |
||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> |
<ApplicationVersion>1</ApplicationVersion> |
||||
<OutputType>Library</OutputType> |
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion> |
||||
<AppDesignerFolder>Properties</AppDesignerFolder> |
<AndroidPackageFormat>apk</AndroidPackageFormat> |
||||
<RootNamespace>ControlCatalog.Android</RootNamespace> |
<MSBuildEnableWorkloadResolver>true</MSBuildEnableWorkloadResolver> |
||||
<AssemblyName>ControlCatalog.Android</AssemblyName> |
|
||||
<FileAlignment>512</FileAlignment> |
|
||||
<AndroidApplication>true</AndroidApplication> |
|
||||
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile> |
|
||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> |
|
||||
<AndroidUseLatestPlatformSdk>False</AndroidUseLatestPlatformSdk> |
|
||||
<TargetFrameworkVersion>v11.0</TargetFrameworkVersion> |
|
||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest> |
|
||||
</PropertyGroup> |
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|
||||
<DebugSymbols>True</DebugSymbols> |
|
||||
<DebugType>full</DebugType> |
|
||||
<Optimize>false</Optimize> |
|
||||
<OutputPath>bin\Debug\</OutputPath> |
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
|
||||
<ErrorReport>prompt</ErrorReport> |
|
||||
<WarningLevel>4</WarningLevel> |
|
||||
<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime> |
|
||||
<AndroidLinkMode>None</AndroidLinkMode> |
|
||||
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk> |
|
||||
<BundleAssemblies>False</BundleAssemblies> |
|
||||
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi> |
|
||||
<AndroidSupportedAbis>armeabi-v7a;x86;x86_64</AndroidSupportedAbis> |
|
||||
<Debugger>Xamarin</Debugger> |
|
||||
<AndroidEnableMultiDex>False</AndroidEnableMultiDex> |
|
||||
<AotAssemblies>False</AotAssemblies> |
|
||||
<EnableLLVM>False</EnableLLVM> |
|
||||
<EnableProguard>False</EnableProguard> |
|
||||
</PropertyGroup> |
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|
||||
<DebugType>pdbonly</DebugType> |
|
||||
<Optimize>true</Optimize> |
|
||||
<OutputPath>bin\Release\</OutputPath> |
|
||||
<DefineConstants>TRACE</DefineConstants> |
|
||||
<ErrorReport>prompt</ErrorReport> |
|
||||
<WarningLevel>4</WarningLevel> |
|
||||
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime> |
|
||||
<AndroidLinkMode>Full</AndroidLinkMode> |
|
||||
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk> |
|
||||
<BundleAssemblies>False</BundleAssemblies> |
|
||||
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi> |
|
||||
<AndroidSupportedAbis>armeabi-v7a,x86;x86_64</AndroidSupportedAbis> |
|
||||
<Debugger>Xamarin</Debugger> |
|
||||
<AotAssemblies>False</AotAssemblies> |
|
||||
<EnableLLVM>False</EnableLLVM> |
|
||||
<AndroidEnableMultiDex>False</AndroidEnableMultiDex> |
|
||||
<EnableProguard>False</EnableProguard> |
|
||||
<DebugSymbols>False</DebugSymbols> |
|
||||
</PropertyGroup> |
|
||||
<ItemGroup> |
|
||||
<Reference Include="Mono.Android" /> |
|
||||
<Reference Include="mscorlib" /> |
|
||||
<Reference Include="System" /> |
|
||||
<Reference Include="System.Core" /> |
|
||||
<Reference Include="System.Xml.Linq" /> |
|
||||
<Reference Include="System.Xml" /> |
|
||||
</ItemGroup> |
|
||||
<ItemGroup> |
|
||||
<Compile Include="MainActivity.cs" /> |
|
||||
<Compile Include="Resources\Resource.Designer.cs" /> |
|
||||
<Compile Include="Properties\AssemblyInfo.cs" /> |
|
||||
<Compile Include="SplashActivity.cs" /> |
|
||||
</ItemGroup> |
|
||||
<ItemGroup> |
<ItemGroup> |
||||
<None Include="Resources\AboutResources.txt" /> |
<None Remove="Assets\AboutAssets.txt" /> |
||||
<None Include="Assets\AboutAssets.txt" /> |
|
||||
</ItemGroup> |
|
||||
<ItemGroup> |
|
||||
<AndroidResource Include="Resources\drawable\splash_screen.xml" /> |
|
||||
</ItemGroup> |
|
||||
<ItemGroup> |
|
||||
<AndroidResource Include="Resources\values\colors.xml" /> |
|
||||
<AndroidResource Include="Resources\values\styles.xml" /> |
|
||||
</ItemGroup> |
</ItemGroup> |
||||
<ItemGroup> |
<ItemGroup> |
||||
<AndroidResource Include="..\..\build\Assets\Icon.png"> |
<AndroidResource Include="..\..\build\Assets\Icon.png"> |
||||
<Link>Resources\drawable\Icon.png</Link> |
<Link>Resources\drawable\Icon.png</Link> |
||||
</AndroidResource> |
</AndroidResource> |
||||
</ItemGroup> |
</ItemGroup> |
||||
|
|
||||
|
<PropertyGroup Condition="'$(Configuration)'=='Release' and '$(TF_BUILD)' == ''"> |
||||
|
<DebugSymbols>True</DebugSymbols> |
||||
|
<RunAOTCompilation>False</RunAOTCompilation> |
||||
|
<EnableLLVM>True</EnableLLVM> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> |
||||
|
<EmbedAssembliesIntoApk>False</EmbedAssembliesIntoApk> |
||||
|
<RunAOTCompilation>False</RunAOTCompilation> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> |
||||
|
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk> |
||||
|
</PropertyGroup> |
||||
|
|
||||
<ItemGroup> |
<ItemGroup> |
||||
<None Include="Properties\AndroidManifest.xml" /> |
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.3.1.3" /> |
||||
|
<PackageReference Include="Xamarin.AndroidX.Lifecycle.ViewModel" Version="2.3.1.3" /> |
||||
</ItemGroup> |
</ItemGroup> |
||||
|
|
||||
<ItemGroup> |
<ItemGroup> |
||||
<ProjectReference Include="..\..\src\Android\Avalonia.Android\Avalonia.Android.csproj"> |
<ProjectReference Include="..\..\src\Android\Avalonia.Android\Avalonia.Android.csproj" /> |
||||
<Project>{7B92AF71-6287-4693-9DCB-BD5B6E927E23}</Project> |
<ProjectReference Include="..\ControlCatalog\ControlCatalog.csproj" /> |
||||
<Name>Avalonia.Android</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Animation\Avalonia.Animation.csproj"> |
|
||||
<Project>{d211e587-d8bc-45b9-95a4-f297c8fa5200}</Project> |
|
||||
<Name>Avalonia.Animation</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Base\Avalonia.Base.csproj"> |
|
||||
<Project>{b09b78d8-9b26-48b0-9149-d64a2f120f3f}</Project> |
|
||||
<Name>Avalonia.Base</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Controls\Avalonia.Controls.csproj"> |
|
||||
<Project>{d2221c82-4a25-4583-9b43-d791e3f6820c}</Project> |
|
||||
<Name>Avalonia.Controls</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Diagnostics\Avalonia.Diagnostics.csproj"> |
|
||||
<Project>{7062ae20-5dcc-4442-9645-8195bdece63e}</Project> |
|
||||
<Name>Avalonia.Diagnostics</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Input\Avalonia.Input.csproj"> |
|
||||
<Project>{62024b2d-53eb-4638-b26b-85eeaa54866e}</Project> |
|
||||
<Name>Avalonia.Input</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Interactivity\Avalonia.Interactivity.csproj"> |
|
||||
<Project>{6b0ed19d-a08b-461c-a9d9-a9ee40b0c06b}</Project> |
|
||||
<Name>Avalonia.Interactivity</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Layout\Avalonia.Layout.csproj"> |
|
||||
<Project>{42472427-4774-4c81-8aff-9f27b8e31721}</Project> |
|
||||
<Name>Avalonia.Layout</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Themes.Fluent\Avalonia.Themes.Fluent.csproj"> |
|
||||
<Project>{c42d2fc1-a531-4ed4-84b9-89aec7c962fc}</Project> |
|
||||
<Name>Avalonia.Themes.Fluent</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Visuals\Avalonia.Visuals.csproj"> |
|
||||
<Project>{eb582467-6abb-43a1-b052-e981ba910e3a}</Project> |
|
||||
<Name>Avalonia.Visuals</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Styling\Avalonia.Styling.csproj"> |
|
||||
<Project>{f1baa01a-f176-4c6a-b39d-5b40bb1b148f}</Project> |
|
||||
<Name>Avalonia.Styling</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Avalonia.Themes.Default\Avalonia.Themes.Default.csproj"> |
|
||||
<Project>{3e10a5fa-e8da-48b1-ad44-6a5b6cb7750f}</Project> |
|
||||
<Name>Avalonia.Themes.Default</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Markup\Avalonia.Markup.Xaml\Avalonia.Markup.Xaml.csproj"> |
|
||||
<Project>{3e53a01a-b331-47f3-b828-4a5717e77a24}</Project> |
|
||||
<Name>Avalonia.Markup.Xaml</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Markup\Avalonia.Markup\Avalonia.Markup.csproj"> |
|
||||
<Project>{6417e941-21bc-467b-a771-0de389353ce6}</Project> |
|
||||
<Name>Avalonia.Markup</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\src\Skia\Avalonia.Skia\Avalonia.Skia.csproj"> |
|
||||
<Project>{7d2d3083-71dd-4cc9-8907-39a0d86fb322}</Project> |
|
||||
<Name>Avalonia.Skia</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\ControlCatalog\ControlCatalog.csproj"> |
|
||||
<Project>{d0a739b9-3c68-4ba6-a328-41606954b6bd}</Project> |
|
||||
<Name>ControlCatalog</Name> |
|
||||
</ProjectReference> |
|
||||
</ItemGroup> |
</ItemGroup> |
||||
<Import Project="..\..\build\Rx.props" /> |
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" /> |
|
||||
<Import Project="..\..\build\AndroidWorkarounds.props" /> |
|
||||
<Import Project="..\..\build\LegacyProject.targets" /> |
|
||||
</Project> |
</Project> |
||||
|
|||||
@ -1,5 +1,4 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="ControlCatalog.Android" android:versionCode="1" android:versionName="1.0" android:installLocation="auto"> |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto"> |
||||
<uses-sdk android:targetSdkVersion="30" /> |
<application android:label="ControlCatalog.Android" android:icon="@drawable/Icon"></application> |
||||
<application android:label="ControlCatalog.Android"></application> |
</manifest> |
||||
</manifest> |
|
||||
|
|||||
@ -1,30 +0,0 @@ |
|||||
using System.Reflection; |
|
||||
using System.Runtime.CompilerServices; |
|
||||
using System.Runtime.InteropServices; |
|
||||
using Android.App; |
|
||||
|
|
||||
// General Information about an assembly is controlled through the following
|
|
||||
// set of attributes. Change these attribute values to modify the information
|
|
||||
// associated with an assembly.
|
|
||||
[assembly: AssemblyTitle("ControlCatalog.Android")] |
|
||||
[assembly: AssemblyDescription("")] |
|
||||
[assembly: AssemblyConfiguration("")] |
|
||||
[assembly: AssemblyCompany("")] |
|
||||
[assembly: AssemblyProduct("ControlCatalog.Android")] |
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")] |
|
||||
[assembly: AssemblyTrademark("")] |
|
||||
[assembly: AssemblyCulture("")] |
|
||||
[assembly: ComVisible(false)] |
|
||||
|
|
||||
// Version information for an assembly consists of the following four values:
|
|
||||
//
|
|
||||
// Major Version
|
|
||||
// Minor Version
|
|
||||
// Build Number
|
|
||||
// Revision
|
|
||||
//
|
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
|
||||
// by using the '*' as shown below:
|
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
|
||||
[assembly: AssemblyVersion("1.0.0.0")] |
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")] |
|
||||
@ -1,101 +0,0 @@ |
|||||
#pragma warning disable 1591
|
|
||||
//------------------------------------------------------------------------------
|
|
||||
// <auto-generated>
|
|
||||
// This code was generated by a tool.
|
|
||||
//
|
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
|
||||
// the code is regenerated.
|
|
||||
// </auto-generated>
|
|
||||
//------------------------------------------------------------------------------
|
|
||||
|
|
||||
[assembly: global::Android.Runtime.ResourceDesignerAttribute("ControlCatalog.Android.Resource", IsApplication=true)] |
|
||||
|
|
||||
namespace ControlCatalog.Android |
|
||||
{ |
|
||||
|
|
||||
|
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.1.99.62")] |
|
||||
public partial class Resource |
|
||||
{ |
|
||||
|
|
||||
static Resource() |
|
||||
{ |
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues(); |
|
||||
} |
|
||||
|
|
||||
public static void UpdateIdValues() |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
public partial class Attribute |
|
||||
{ |
|
||||
|
|
||||
static Attribute() |
|
||||
{ |
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues(); |
|
||||
} |
|
||||
|
|
||||
private Attribute() |
|
||||
{ |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public partial class Color |
|
||||
{ |
|
||||
|
|
||||
// aapt resource value: 0x7F010000
|
|
||||
public const int splash_background = 2130771968; |
|
||||
|
|
||||
static Color() |
|
||||
{ |
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues(); |
|
||||
} |
|
||||
|
|
||||
private Color() |
|
||||
{ |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public partial class Drawable |
|
||||
{ |
|
||||
|
|
||||
// aapt resource value: 0x7F020000
|
|
||||
public const int Icon = 2130837504; |
|
||||
|
|
||||
// aapt resource value: 0x7F020001
|
|
||||
public const int splash_screen = 2130837505; |
|
||||
|
|
||||
static Drawable() |
|
||||
{ |
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues(); |
|
||||
} |
|
||||
|
|
||||
private Drawable() |
|
||||
{ |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public partial class Style |
|
||||
{ |
|
||||
|
|
||||
// aapt resource value: 0x7F030000
|
|
||||
public const int MyTheme = 2130903040; |
|
||||
|
|
||||
// aapt resource value: 0x7F030001
|
|
||||
public const int MyTheme_NoActionBar = 2130903041; |
|
||||
|
|
||||
// aapt resource value: 0x7F030002
|
|
||||
public const int MyTheme_Splash = 2130903042; |
|
||||
|
|
||||
static Style() |
|
||||
{ |
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues(); |
|
||||
} |
|
||||
|
|
||||
private Style() |
|
||||
{ |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
#pragma warning restore 1591
|
|
||||
@ -1,45 +0,0 @@ |
|||||
<UserControl xmlns="https://github.com/avaloniaui" |
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
||||
x:Class="ControlCatalog.Pages.ButtonPage"> |
|
||||
<StackPanel Orientation="Vertical" Spacing="4"> |
|
||||
<TextBlock Classes="h2">A button control</TextBlock> |
|
||||
|
|
||||
<StackPanel Orientation="Horizontal" |
|
||||
Margin="0,16,0,0" |
|
||||
HorizontalAlignment="Center" |
|
||||
Spacing="16"> |
|
||||
<StackPanel Orientation="Vertical" Spacing="8" Width="200"> |
|
||||
<Button>Standard _XAML Button</Button> |
|
||||
<Button Foreground="White">Foreground</Button> |
|
||||
<Button Background="{DynamicResource SystemAccentColor}">Background</Button> |
|
||||
<Button IsEnabled="False">Disabled</Button> |
|
||||
<Button Content="Re-themed"> |
|
||||
<Button.Styles> |
|
||||
<Style> |
|
||||
<Style.Resources> |
|
||||
<SolidColorBrush x:Key="ThemeBorderMidBrush">Red</SolidColorBrush> |
|
||||
<SolidColorBrush x:Key="ThemeControlHighBrush">DarkRed</SolidColorBrush> |
|
||||
<SolidColorBrush x:Key="ButtonBorderBrush">Red</SolidColorBrush> |
|
||||
<SolidColorBrush x:Key="ButtonBackground">DarkRed</SolidColorBrush> |
|
||||
<SolidColorBrush x:Key="ButtonBackgroundPointerOver">Red</SolidColorBrush> |
|
||||
<SolidColorBrush x:Key="ButtonBackgroundPressed">OrangeRed</SolidColorBrush> |
|
||||
</Style.Resources> |
|
||||
</Style> |
|
||||
</Button.Styles> |
|
||||
</Button> |
|
||||
<RepeatButton Name="RepeatButton"> |
|
||||
<TextBlock Name="RepeatButtonTextBlock" Text="Repeat Button: 0" /> |
|
||||
</RepeatButton> |
|
||||
<ToggleButton Content="Toggle Button"/> |
|
||||
</StackPanel> |
|
||||
|
|
||||
<StackPanel Orientation="Vertical" Spacing="8" Width="150"> |
|
||||
<Button BorderThickness="0">No Border</Button> |
|
||||
<Button BorderBrush="{DynamicResource SystemAccentColor}">Border Color</Button> |
|
||||
<Button BorderBrush="{DynamicResource SystemAccentColor}" BorderThickness="4">Thick Border</Button> |
|
||||
<Button BorderBrush="{DynamicResource SystemAccentColor}" BorderThickness="4" IsEnabled="False">Disabled</Button> |
|
||||
<Button BorderBrush="{DynamicResource SystemAccentColor}" KeyboardNavigation.IsTabStop="False">IsTabStop=False</Button> |
|
||||
</StackPanel> |
|
||||
</StackPanel> |
|
||||
</StackPanel> |
|
||||
</UserControl> |
|
||||
@ -0,0 +1,224 @@ |
|||||
|
<UserControl xmlns="https://github.com/avaloniaui" |
||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
|
x:Class="ControlCatalog.Pages.ButtonsPage"> |
||||
|
|
||||
|
<UserControl.Resources> |
||||
|
|
||||
|
<MenuFlyout x:Key="SharedMenuFlyout" |
||||
|
Placement="Bottom"> |
||||
|
<MenuItem Header="Item 1"> |
||||
|
<MenuItem Header="Subitem 1" /> |
||||
|
<MenuItem Header="Subitem 2" /> |
||||
|
<MenuItem Header="Subitem 3" /> |
||||
|
</MenuItem> |
||||
|
<MenuItem Header="Item 2" |
||||
|
InputGesture="Ctrl+A" /> |
||||
|
<MenuItem Header="Item 3" /> |
||||
|
</MenuFlyout> |
||||
|
|
||||
|
</UserControl.Resources> |
||||
|
|
||||
|
<UserControl.Styles > |
||||
|
|
||||
|
<Style Selector="Border.header-border"> |
||||
|
<Setter Property="Background"> |
||||
|
<Setter.Value> |
||||
|
<SolidColorBrush Color="Gray" Opacity="0.5" /> |
||||
|
</Setter.Value> |
||||
|
</Setter> |
||||
|
<Setter Property="BorderBrush" Value="Gray" /> |
||||
|
<Setter Property="BorderThickness" Value="0.5" /> |
||||
|
<Setter Property="CornerRadius" Value="5,5,0,0" /> |
||||
|
<Setter Property="MaxWidth" Value="450" /> |
||||
|
<Setter Property="Padding" Value="10" /> |
||||
|
</Style> |
||||
|
|
||||
|
<Style Selector="TextBlock.header"> |
||||
|
<Setter Property="FontSize" Value="18" /> |
||||
|
<Setter Property="FontWeight" Value="Bold" /> |
||||
|
</Style> |
||||
|
|
||||
|
<Style Selector="Border.thin"> |
||||
|
<Setter Property="BorderBrush" Value="Gray" /> |
||||
|
<Setter Property="BorderThickness" Value="0.5" /> |
||||
|
<Setter Property="CornerRadius" Value="0,0,5,5" /> |
||||
|
<Setter Property="Margin" Value="0,0,0,15" /> |
||||
|
</Style> |
||||
|
|
||||
|
</UserControl.Styles> |
||||
|
|
||||
|
<!-- Styles and overall page design based on AcrylicPage --> |
||||
|
|
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Width="450"> |
||||
|
|
||||
|
<!-- Button --> |
||||
|
<Border Classes="header-border"> |
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="4"> |
||||
|
<TextBlock Text="Button" Classes="header" /> |
||||
|
<TextBlock TextWrapping="Wrap">A standard button control</TextBlock> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
|
||||
|
<Border Classes="thin" |
||||
|
Padding="15"> |
||||
|
<StackPanel Orientation="Horizontal" |
||||
|
HorizontalAlignment="Center" |
||||
|
Spacing="10"> |
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="8" |
||||
|
Width="200"> |
||||
|
<Button>Standard _XAML Button</Button> |
||||
|
<Button Foreground="White">Foreground</Button> |
||||
|
<Button Background="{DynamicResource SystemAccentColor}">Background</Button> |
||||
|
<Button IsEnabled="False">Disabled</Button> |
||||
|
<Button Content="Re-themed"> |
||||
|
<Button.Styles> |
||||
|
<Style> |
||||
|
<Style.Resources> |
||||
|
<SolidColorBrush x:Key="ThemeBorderMidBrush">Red</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="ThemeControlHighBrush">DarkRed</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="ButtonBorderBrush">Red</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="ButtonBackground">DarkRed</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="ButtonBackgroundPointerOver">Red</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="ButtonBackgroundPressed">OrangeRed</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="ButtonForeground">White</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="ButtonForegroundPointerOver">Black</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="ButtonForegroundPressed">Black</SolidColorBrush> |
||||
|
</Style.Resources> |
||||
|
</Style> |
||||
|
</Button.Styles> |
||||
|
</Button> |
||||
|
</StackPanel> |
||||
|
|
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="8" |
||||
|
Width="200"> |
||||
|
<Button BorderThickness="0">No Border</Button> |
||||
|
<Button BorderBrush="{DynamicResource SystemAccentColor}">Border Color</Button> |
||||
|
<Button BorderBrush="{DynamicResource SystemAccentColor}" |
||||
|
BorderThickness="4">Thick Border</Button> |
||||
|
<Button BorderBrush="{DynamicResource SystemAccentColor}" |
||||
|
BorderThickness="4" |
||||
|
IsEnabled="False">Disabled</Button> |
||||
|
<Button BorderBrush="{DynamicResource SystemAccentColor}" |
||||
|
KeyboardNavigation.IsTabStop="False">IsTabStop=False</Button> |
||||
|
</StackPanel> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
|
||||
|
<!-- ToggleButton --> |
||||
|
<Border Classes="header-border"> |
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="4"> |
||||
|
<TextBlock Text="ToggleButton" |
||||
|
Classes="header" /> |
||||
|
<TextBlock TextWrapping="Wrap">A button control with multiple states: checked, unchecked or indeterminate.</TextBlock> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
|
||||
|
<Border Classes="thin" |
||||
|
Padding="15"> |
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="8"> |
||||
|
<ToggleButton Content="Toggle Button" /> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
|
||||
|
<!-- RepeatButton --> |
||||
|
<Border Classes="header-border"> |
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="4"> |
||||
|
<TextBlock Text="RepeatButton" |
||||
|
Classes="header" /> |
||||
|
<TextBlock TextWrapping="Wrap">A button control that raises its Click event repeatedly when it is pressed and held.</TextBlock> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
|
||||
|
<Border Classes="thin" |
||||
|
Padding="15"> |
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="8"> |
||||
|
<RepeatButton Name="RepeatButton"> |
||||
|
<TextBlock Name="RepeatButtonTextBlock" |
||||
|
Text="Repeat Button: 0" /> |
||||
|
</RepeatButton> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
|
||||
|
<!-- SplitButton --> |
||||
|
<Border Classes="header-border"> |
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="4"> |
||||
|
<TextBlock Text="SplitButton" |
||||
|
Classes="header" /> |
||||
|
<TextBlock TextWrapping="Wrap">A button with primary and secondary parts that can each be pressed separately. The primary part behaves like a Button and the secondary part opens a flyout.</TextBlock> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
|
||||
|
<Border Classes="thin" |
||||
|
Padding="15"> |
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="8"> |
||||
|
<SplitButton Flyout="{StaticResource SharedMenuFlyout}"> |
||||
|
<TextBlock Text="Content" /> |
||||
|
</SplitButton> |
||||
|
<SplitButton IsEnabled="False" |
||||
|
Flyout="{StaticResource SharedMenuFlyout}"> |
||||
|
<TextBlock Text="Disabled" /> |
||||
|
</SplitButton> |
||||
|
<SplitButton Flyout="{StaticResource SharedMenuFlyout}" |
||||
|
Content="Re-themed"> |
||||
|
<SplitButton.Styles> |
||||
|
<Style> |
||||
|
<Style.Resources> |
||||
|
<x:Double x:Key="SplitButtonSeparatorWidth">1.5</x:Double> |
||||
|
<Thickness x:Key="SplitButtonBorderThemeThickness">2</Thickness> |
||||
|
<SolidColorBrush x:Key="SplitButtonBorderBrush">Red</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="SplitButtonBorderBrushPointerOver">Red</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="SplitButtonBorderBrushPressed">Red</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="SplitButtonBackground">DarkRed</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="SplitButtonBackgroundPointerOver">Red</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="SplitButtonBackgroundPressed">OrangeRed</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="SplitButtonForeground">White</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="SplitButtonForegroundPointerOver">Black</SolidColorBrush> |
||||
|
<SolidColorBrush x:Key="SplitButtonForegroundPressed">Black</SolidColorBrush> |
||||
|
</Style.Resources> |
||||
|
</Style> |
||||
|
</SplitButton.Styles> |
||||
|
</SplitButton> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
|
||||
|
<!-- ToggleSplitButton --> |
||||
|
<Border Classes="header-border"> |
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="4"> |
||||
|
<TextBlock Text="ToggleSplitButton" |
||||
|
Classes="header" /> |
||||
|
<TextBlock TextWrapping="Wrap">A button with primary and secondary parts that can each be pressed separately. The primary part behaves like a ToggleButton with two states and the secondary part opens a flyout.</TextBlock> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
|
||||
|
<Border Classes="thin" |
||||
|
Padding="15"> |
||||
|
<StackPanel Orientation="Vertical" |
||||
|
Spacing="8"> |
||||
|
<ToggleSplitButton Flyout="{StaticResource SharedMenuFlyout}"> |
||||
|
<TextBlock Text="Content" /> |
||||
|
</ToggleSplitButton> |
||||
|
<ToggleSplitButton IsChecked="True" |
||||
|
Flyout="{StaticResource SharedMenuFlyout}"> |
||||
|
<TextBlock Text="Content" /> |
||||
|
</ToggleSplitButton> |
||||
|
<ToggleSplitButton IsChecked="True" |
||||
|
IsEnabled="False" |
||||
|
Flyout="{StaticResource SharedMenuFlyout}"> |
||||
|
<TextBlock Text="Disabled" /> |
||||
|
</ToggleSplitButton> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
|
||||
|
</StackPanel> |
||||
|
</UserControl> |
||||
@ -1,77 +1,95 @@ |
|||||
<UserControl xmlns="https://github.com/avaloniaui" |
<UserControl |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
x:Class="ControlCatalog.Pages.ComboBoxPage" |
||||
x:Class="ControlCatalog.Pages.ComboBoxPage" |
xmlns="https://github.com/avaloniaui" |
||||
xmlns:sys="using:System" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
xmlns:col="using:System.Collections"> |
xmlns:col="using:System.Collections" |
||||
<StackPanel Orientation="Vertical" Spacing="4"> |
xmlns:sys="using:System"> |
||||
<TextBlock Classes="h2">A drop-down list.</TextBlock> |
<StackPanel Orientation="Vertical" Spacing="4"> |
||||
|
<TextBlock Classes="h2">A drop-down list.</TextBlock> |
||||
|
|
||||
<WrapPanel HorizontalAlignment="Center" Margin="0 16 0 0" |
<StackPanel |
||||
MaxWidth="660"> |
Margin="0,16,0,0" |
||||
<WrapPanel.Styles> |
HorizontalAlignment="Center" |
||||
<Style Selector="ComboBox"> |
Orientation="Horizontal" |
||||
<Setter Property="Width" Value="250" /> |
Spacing="8"> |
||||
<Setter Property="Margin" Value="10" /> |
<WrapPanel |
||||
</Style> |
MaxWidth="660" |
||||
</WrapPanel.Styles> |
Margin="0,16,0,0" |
||||
<ComboBox PlaceholderText="Pick an Item"> |
HorizontalAlignment="Center"> |
||||
<ComboBoxItem>Inline Items</ComboBoxItem> |
<WrapPanel.Styles> |
||||
<ComboBoxItem>Inline Item 2</ComboBoxItem> |
<Style Selector="ComboBox"> |
||||
<ComboBoxItem>Inline Item 3</ComboBoxItem> |
<Setter Property="Width" Value="250" /> |
||||
<ComboBoxItem>Inline Item 4</ComboBoxItem> |
<Setter Property="Margin" Value="10" /> |
||||
</ComboBox> |
</Style> |
||||
|
</WrapPanel.Styles> |
||||
|
|
||||
<ComboBox> |
<ComboBox PlaceholderText="Pick an Item" WrapSelection="{Binding WrapSelection}"> |
||||
<ComboBox.Items> |
<ComboBoxItem>Inline Items</ComboBoxItem> |
||||
<col:ArrayList> |
<ComboBoxItem>Inline Item 2</ComboBoxItem> |
||||
<x:Null /> |
<ComboBoxItem>Inline Item 3</ComboBoxItem> |
||||
<sys:String>Hello</sys:String> |
<ComboBoxItem>Inline Item 4</ComboBoxItem> |
||||
<sys:String>World</sys:String> |
</ComboBox> |
||||
</col:ArrayList> |
|
||||
</ComboBox.Items> |
|
||||
<ComboBox.ItemTemplate> |
|
||||
<DataTemplate> |
|
||||
<Panel> |
|
||||
<TextBlock Text="{Binding}" /> |
|
||||
<TextBlock Text="Null object" IsVisible="{Binding Converter={x:Static ObjectConverters.IsNull}}" /> |
|
||||
</Panel> |
|
||||
</DataTemplate> |
|
||||
</ComboBox.ItemTemplate> |
|
||||
</ComboBox> |
|
||||
|
|
||||
<ComboBox SelectedIndex="0"> |
<ComboBox WrapSelection="{Binding WrapSelection}"> |
||||
<ComboBoxItem> |
<ComboBox.Items> |
||||
<Panel> |
<col:ArrayList> |
||||
<Rectangle Fill="{DynamicResource SystemAccentColor}"/> |
<x:Null /> |
||||
<TextBlock Margin="8">Control Items</TextBlock> |
<sys:String>Hello</sys:String> |
||||
</Panel> |
<sys:String>World</sys:String> |
||||
</ComboBoxItem> |
</col:ArrayList> |
||||
<ComboBoxItem> |
</ComboBox.Items> |
||||
<Ellipse Width="50" Height="50" Fill="Yellow"/> |
<ComboBox.ItemTemplate> |
||||
</ComboBoxItem> |
<DataTemplate> |
||||
<ComboBoxItem> |
<Panel> |
||||
<TextBox Text="TextBox"/> |
<TextBlock Text="{Binding}" /> |
||||
</ComboBoxItem> |
<TextBlock IsVisible="{Binding Converter={x:Static ObjectConverters.IsNull}}" Text="Null object" /> |
||||
</ComboBox> |
</Panel> |
||||
|
</DataTemplate> |
||||
|
</ComboBox.ItemTemplate> |
||||
|
</ComboBox> |
||||
|
|
||||
<ComboBox x:Name="fontComboBox" SelectedIndex="0"> |
<ComboBox SelectedIndex="0" WrapSelection="{Binding WrapSelection}"> |
||||
<ComboBox.ItemTemplate> |
<ComboBoxItem> |
||||
<DataTemplate> |
<Panel> |
||||
<TextBlock Text="{Binding Name}" FontFamily="{Binding}" /> |
<Rectangle Fill="{DynamicResource SystemAccentColor}" /> |
||||
</DataTemplate> |
<TextBlock Margin="8">Control Items</TextBlock> |
||||
</ComboBox.ItemTemplate> |
</Panel> |
||||
</ComboBox> |
</ComboBoxItem> |
||||
|
<ComboBoxItem> |
||||
<ComboBox PlaceholderText="Pick an Item"> |
<Ellipse |
||||
<ComboBoxItem>Inline Items</ComboBoxItem> |
Width="50" |
||||
<ComboBoxItem>Inline Item 2</ComboBoxItem> |
Height="50" |
||||
<ComboBoxItem>Inline Item 3</ComboBoxItem> |
Fill="Yellow" /> |
||||
<ComboBoxItem>Inline Item 4</ComboBoxItem> |
</ComboBoxItem> |
||||
<DataValidationErrors.Error> |
<ComboBoxItem> |
||||
<sys:Exception /> |
<TextBox Text="TextBox" /> |
||||
</DataValidationErrors.Error> |
</ComboBoxItem> |
||||
</ComboBox> |
</ComboBox> |
||||
</WrapPanel> |
|
||||
|
|
||||
</StackPanel> |
<ComboBox |
||||
|
x:Name="fontComboBox" |
||||
|
SelectedIndex="0" |
||||
|
WrapSelection="{Binding WrapSelection}"> |
||||
|
<ComboBox.ItemTemplate> |
||||
|
<DataTemplate> |
||||
|
<TextBlock FontFamily="{Binding}" Text="{Binding Name}" /> |
||||
|
</DataTemplate> |
||||
|
</ComboBox.ItemTemplate> |
||||
|
</ComboBox> |
||||
|
|
||||
|
<ComboBox PlaceholderText="Pick an Item" WrapSelection="{Binding WrapSelection}"> |
||||
|
<ComboBoxItem>Inline Items</ComboBoxItem> |
||||
|
<ComboBoxItem>Inline Item 2</ComboBoxItem> |
||||
|
<ComboBoxItem>Inline Item 3</ComboBoxItem> |
||||
|
<ComboBoxItem>Inline Item 4</ComboBoxItem> |
||||
|
<DataValidationErrors.Error> |
||||
|
<sys:Exception /> |
||||
|
</DataValidationErrors.Error> |
||||
|
</ComboBox> |
||||
|
</WrapPanel> |
||||
|
|
||||
|
<CheckBox IsChecked="{Binding WrapSelection}">WrapSelection</CheckBox> |
||||
|
|
||||
|
</StackPanel> |
||||
|
</StackPanel> |
||||
</UserControl> |
</UserControl> |
||||
|
|||||
@ -0,0 +1,21 @@ |
|||||
|
using System; |
||||
|
using System.Collections.ObjectModel; |
||||
|
using System.Linq; |
||||
|
using System.Reactive; |
||||
|
using Avalonia.Controls; |
||||
|
using Avalonia.Controls.Selection; |
||||
|
using MiniMvvm; |
||||
|
|
||||
|
namespace ControlCatalog.ViewModels |
||||
|
{ |
||||
|
public class ComboBoxPageViewModel : ViewModelBase |
||||
|
{ |
||||
|
private bool _wrapSelection; |
||||
|
|
||||
|
public bool WrapSelection |
||||
|
{ |
||||
|
get => _wrapSelection; |
||||
|
set => this.RaiseAndSetIfChanged(ref _wrapSelection, value); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,35 +1,18 @@ |
|||||
using System; |
|
||||
using System.Reactive.Linq; |
|
||||
using Avalonia; |
|
||||
using Avalonia.Animation; |
|
||||
using Avalonia.Controls; |
using Avalonia.Controls; |
||||
using Avalonia.Data; |
|
||||
using Avalonia.Markup.Xaml; |
using Avalonia.Markup.Xaml; |
||||
using Avalonia.Media; |
|
||||
|
|
||||
namespace RenderDemo.Pages |
namespace RenderDemo.Pages |
||||
{ |
{ |
||||
public class ClippingPage : UserControl |
public class ClippingPage : UserControl |
||||
{ |
{ |
||||
private Geometry _clip; |
|
||||
|
|
||||
public ClippingPage() |
public ClippingPage() |
||||
{ |
{ |
||||
InitializeComponent(); |
InitializeComponent(); |
||||
WireUpCheckbox(); |
|
||||
} |
} |
||||
|
|
||||
private void InitializeComponent() |
private void InitializeComponent() |
||||
{ |
{ |
||||
AvaloniaXamlLoader.Load(this); |
AvaloniaXamlLoader.Load(this); |
||||
} |
} |
||||
|
|
||||
private void WireUpCheckbox() |
|
||||
{ |
|
||||
var useMask = this.FindControl<CheckBox>("useMask"); |
|
||||
var clipped = this.FindControl<Border>("clipped"); |
|
||||
_clip = clipped.Clip; |
|
||||
useMask.Click += (s, e) => clipped.Clip = clipped.Clip == null ? _clip : null; |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -0,0 +1,7 @@ |
|||||
|
<UserControl xmlns="https://github.com/avaloniaui" |
||||
|
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" |
||||
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" |
||||
|
x:Class="RenderDemo.Pages.FormattedTextPage"> |
||||
|
</UserControl> |
||||
@ -0,0 +1,60 @@ |
|||||
|
using System.Globalization; |
||||
|
using Avalonia; |
||||
|
using Avalonia.Controls; |
||||
|
using Avalonia.Markup.Xaml; |
||||
|
using Avalonia.Media; |
||||
|
|
||||
|
namespace RenderDemo.Pages |
||||
|
{ |
||||
|
public class FormattedTextPage : UserControl |
||||
|
{ |
||||
|
public FormattedTextPage() |
||||
|
{ |
||||
|
this.InitializeComponent(); |
||||
|
} |
||||
|
|
||||
|
private void InitializeComponent() |
||||
|
{ |
||||
|
AvaloniaXamlLoader.Load(this); |
||||
|
} |
||||
|
|
||||
|
public override void Render(DrawingContext context) |
||||
|
{ |
||||
|
const string testString = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor"; |
||||
|
|
||||
|
// Create the initial formatted text string.
|
||||
|
var formattedText = new FormattedText( |
||||
|
testString, |
||||
|
CultureInfo.GetCultureInfo("en-us"), |
||||
|
FlowDirection.LeftToRight, |
||||
|
new Typeface("Verdana"), |
||||
|
32, |
||||
|
Brushes.Black) { MaxTextWidth = 300, MaxTextHeight = 240 }; |
||||
|
|
||||
|
// Set a maximum width and height. If the text overflows these values, an ellipsis "..." appears.
|
||||
|
|
||||
|
// Use a larger font size beginning at the first (zero-based) character and continuing for 5 characters.
|
||||
|
// The font size is calculated in terms of points -- not as device-independent pixels.
|
||||
|
formattedText.SetFontSize(36 * (96.0 / 72.0), 0, 5); |
||||
|
|
||||
|
// Use a Bold font weight beginning at the 6th character and continuing for 11 characters.
|
||||
|
formattedText.SetFontWeight(FontWeight.Bold, 6, 11); |
||||
|
|
||||
|
var gradient = new LinearGradientBrush |
||||
|
{ |
||||
|
GradientStops = |
||||
|
new GradientStops { new GradientStop(Colors.Orange, 0), new GradientStop(Colors.Teal, 1) }, |
||||
|
StartPoint = new RelativePoint(0,0, RelativeUnit.Relative), |
||||
|
EndPoint = new RelativePoint(0,1, RelativeUnit.Relative) |
||||
|
}; |
||||
|
|
||||
|
// Use a linear gradient brush beginning at the 6th character and continuing for 11 characters.
|
||||
|
formattedText.SetForegroundBrush(gradient, 6, 11); |
||||
|
|
||||
|
// Use an Italic font style beginning at the 28th character and continuing for 28 characters.
|
||||
|
formattedText.SetFontStyle(FontStyle.Italic, 28, 28); |
||||
|
|
||||
|
context.DrawText(formattedText, new Point(10, 0)); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,14 +0,0 @@ |
|||||
using Avalonia.Controls; |
|
||||
using Avalonia.Shared.PlatformSupport; |
|
||||
|
|
||||
namespace Avalonia |
|
||||
{ |
|
||||
public sealed class AppBuilder : AppBuilderBase<AppBuilder> |
|
||||
{ |
|
||||
public AppBuilder() : base(new StandardRuntimePlatform(), |
|
||||
builder => StandardRuntimePlatformServices.Register(builder.Instance?.GetType()?.Assembly)) |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -1,13 +1,18 @@ |
|||||
<Project Sdk="MSBuild.Sdk.Extras"> |
<Project Sdk="Xamarin.Legacy.Sdk"> |
||||
<PropertyGroup> |
<PropertyGroup> |
||||
<TargetFramework>monoandroid11.0</TargetFramework> |
<TargetFrameworks>net6.0-android;monoandroid11.0</TargetFrameworks> |
||||
|
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion> |
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
||||
|
<MSBuildEnableWorkloadResolver>true</MSBuildEnableWorkloadResolver> |
||||
|
<DebugType>portable</DebugType> |
||||
</PropertyGroup> |
</PropertyGroup> |
||||
<ItemGroup> |
<ItemGroup> |
||||
<ProjectReference Include="..\..\..\packages\Avalonia\Avalonia.csproj" /> |
<ProjectReference Include="..\..\..\packages\Avalonia\Avalonia.csproj" /> |
||||
|
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.3.1.3" /> |
||||
|
<PackageReference Include="Xamarin.AndroidX.Lifecycle.ViewModel" Version="2.3.1.3" /> |
||||
|
</ItemGroup> |
||||
|
<ItemGroup> |
||||
|
<ProjectReference Include="..\..\Avalonia.Base\Avalonia.Base.csproj" /> |
||||
<ProjectReference Include="..\..\Skia\Avalonia.Skia\Avalonia.Skia.csproj" /> |
<ProjectReference Include="..\..\Skia\Avalonia.Skia\Avalonia.Skia.csproj" /> |
||||
</ItemGroup> |
</ItemGroup> |
||||
<Import Project="..\..\Shared\PlatformSupport\PlatformSupport.projitems" Label="Shared" /> |
|
||||
<Import Project="..\..\..\build\Rx.props" /> |
|
||||
<Import Project="..\..\..\build\AndroidWorkarounds.props" /> |
|
||||
</Project> |
</Project> |
||||
|
|||||
@ -1,35 +1,55 @@ |
|||||
using Android.App; |
using Android.App; |
||||
using Android.OS; |
using Android.OS; |
||||
using Android.Views; |
using Android.Views; |
||||
|
using Android.Content.PM; |
||||
|
using AndroidX.AppCompat.App; |
||||
|
using Android.Content.Res; |
||||
|
using AndroidX.Lifecycle; |
||||
|
|
||||
namespace Avalonia.Android |
namespace Avalonia.Android |
||||
{ |
{ |
||||
public abstract class AvaloniaActivity : Activity |
public abstract class AvaloniaActivity : AppCompatActivity |
||||
{ |
{ |
||||
internal AvaloniaView View; |
internal AvaloniaView View; |
||||
object _content; |
internal AvaloniaViewModel _viewModel; |
||||
|
|
||||
protected override void OnCreate(Bundle savedInstanceState) |
protected override void OnCreate(Bundle savedInstanceState) |
||||
{ |
{ |
||||
View = new AvaloniaView(this); |
View = new AvaloniaView(this); |
||||
if (_content != null) |
|
||||
View.Content = _content; |
|
||||
SetContentView(View); |
SetContentView(View); |
||||
|
|
||||
|
_viewModel = new ViewModelProvider(this).Get(Java.Lang.Class.FromType(typeof(AvaloniaViewModel))) as AvaloniaViewModel; |
||||
|
|
||||
|
if (_viewModel.Content != null) |
||||
|
{ |
||||
|
View.Content = _viewModel.Content; |
||||
|
} |
||||
|
|
||||
base.OnCreate(savedInstanceState); |
base.OnCreate(savedInstanceState); |
||||
} |
} |
||||
|
|
||||
public object Content |
public object Content |
||||
{ |
{ |
||||
get |
get |
||||
{ |
{ |
||||
return _content; |
return _viewModel.Content; |
||||
} |
} |
||||
set |
set |
||||
{ |
{ |
||||
_content = value; |
_viewModel.Content = value; |
||||
if (View != null) |
if (View != null) |
||||
View.Content = value; |
View.Content = value; |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
|
public override void OnConfigurationChanged(Configuration newConfig) |
||||
|
{ |
||||
|
base.OnConfigurationChanged(newConfig); |
||||
|
} |
||||
|
|
||||
|
protected override void OnDestroy() |
||||
|
{ |
||||
|
View.Content = null; |
||||
|
|
||||
|
base.OnDestroy(); |
||||
|
} |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -0,0 +1,11 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text; |
||||
|
|
||||
|
namespace Avalonia.Android |
||||
|
{ |
||||
|
internal class AvaloniaViewModel : AndroidX.Lifecycle.ViewModel |
||||
|
{ |
||||
|
public object Content { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -1,50 +0,0 @@ |
|||||
Images, layout descriptions, binary blobs and string dictionaries can be included |
|
||||
in your application as resource files. Various Android APIs are designed to |
|
||||
operate on the resource IDs instead of dealing with images, strings or binary blobs |
|
||||
directly. |
|
||||
|
|
||||
For example, a sample Android app that contains a user interface layout (main.xml), |
|
||||
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) |
|
||||
would keep its resources in the "Resources" directory of the application: |
|
||||
|
|
||||
Resources/ |
|
||||
drawable-hdpi/ |
|
||||
icon.png |
|
||||
|
|
||||
drawable-ldpi/ |
|
||||
icon.png |
|
||||
|
|
||||
drawable-mdpi/ |
|
||||
icon.png |
|
||||
|
|
||||
layout/ |
|
||||
main.xml |
|
||||
|
|
||||
values/ |
|
||||
strings.xml |
|
||||
|
|
||||
In order to get the build system to recognize Android resources, set the build action to |
|
||||
"AndroidResource". The native Android APIs do not operate directly with filenames, but |
|
||||
instead operate on resource IDs. When you compile an Android application that uses resources, |
|
||||
the build system will package the resources for distribution and generate a class called |
|
||||
"Resource" that contains the tokens for each one of the resources included. For example, |
|
||||
for the above Resources layout, this is what the Resource class would expose: |
|
||||
|
|
||||
public class Resource { |
|
||||
public class drawable { |
|
||||
public const int icon = 0x123; |
|
||||
} |
|
||||
|
|
||||
public class layout { |
|
||||
public const int main = 0x456; |
|
||||
} |
|
||||
|
|
||||
public class strings { |
|
||||
public const int first_string = 0xabc; |
|
||||
public const int second_string = 0xbcd; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main |
|
||||
to reference the layout/main.xml file, or Resource.strings.first_string to reference the first |
|
||||
string in the dictionary file values/strings.xml. |
|
||||
@ -1,6 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
|
|
||||
<resources> |
|
||||
<string name="Hello">Hello World, Click Me!</string> |
|
||||
<string name="ApplicationName">$projectname$</string> |
|
||||
</resources> |
|
||||
@ -1,18 +0,0 @@ |
|||||
using Avalonia.Platform; |
|
||||
|
|
||||
namespace Avalonia.Shared.PlatformSupport |
|
||||
{ |
|
||||
internal partial class StandardRuntimePlatform |
|
||||
{ |
|
||||
public RuntimePlatformInfo GetRuntimeInfo() => new RuntimePlatformInfo |
|
||||
{ |
|
||||
IsCoreClr = false, |
|
||||
IsDesktop = false, |
|
||||
IsMobile = true, |
|
||||
IsDotNetFramework = false, |
|
||||
IsMono = true, |
|
||||
IsUnix = true, |
|
||||
OperatingSystem = OperatingSystemType.Android |
|
||||
}; |
|
||||
} |
|
||||
} |
|
||||
@ -1,19 +0,0 @@ |
|||||
Any raw assets you want to be deployed with your application can be placed in |
|
||||
this directory (and child directories) and given a Build Action of "AndroidAsset". |
|
||||
|
|
||||
These files will be deployed with you package and will be accessible using Android's |
|
||||
AssetManager, like this: |
|
||||
|
|
||||
public class ReadAsset : Activity |
|
||||
{ |
|
||||
protected override void OnCreate (Bundle bundle) |
|
||||
{ |
|
||||
base.OnCreate (bundle); |
|
||||
|
|
||||
InputStream input = Assets.Open ("my_asset.txt"); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
Additionally, some Android functions will automatically load asset files: |
|
||||
|
|
||||
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); |
|
||||
@ -1,153 +1,37 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<Project Sdk="Microsoft.NET.Sdk"> |
||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|
||||
<PropertyGroup> |
<PropertyGroup> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
<TargetFramework>net6.0-android</TargetFramework> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion> |
||||
<ProductVersion>8.0.30703</ProductVersion> |
<OutputType>Exe</OutputType> |
||||
<SchemaVersion>2.0</SchemaVersion> |
<Nullable>enable</Nullable> |
||||
<ProjectGuid>{FF69B927-C545-49AE-8E16-3D14D621AA12}</ProjectGuid> |
<ApplicationId>com.Avalonia.AndroidTestApplication</ApplicationId> |
||||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> |
<ApplicationVersion>1</ApplicationVersion> |
||||
<OutputType>Library</OutputType> |
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion> |
||||
<AppDesignerFolder>Properties</AppDesignerFolder> |
<AndroidPackageFormat>apk</AndroidPackageFormat> |
||||
<RootNamespace>Avalonia.AndroidTestApplication</RootNamespace> |
<MSBuildEnableWorkloadResolver>true</MSBuildEnableWorkloadResolver> |
||||
<AssemblyName>Avalonia.AndroidTestApplication</AssemblyName> |
<DebugType>portable</DebugType> |
||||
<FileAlignment>512</FileAlignment> |
|
||||
<AndroidApplication>true</AndroidApplication> |
|
||||
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile> |
|
||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> |
|
||||
<AndroidUseLatestPlatformSdk>False</AndroidUseLatestPlatformSdk> |
|
||||
<TargetFrameworkVersion>v11.0</TargetFrameworkVersion> |
|
||||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest> |
|
||||
</PropertyGroup> |
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|
||||
|
<PropertyGroup Condition="'$(Configuration)'=='Release' and '$(TF_BUILD)' == ''"> |
||||
<DebugSymbols>True</DebugSymbols> |
<DebugSymbols>True</DebugSymbols> |
||||
<DebugType>full</DebugType> |
<RunAOTCompilation>True</RunAOTCompilation> |
||||
<Optimize>false</Optimize> |
<EnableLLVM>True</EnableLLVM> |
||||
<OutputPath>bin\Debug\</OutputPath> |
<!--<AndroidEnableProfiledAot>True</AndroidEnableProfiledAot>--> |
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
|
||||
<ErrorReport>prompt</ErrorReport> |
|
||||
<WarningLevel>4</WarningLevel> |
|
||||
<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime> |
|
||||
<AndroidLinkMode>None</AndroidLinkMode> |
|
||||
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk> |
|
||||
<BundleAssemblies>False</BundleAssemblies> |
|
||||
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi> |
|
||||
<AndroidSupportedAbis>armeabi-v7a;x86</AndroidSupportedAbis> |
|
||||
<Debugger>Xamarin</Debugger> |
|
||||
<AndroidEnableMultiDex>False</AndroidEnableMultiDex> |
|
||||
<DevInstrumentationEnabled>True</DevInstrumentationEnabled> |
|
||||
<AotAssemblies>False</AotAssemblies> |
|
||||
<EnableLLVM>False</EnableLLVM> |
|
||||
<EnableProguard>False</EnableProguard> |
|
||||
</PropertyGroup> |
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|
||||
<DebugType>pdbonly</DebugType> |
|
||||
<Optimize>true</Optimize> |
|
||||
<OutputPath>bin\Release\</OutputPath> |
|
||||
<DefineConstants>TRACE</DefineConstants> |
|
||||
<ErrorReport>prompt</ErrorReport> |
|
||||
<WarningLevel>4</WarningLevel> |
|
||||
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime> |
|
||||
<AndroidLinkMode>Full</AndroidLinkMode> |
|
||||
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk> |
|
||||
<BundleAssemblies>False</BundleAssemblies> |
|
||||
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi> |
|
||||
<AndroidSupportedAbis>armeabi-v7a,x86</AndroidSupportedAbis> |
|
||||
<Debugger>Xamarin</Debugger> |
|
||||
<AotAssemblies>False</AotAssemblies> |
|
||||
<EnableLLVM>False</EnableLLVM> |
|
||||
<AndroidEnableMultiDex>False</AndroidEnableMultiDex> |
|
||||
<EnableProguard>False</EnableProguard> |
|
||||
<DevInstrumentationEnabled>False</DevInstrumentationEnabled> |
|
||||
<DebugSymbols>False</DebugSymbols> |
|
||||
</PropertyGroup> |
|
||||
<ItemGroup> |
|
||||
<Reference Include="Mono.Android" /> |
|
||||
<Reference Include="mscorlib" /> |
|
||||
<Reference Include="System" /> |
|
||||
<Reference Include="System.Core" /> |
|
||||
<Reference Include="System.Xml.Linq" /> |
|
||||
<Reference Include="System.Xml" /> |
|
||||
</ItemGroup> |
|
||||
<ItemGroup> |
|
||||
<Compile Include="MainActivity.cs" /> |
|
||||
<Compile Include="Resources\Resource.Designer.cs" /> |
|
||||
<Compile Include="Properties\AssemblyInfo.cs" /> |
|
||||
</ItemGroup> |
|
||||
<ItemGroup> |
|
||||
<None Include="app.config" /> |
|
||||
<None Include="Resources\AboutResources.txt" /> |
|
||||
<None Include="Assets\AboutAssets.txt" /> |
|
||||
</ItemGroup> |
|
||||
<ItemGroup> |
<ItemGroup> |
||||
<AndroidResource Include="Resources\values\Strings.xml"> |
<None Remove="Assets\AboutAssets.txt" /> |
||||
<SubType>Designer</SubType> |
|
||||
</AndroidResource> |
|
||||
</ItemGroup> |
|
||||
<ItemGroup> |
|
||||
<AndroidResource Include="Resources\drawable\Icon.png" /> |
|
||||
</ItemGroup> |
|
||||
<ItemGroup> |
|
||||
<None Include="Properties\AndroidManifest.xml" /> |
|
||||
</ItemGroup> |
</ItemGroup> |
||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> |
||||
|
<BundleAssemblies>True</BundleAssemblies> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> |
||||
|
<BundleAssemblies>True</BundleAssemblies> |
||||
|
</PropertyGroup> |
||||
|
|
||||
<ItemGroup> |
<ItemGroup> |
||||
<ProjectReference Include="..\..\..\src\Android\Avalonia.Android\Avalonia.Android.csproj"> |
<ProjectReference Include="..\..\..\packages\Avalonia\Avalonia.csproj" /> |
||||
<Project>{7b92af71-6287-4693-9dcb-bd5b6e927e23}</Project> |
<ProjectReference Include="..\Avalonia.Android\Avalonia.Android.csproj" /> |
||||
<Name>Avalonia.Android</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\..\src\Markup\Avalonia.Markup.Xaml\Avalonia.Markup.Xaml.csproj"> |
|
||||
<Project>{3e53a01a-b331-47f3-b828-4a5717e77a24}</Project> |
|
||||
<Name>Avalonia.Markup.Xaml</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\..\src\Avalonia.Animation\Avalonia.Animation.csproj"> |
|
||||
<Project>{d211e587-d8bc-45b9-95a4-f297c8fa5200}</Project> |
|
||||
<Name>Avalonia.Animation</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\..\src\Avalonia.Base\Avalonia.Base.csproj"> |
|
||||
<Project>{b09b78d8-9b26-48b0-9149-d64a2f120f3f}</Project> |
|
||||
<Name>Avalonia.Base</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\..\src\Avalonia.Controls\Avalonia.Controls.csproj"> |
|
||||
<Project>{d2221c82-4a25-4583-9b43-d791e3f6820c}</Project> |
|
||||
<Name>Avalonia.Controls</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\..\src\Avalonia.Diagnostics\Avalonia.Diagnostics.csproj"> |
|
||||
<Project>{7062ae20-5dcc-4442-9645-8195bdece63e}</Project> |
|
||||
<Name>Avalonia.Diagnostics</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\..\src\Avalonia.Input\Avalonia.Input.csproj"> |
|
||||
<Project>{62024b2d-53eb-4638-b26b-85eeaa54866e}</Project> |
|
||||
<Name>Avalonia.Input</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\..\src\Avalonia.Interactivity\Avalonia.Interactivity.csproj"> |
|
||||
<Project>{6b0ed19d-a08b-461c-a9d9-a9ee40b0c06b}</Project> |
|
||||
<Name>Avalonia.Interactivity</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\..\src\Avalonia.Layout\Avalonia.Layout.csproj"> |
|
||||
<Project>{42472427-4774-4c81-8aff-9f27b8e31721}</Project> |
|
||||
<Name>Avalonia.Layout</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\Avalonia.Visuals\Avalonia.Visuals.csproj"> |
|
||||
<Project>{eb582467-6abb-43a1-b052-e981ba910e3a}</Project> |
|
||||
<Name>Avalonia.Visuals</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\..\src\Avalonia.Styling\Avalonia.Styling.csproj"> |
|
||||
<Project>{f1baa01a-f176-4c6a-b39d-5b40bb1b148f}</Project> |
|
||||
<Name>Avalonia.Styling</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\..\src\Avalonia.Themes.Default\Avalonia.Themes.Default.csproj"> |
|
||||
<Project>{3e10a5fa-e8da-48b1-ad44-6a5b6cb7750f}</Project> |
|
||||
<Name>Avalonia.Themes.Default</Name> |
|
||||
</ProjectReference> |
|
||||
<ProjectReference Include="..\..\Skia\Avalonia.Skia\Avalonia.Skia.csproj"> |
|
||||
<Project>{7d2d3083-71dd-4cc9-8907-39a0d86fb322}</Project> |
|
||||
<Name>Avalonia.Skia</Name> |
|
||||
</ProjectReference> |
|
||||
</ItemGroup> |
</ItemGroup> |
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" /> |
|
||||
<Import Project="..\..\..\build\Base.props" /> |
|
||||
<Import Project="..\..\..\build\Rx.props" /> |
|
||||
<Import Project="..\..\..\build\System.Memory.props" /> |
|
||||
<Import Project="..\..\..\build\AndroidWorkarounds.props" /> |
|
||||
<Import Project="..\..\..\build\LegacyProject.targets" /> |
|
||||
</Project> |
</Project> |
||||
|
|||||
@ -1,6 +1,4 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="Avalonia.AndroidTestApplication" android:versionCode="1" android:versionName="1.0" android:installLocation="auto"> |
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
<uses-sdk android:targetSdkVersion="30" /> |
|
||||
<application android:label="Avalonia.AndroidTestApplication" android:icon="@drawable/Icon" android:hardwareAccelerated="true"></application> |
<application android:label="Avalonia.AndroidTestApplication" android:icon="@drawable/Icon" android:hardwareAccelerated="true"></application> |
||||
<uses-permission android:name="android.permission.INTERNET" /> |
</manifest> |
||||
</manifest> |
|
||||
|
|||||
@ -1,30 +0,0 @@ |
|||||
using System.Reflection; |
|
||||
using System.Runtime.InteropServices; |
|
||||
|
|
||||
// General Information about an assembly is controlled through the following
|
|
||||
// set of attributes. Change these attribute values to modify the information
|
|
||||
// associated with an assembly.
|
|
||||
|
|
||||
[assembly: AssemblyTitle("Avalonia.AndroidTestApplication")] |
|
||||
[assembly: AssemblyDescription("")] |
|
||||
[assembly: AssemblyConfiguration("")] |
|
||||
[assembly: AssemblyCompany("")] |
|
||||
[assembly: AssemblyProduct("Avalonia.AndroidTestApplication")] |
|
||||
[assembly: AssemblyCopyright("Copyright © 2015")] |
|
||||
[assembly: AssemblyTrademark("")] |
|
||||
[assembly: AssemblyCulture("")] |
|
||||
[assembly: ComVisible(false)] |
|
||||
|
|
||||
// Version information for an assembly consists of the following four values:
|
|
||||
//
|
|
||||
// Major Version
|
|
||||
// Minor Version
|
|
||||
// Build Number
|
|
||||
// Revision
|
|
||||
//
|
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
|
||||
// by using the '*' as shown below:
|
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
|
||||
|
|
||||
[assembly: AssemblyVersion("1.0.0.0")] |
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")] |
|
||||
@ -1,79 +0,0 @@ |
|||||
#pragma warning disable 1591
|
|
||||
//------------------------------------------------------------------------------
|
|
||||
// <auto-generated>
|
|
||||
// This code was generated by a tool.
|
|
||||
//
|
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
|
||||
// the code is regenerated.
|
|
||||
// </auto-generated>
|
|
||||
//------------------------------------------------------------------------------
|
|
||||
|
|
||||
[assembly: global::Android.Runtime.ResourceDesignerAttribute("Avalonia.AndroidTestApplication.Resource", IsApplication=true)] |
|
||||
|
|
||||
namespace Avalonia.AndroidTestApplication |
|
||||
{ |
|
||||
|
|
||||
|
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.1.99.62")] |
|
||||
public partial class Resource |
|
||||
{ |
|
||||
|
|
||||
static Resource() |
|
||||
{ |
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues(); |
|
||||
} |
|
||||
|
|
||||
public static void UpdateIdValues() |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
public partial class Attribute |
|
||||
{ |
|
||||
|
|
||||
static Attribute() |
|
||||
{ |
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues(); |
|
||||
} |
|
||||
|
|
||||
private Attribute() |
|
||||
{ |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public partial class Drawable |
|
||||
{ |
|
||||
|
|
||||
// aapt resource value: 0x7F010000
|
|
||||
public const int Icon = 2130771968; |
|
||||
|
|
||||
static Drawable() |
|
||||
{ |
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues(); |
|
||||
} |
|
||||
|
|
||||
private Drawable() |
|
||||
{ |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public partial class String |
|
||||
{ |
|
||||
|
|
||||
// aapt resource value: 0x7F020000
|
|
||||
public const int ApplicationName = 2130837504; |
|
||||
|
|
||||
// aapt resource value: 0x7F020001
|
|
||||
public const int Hello = 2130837505; |
|
||||
|
|
||||
static String() |
|
||||
{ |
|
||||
global::Android.Runtime.ResourceIdManager.UpdateIdValues(); |
|
||||
} |
|
||||
|
|
||||
private String() |
|
||||
{ |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
#pragma warning restore 1591
|
|
||||
@ -1,11 +0,0 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
|
||||
<configuration> |
|
||||
<runtime> |
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> |
|
||||
<dependentAssembly> |
|
||||
<assemblyIdentity name="System.Runtime.InteropServices.WindowsRuntime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" /> |
|
||||
</dependentAssembly> |
|
||||
</assemblyBinding> |
|
||||
</runtime> |
|
||||
</configuration> |
|
||||
@ -0,0 +1,12 @@ |
|||||
|
using System; |
||||
|
|
||||
|
namespace Avalonia.Utilities; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Defines a listener to a event subscribed vis the <see cref="WeakEvent{TTarget, TEventArgs}"/>.
|
||||
|
/// </summary>
|
||||
|
/// <typeparam name="TEventArgs">The type of the event arguments.</typeparam>
|
||||
|
public interface IWeakEventSubscriber<in TEventArgs> where TEventArgs : EventArgs |
||||
|
{ |
||||
|
void OnEvent(object? sender, WeakEvent ev, TEventArgs e); |
||||
|
} |
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue