committed by
GitHub
49 changed files with 119 additions and 3193 deletions
@ -1,26 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<configuration> |
|||
<startup> |
|||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> |
|||
</startup> |
|||
<runtime> |
|||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> |
|||
<dependentAssembly> |
|||
<assemblyIdentity name="SharpDX.Direct2D1" publicKeyToken="b4dcf0f35e5521f1" culture="neutral" /> |
|||
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" /> |
|||
</dependentAssembly> |
|||
<dependentAssembly> |
|||
<assemblyIdentity name="SharpDX" publicKeyToken="b4dcf0f35e5521f1" culture="neutral" /> |
|||
<bindingRedirect oldVersion="0.0.0.0-3.0.2.0" newVersion="3.0.2.0" /> |
|||
</dependentAssembly> |
|||
<dependentAssembly> |
|||
<assemblyIdentity name="SharpDX.DXGI" publicKeyToken="b4dcf0f35e5521f1" culture="neutral" /> |
|||
<bindingRedirect oldVersion="0.0.0.0-3.0.2.0" newVersion="3.0.2.0" /> |
|||
</dependentAssembly> |
|||
<dependentAssembly> |
|||
<assemblyIdentity name="Mono.Cairo" publicKeyToken="0738eb9f132ed756" culture="neutral" /> |
|||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /> |
|||
</dependentAssembly> |
|||
</assemblyBinding> |
|||
</runtime> |
|||
</configuration> |
|||
@ -1,44 +0,0 @@ |
|||
// Copyright (c) The Avalonia Project. All rights reserved.
|
|||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|||
|
|||
using System; |
|||
using System.Linq; |
|||
using System.IO; |
|||
using System.Reactive.Linq; |
|||
using Avalonia; |
|||
using Avalonia.Animation; |
|||
using Avalonia.Collections; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Controls.Html; |
|||
using Avalonia.Controls.Primitives; |
|||
using Avalonia.Controls.Shapes; |
|||
using Avalonia.Controls.Templates; |
|||
using Avalonia.Diagnostics; |
|||
using Avalonia.Layout; |
|||
using Avalonia.Media; |
|||
using Avalonia.Media.Imaging; |
|||
#if AVALONIA_GTK
|
|||
using Avalonia.Gtk; |
|||
#endif
|
|||
using ReactiveUI; |
|||
|
|||
namespace TestApplication |
|||
{ |
|||
internal class Program |
|||
{ |
|||
private static void Main(string[] args) |
|||
{ |
|||
// The version of ReactiveUI currently included is for WPF and so expects a WPF
|
|||
// dispatcher. This makes sure it's initialized.
|
|||
System.Windows.Threading.Dispatcher foo = System.Windows.Threading.Dispatcher.CurrentDispatcher; |
|||
|
|||
var app = new App(); |
|||
|
|||
AppBuilder.Configure(app) |
|||
.UsePlatformDetect() |
|||
.SetupWithoutStarting(); |
|||
|
|||
app.Run(); |
|||
} |
|||
} |
|||
} |
|||
@ -1,39 +0,0 @@ |
|||
// Copyright (c) The Avalonia Project. All rights reserved.
|
|||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|||
|
|||
using System.Reflection; |
|||
using System.Runtime.CompilerServices; |
|||
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("TestApplication")] |
|||
[assembly: AssemblyDescription("")] |
|||
[assembly: AssemblyConfiguration("")] |
|||
[assembly: AssemblyCompany("")] |
|||
[assembly: AssemblyProduct("TestApplication")] |
|||
[assembly: AssemblyCopyright("Copyright \u00A9 2013")] |
|||
[assembly: AssemblyTrademark("")] |
|||
[assembly: AssemblyCulture("")] |
|||
|
|||
// Setting ComVisible to false makes the types in this assembly not visible
|
|||
// to COM components. If you need to access a type in this assembly from
|
|||
// COM, set the ComVisible attribute to true on that type.
|
|||
[assembly: ComVisible(false)] |
|||
|
|||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|||
[assembly: Guid("f8dad012-f4ec-4b63-b64f-320901338290")] |
|||
|
|||
// 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,177 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> |
|||
<PropertyGroup> |
|||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|||
<ProjectGuid>{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}</ProjectGuid> |
|||
<OutputType>WinExe</OutputType> |
|||
<AppDesignerFolder>Properties</AppDesignerFolder> |
|||
<RootNamespace>TestApplication</RootNamespace> |
|||
<AssemblyName>TestApplication</AssemblyName> |
|||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> |
|||
<FileAlignment>512</FileAlignment> |
|||
<NuGetPackageImportStamp> |
|||
</NuGetPackageImportStamp> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|||
<PlatformTarget>AnyCPU</PlatformTarget> |
|||
<DebugSymbols>true</DebugSymbols> |
|||
<DebugType>full</DebugType> |
|||
<Optimize>false</Optimize> |
|||
<OutputPath>bin\Debug\</OutputPath> |
|||
<DefineConstants>TRACE;DEBUG</DefineConstants> |
|||
<ErrorReport>prompt</ErrorReport> |
|||
<WarningLevel>4</WarningLevel> |
|||
<Prefer32Bit>true</Prefer32Bit> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|||
<PlatformTarget>AnyCPU</PlatformTarget> |
|||
<DebugType>pdbonly</DebugType> |
|||
<Optimize>true</Optimize> |
|||
<OutputPath>bin\Release\</OutputPath> |
|||
<DefineConstants>TRACE</DefineConstants> |
|||
<ErrorReport>prompt</ErrorReport> |
|||
<WarningLevel>4</WarningLevel> |
|||
</PropertyGroup> |
|||
<ItemGroup> |
|||
<Reference Include="Serilog, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL"> |
|||
<HintPath>..\..\packages\Serilog.1.5.14\lib\net45\Serilog.dll</HintPath> |
|||
<Private>True</Private> |
|||
</Reference> |
|||
<Reference Include="Serilog.FullNetFx, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL"> |
|||
<HintPath>..\..\packages\Serilog.1.5.14\lib\net45\Serilog.FullNetFx.dll</HintPath> |
|||
<Private>True</Private> |
|||
</Reference> |
|||
<Reference Include="System" /> |
|||
<Reference Include="System.Core" /> |
|||
<Reference Include="System.Drawing" /> |
|||
<Reference Include="System.Reactive.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> |
|||
<HintPath>..\..\packages\System.Reactive.Core.3.0.0\lib\net45\System.Reactive.Core.dll</HintPath> |
|||
<Private>True</Private> |
|||
</Reference> |
|||
<Reference Include="System.Reactive.Interfaces, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> |
|||
<HintPath>..\..\packages\System.Reactive.Interfaces.3.0.0\lib\net45\System.Reactive.Interfaces.dll</HintPath> |
|||
<Private>True</Private> |
|||
</Reference> |
|||
<Reference Include="System.Reactive.Linq, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> |
|||
<HintPath>..\..\packages\System.Reactive.Linq.3.0.0\lib\net45\System.Reactive.Linq.dll</HintPath> |
|||
<Private>True</Private> |
|||
</Reference> |
|||
<Reference Include="System.Reactive.PlatformServices, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> |
|||
<HintPath>..\..\packages\System.Reactive.PlatformServices.3.0.0\lib\net45\System.Reactive.PlatformServices.dll</HintPath> |
|||
<Private>True</Private> |
|||
</Reference> |
|||
<Reference Include="System.Reactive.Windows.Threading, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> |
|||
<HintPath>..\..\packages\System.Reactive.Windows.Threading.3.0.0\lib\net45\System.Reactive.Windows.Threading.dll</HintPath> |
|||
<Private>True</Private> |
|||
</Reference> |
|||
<Reference Include="System.Windows.Forms" /> |
|||
<Reference Include="System.Xml.Linq" /> |
|||
<Reference Include="System.Data.DataSetExtensions" /> |
|||
<Reference Include="Microsoft.CSharp" /> |
|||
<Reference Include="System.Data" /> |
|||
<Reference Include="System.Xml" /> |
|||
<Reference Include="WindowsBase" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<Compile Include="Program.cs" /> |
|||
<Compile Include="Properties\AssemblyInfo.cs" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<None Include="App.config" /> |
|||
<None Include="packages.config" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\src\Avalonia.DotNetFrameworkRuntime\Avalonia.DotNetFrameworkRuntime.csproj"> |
|||
<Project>{4A1ABB09-9047-4BD5-A4AD-A055E52C5EE0}</Project> |
|||
<Name>Avalonia.DotNetFrameworkRuntime</Name> |
|||
</ProjectReference> |
|||
<ProjectReference Include="..\..\src\Gtk\Avalonia.Cairo\Avalonia.Cairo.csproj"> |
|||
<Project>{FB05AC90-89BA-4F2F-A924-F37875FB547C}</Project> |
|||
<Name>Avalonia.Cairo</Name> |
|||
</ProjectReference> |
|||
<ProjectReference Include="..\..\src\Gtk\Avalonia.Gtk\Avalonia.Gtk.csproj"> |
|||
<Project>{54f237d5-a70a-4752-9656-0c70b1a7b047}</Project> |
|||
<Name>Avalonia.Gtk</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\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.DesignerSupport\Avalonia.DesignerSupport.csproj"> |
|||
<Project>{799a7bb5-3c2c-48b6-85a7-406a12c420da}</Project> |
|||
<Name>Avalonia.DesignerSupport</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.HtmlRenderer\Avalonia.HtmlRenderer.csproj"> |
|||
<Project>{5FB2B005-0A7F-4DAD-ADD4-3ED01444E63D}</Project> |
|||
<Name>Avalonia.HtmlRenderer</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.ReactiveUI\Avalonia.ReactiveUI.csproj"> |
|||
<Project>{6417B24E-49C2-4985-8DB2-3AB9D898EC91}</Project> |
|||
<Name>Avalonia.ReactiveUI</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\Windows\Avalonia.Direct2D1\Avalonia.Direct2D1.csproj" Condition="'$(Platform)'!='Mono'"> |
|||
<Project>{3E908F67-5543-4879-A1DC-08EACE79B3CD}</Project> |
|||
<Name>Avalonia.Direct2D1</Name> |
|||
</ProjectReference> |
|||
<ProjectReference Include="..\..\src\Windows\Avalonia.Win32\Avalonia.Win32.csproj" Condition="'$(Platform)'!='Mono'"> |
|||
<Project>{811A76CF-1CF6-440F-963B-BBE31BD72A82}</Project> |
|||
<Name>Avalonia.Win32</Name> |
|||
</ProjectReference> |
|||
</ItemGroup> |
|||
<Import Project="..\TestApplicationShared\TestApplicationShared.projitems" Label="Shared" /> |
|||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
|||
<Import Project="..\..\src\Shared\avalonia.platform.targets" /> |
|||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
|||
Other similar extension points exist, see Microsoft.Common.targets. |
|||
<Target Name="BeforeBuild"> |
|||
</Target> |
|||
<Target Name="AfterBuild"> |
|||
</Target> |
|||
--> |
|||
</Project> |
|||
@ -1,26 +0,0 @@ |
|||
<ProjectConfiguration> |
|||
<AutoDetectNugetBuildDependencies>true</AutoDetectNugetBuildDependencies> |
|||
<BuildPriority>1000</BuildPriority> |
|||
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace> |
|||
<ConsiderInconclusiveTestsAsPassing>false</ConsiderInconclusiveTestsAsPassing> |
|||
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies> |
|||
<AllowDynamicCodeContractChecking>true</AllowDynamicCodeContractChecking> |
|||
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking> |
|||
<AllowCodeAnalysis>false</AllowCodeAnalysis> |
|||
<IgnoreThisComponentCompletely>true</IgnoreThisComponentCompletely> |
|||
<RunPreBuildEvents>false</RunPreBuildEvents> |
|||
<RunPostBuildEvents>false</RunPostBuildEvents> |
|||
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully> |
|||
<InstrumentAssembly>true</InstrumentAssembly> |
|||
<PreventSigningOfAssembly>false</PreventSigningOfAssembly> |
|||
<AnalyseExecutionTimes>true</AnalyseExecutionTimes> |
|||
<DetectStackOverflow>true</DetectStackOverflow> |
|||
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace> |
|||
<DefaultTestTimeout>60000</DefaultTestTimeout> |
|||
<UseBuildConfiguration></UseBuildConfiguration> |
|||
<UseBuildPlatform></UseBuildPlatform> |
|||
<ProxyProcessPath></ProxyProcessPath> |
|||
<UseCPUArchitecture>AutoDetect</UseCPUArchitecture> |
|||
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState> |
|||
<BuildProcessArchitecture>x86</BuildProcessArchitecture> |
|||
</ProjectConfiguration> |
|||
@ -1,10 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="Serilog" version="1.5.14" targetFramework="net45" /> |
|||
<package id="System.Reactive" version="3.0.0" targetFramework="net45" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="net45" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="net45" /> |
|||
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="net45" /> |
|||
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="net45" /> |
|||
<package id="System.Reactive.Windows.Threading" version="3.0.0" targetFramework="net45" /> |
|||
</packages> |
|||
@ -1,83 +0,0 @@ |
|||
// Copyright (c) The Avalonia Project. All rights reserved.
|
|||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|||
|
|||
using System; |
|||
using Avalonia; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Controls.Templates; |
|||
using Avalonia.Markup.Xaml; |
|||
using Avalonia.Styling; |
|||
using Avalonia.Themes.Default; |
|||
using Avalonia.Diagnostics; |
|||
using Avalonia.Platform; |
|||
using Avalonia.Shared.PlatformSupport; |
|||
using Avalonia.Media; |
|||
|
|||
namespace TestApplication |
|||
{ |
|||
public class App : Application |
|||
{ |
|||
public void Run() |
|||
{ |
|||
Styles.Add(new DefaultTheme()); |
|||
|
|||
var loader = new AvaloniaXamlLoader(); |
|||
var baseLight = (IStyle)loader.Load( |
|||
new Uri("resm:Avalonia.Themes.Default.Accents.BaseLight.xaml?assembly=Avalonia.Themes.Default")); |
|||
Styles.Add(baseLight); |
|||
|
|||
Styles.Add(new SampleTabStyle()); |
|||
DataTemplates = new DataTemplates |
|||
{ |
|||
new FuncTreeDataTemplate<Node>( |
|||
x => new TextBlock {Text = x.Name}, |
|||
x => x.Children), |
|||
}; |
|||
|
|||
MainWindow.RootNamespace = "TestApplication"; |
|||
var wnd = MainWindow.Create(); |
|||
wnd.AttachDevTools(); |
|||
|
|||
Run(wnd); |
|||
} |
|||
|
|||
// This provides a simple UI tree for testing input handling, drawing, etc
|
|||
public static Window CreateSimpleWindow() |
|||
{ |
|||
Window window = new Window |
|||
{ |
|||
Title = "Avalonia Test Application", |
|||
Background = Brushes.Red, |
|||
Content = new StackPanel |
|||
{ |
|||
Margin = new Thickness(30), |
|||
Background = Brushes.Yellow, |
|||
Children = new Controls |
|||
{ |
|||
new TextBlock |
|||
{ |
|||
Text = "TEXT BLOCK", |
|||
Width = 300, |
|||
Height = 40, |
|||
Background = Brushes.White, |
|||
Foreground = Brushes.Black |
|||
}, |
|||
|
|||
new Button |
|||
{ |
|||
Content = "BUTTON", |
|||
Width = 150, |
|||
Height = 40, |
|||
Background = Brushes.LightGreen, |
|||
Foreground = Brushes.Black |
|||
} |
|||
|
|||
} |
|||
} |
|||
}; |
|||
|
|||
return window; |
|||
} |
|||
|
|||
} |
|||
} |
|||
@ -1,121 +0,0 @@ |
|||
using Avalonia; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Controls.Presenters; |
|||
using Avalonia.Controls.Primitives; |
|||
using Avalonia.Controls.Templates; |
|||
using Avalonia.Media; |
|||
using Avalonia.Styling; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace TestApplication |
|||
{ |
|||
internal class SampleTabStyle : Styles |
|||
{ |
|||
public SampleTabStyle() |
|||
{ |
|||
this.AddRange(new[] |
|||
{ |
|||
new Style (s => s.Class("container").OfType<TabControl> ()) |
|||
{ |
|||
Setters = new[] |
|||
{ |
|||
new Setter (TemplatedControl.TemplateProperty, new FuncControlTemplate<TabControl>(TabControlTemplate)) |
|||
} |
|||
}, |
|||
|
|||
new Style(s => s.Class("container").OfType<TabControl>().Child().Child().Child().Child().Child().OfType<TabStripItem>()) |
|||
{ |
|||
Setters = new[] |
|||
{ |
|||
new Setter (TemplatedControl.TemplateProperty, new FuncControlTemplate<TabStripItem>(TabStripItemTemplate)), |
|||
} |
|||
}, |
|||
|
|||
new Style(s => s.Name("PART_TabStrip").OfType<TabStrip>().Child().OfType<TabStripItem>()) |
|||
{ |
|||
Setters = new[] |
|||
{ |
|||
new Setter(TemplatedControl.FontSizeProperty, 14.0), |
|||
new Setter(TemplatedControl.ForegroundProperty, Brushes.White) |
|||
} |
|||
}, |
|||
|
|||
new Style(s => s.Name("PART_TabStrip").OfType<TabStrip>().Child().OfType<TabStripItem>().Class(":selected")) |
|||
{ |
|||
Setters = new[] |
|||
{ |
|||
new Setter(TemplatedControl.ForegroundProperty, Brushes.White), |
|||
new Setter(TemplatedControl.BackgroundProperty, new SolidColorBrush(Colors.White, 0.1)), |
|||
}, |
|||
}, |
|||
}); |
|||
} |
|||
|
|||
public static Control TabStripItemTemplate(TabStripItem control) |
|||
{ |
|||
return new ContentPresenter |
|||
{ |
|||
DataTemplates = new DataTemplates |
|||
{ |
|||
new FuncDataTemplate<string>(x => new Border |
|||
{ |
|||
[~Border.BackgroundProperty] = control[~TemplatedControl.BackgroundProperty], |
|||
Padding = new Thickness(10), |
|||
Child = new TextBlock |
|||
{ |
|||
VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center, |
|||
Text = x |
|||
} |
|||
}) |
|||
}, |
|||
Name = "PART_ContentPresenter", |
|||
[~ContentPresenter.ContentProperty] = control[~ContentControl.ContentProperty], |
|||
}; |
|||
} |
|||
|
|||
public static Control TabControlTemplate(TabControl control) |
|||
{ |
|||
return new Grid |
|||
{ |
|||
ColumnDefinitions = new ColumnDefinitions |
|||
{ |
|||
new ColumnDefinition(GridLength.Auto), |
|||
new ColumnDefinition(new GridLength(1, GridUnitType.Star)), |
|||
}, |
|||
Children = new Controls |
|||
{ |
|||
new Border |
|||
{ |
|||
Width = 190, |
|||
Background = Brush.Parse("#1976D2"), |
|||
Child = new ScrollViewer |
|||
{ |
|||
Content = new TabStrip |
|||
{ |
|||
Name = "PART_TabStrip", |
|||
ItemsPanel = new FuncTemplate<IPanel>(() => new StackPanel { Orientation = Orientation.Vertical, Gap = 4 }), |
|||
Margin = new Thickness(0, 10, 0, 0), |
|||
MemberSelector = TabControl.HeaderSelector, |
|||
[!ItemsControl.ItemsProperty] = control[!ItemsControl.ItemsProperty], |
|||
[!!SelectingItemsControl.SelectedItemProperty] = control[!!SelectingItemsControl.SelectedItemProperty], |
|||
} |
|||
} |
|||
}, |
|||
new Carousel |
|||
{ |
|||
Name = "PART_Content", |
|||
MemberSelector = TabControl.ContentSelector, |
|||
[~Carousel.TransitionProperty] = control[~TabControl.TransitionProperty], |
|||
[!Carousel.ItemsProperty] = control[!ItemsControl.ItemsProperty], |
|||
[!Carousel.SelectedItemProperty] = control[!SelectingItemsControl.SelectedItemProperty], |
|||
[Grid.ColumnProperty] = 1, |
|||
} |
|||
} |
|||
}; |
|||
} |
|||
} |
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
namespace TestApplication |
|||
{ |
|||
internal class Item |
|||
{ |
|||
public string Name { get; set; } |
|||
public string Value { get; set; } |
|||
} |
|||
} |
|||
@ -1,902 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.IO; |
|||
using System.Reactive.Linq; |
|||
using System.Text; |
|||
using Avalonia; |
|||
using Avalonia.Animation; |
|||
using Avalonia.Collections; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Controls.Html; |
|||
using Avalonia.Controls.Primitives; |
|||
using Avalonia.Controls.Shapes; |
|||
using Avalonia.Controls.Templates; |
|||
using Avalonia.Data; |
|||
using Avalonia.Diagnostics; |
|||
using Avalonia.Layout; |
|||
using Avalonia.Media; |
|||
using Avalonia.Media.Imaging; |
|||
using Avalonia.Platform; |
|||
using Avalonia.Threading; |
|||
using TestApplication; |
|||
|
|||
namespace TestApplication |
|||
{ |
|||
class MainWindow |
|||
{ |
|||
private static readonly AvaloniaList<Node> s_treeData = new AvaloniaList<Node> |
|||
{ |
|||
new Node |
|||
{ |
|||
Name = "Root 1", |
|||
Children = new AvaloniaList<Node> |
|||
{ |
|||
new Node |
|||
{ |
|||
Name = "Child 1", |
|||
}, |
|||
new Node |
|||
{ |
|||
Name = "Child 2", |
|||
Children = new AvaloniaList<Node> |
|||
{ |
|||
new Node |
|||
{ |
|||
Name = "Grandchild 1", |
|||
}, |
|||
new Node |
|||
{ |
|||
Name = "Grandmaster Flash", |
|||
}, |
|||
} |
|||
}, |
|||
new Node |
|||
{ |
|||
Name = "Child 3", |
|||
}, |
|||
} |
|||
}, |
|||
new Node |
|||
{ |
|||
Name = "Root 2", |
|||
}, |
|||
}; |
|||
|
|||
private static readonly AvaloniaList<Item> s_listBoxData = new AvaloniaList<Item> |
|||
{ |
|||
new Item { Name = "Item 1", Value = "Item 1 Value" }, |
|||
new Item { Name = "Item 2", Value = "Item 2 Value" }, |
|||
new Item { Name = "Item 3", Value = "Item 3 Value" }, |
|||
new Item { Name = "Item 4", Value = "Item 4 Value" }, |
|||
new Item { Name = "Item 5", Value = "Item 5 Value" }, |
|||
new Item { Name = "Item 6", Value = "Item 6 Value" }, |
|||
new Item { Name = "Item 7", Value = "Item 7 Value" }, |
|||
new Item { Name = "Item 8", Value = "Item 8 Value" }, |
|||
}; |
|||
|
|||
public static Window Create() |
|||
{ |
|||
|
|||
TabControl container; |
|||
|
|||
|
|||
Window window = new Window |
|||
{ |
|||
Title = "Avalonia Test Application", |
|||
//Width = 900,
|
|||
//Height = 480,
|
|||
Content = (container = new TabControl |
|||
{ |
|||
Padding = new Thickness(5), |
|||
Items = new[] |
|||
{ |
|||
ButtonsTab(), |
|||
TextTab(), |
|||
HtmlTab(), |
|||
ImagesTab(), |
|||
ListsTab(), |
|||
LayoutTab(), |
|||
AnimationsTab(), |
|||
}, |
|||
Transition = new CrossFade(TimeSpan.FromSeconds(0.25)), |
|||
[Grid.RowProperty] = 1, |
|||
[Grid.ColumnSpanProperty] = 2, |
|||
}) |
|||
|
|||
}; |
|||
|
|||
container.Classes.Add("container"); |
|||
|
|||
window.Show(); |
|||
return window; |
|||
} |
|||
|
|||
private static TabItem ButtonsTab() |
|||
{ |
|||
var result = new TabItem |
|||
{ |
|||
Header = "Button", |
|||
Content = new ScrollViewer() |
|||
{ |
|||
CanScrollHorizontally = false, |
|||
Content = new StackPanel |
|||
{ |
|||
Margin = new Thickness(10), |
|||
Orientation = Orientation.Vertical, |
|||
Gap = 4, |
|||
Children = new Controls |
|||
{ |
|||
new TextBlock |
|||
{ |
|||
Text = "Button", |
|||
FontWeight = FontWeight.Medium, |
|||
FontSize = 20, |
|||
Foreground = Brush.Parse("#212121"), |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Text = "A button control", |
|||
FontSize = 13, |
|||
Foreground = Brush.Parse("#727272"), |
|||
Margin = new Thickness(0, 0, 0, 10) |
|||
}, |
|||
new Button |
|||
{ |
|||
Width = 150, |
|||
Content = "Button" |
|||
}, |
|||
new Button |
|||
{ |
|||
Width = 150, |
|||
Content = "Disabled", |
|||
IsEnabled = false, |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Margin = new Thickness(0, 40, 0, 0), |
|||
Text = "ToggleButton", |
|||
FontWeight = FontWeight.Medium, |
|||
FontSize = 20, |
|||
Foreground = Brush.Parse("#212121"), |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Text = "A toggle button control", |
|||
FontSize = 13, |
|||
Foreground = Brush.Parse("#727272"), |
|||
Margin = new Thickness(0, 0, 0, 10) |
|||
}, |
|||
new ToggleButton |
|||
{ |
|||
Width = 150, |
|||
IsChecked = true, |
|||
Content = "On" |
|||
}, |
|||
new ToggleButton |
|||
{ |
|||
Width = 150, |
|||
IsChecked = false, |
|||
Content = "Off" |
|||
}, |
|||
} |
|||
} |
|||
}, |
|||
}; |
|||
|
|||
|
|||
return result; |
|||
} |
|||
|
|||
private static TabItem HtmlTab() |
|||
{ |
|||
return new TabItem |
|||
{ |
|||
Header = "Text", |
|||
Content = new ScrollViewer() |
|||
{ |
|||
CanScrollHorizontally = false, |
|||
Content = new StackPanel() |
|||
{ |
|||
Margin = new Thickness(10), |
|||
Orientation = Orientation.Vertical, |
|||
Gap = 4, |
|||
Children = new Controls |
|||
{ |
|||
new TextBlock |
|||
{ |
|||
Text = "TextBlock", |
|||
FontWeight = FontWeight.Medium, |
|||
FontSize = 20, |
|||
Foreground = Brush.Parse("#212121"), |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Text = "A control for displaying text.", |
|||
FontSize = 13, |
|||
Foreground = Brush.Parse("#727272"), |
|||
Margin = new Thickness(0, 0, 0, 10) |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Text = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.", |
|||
FontSize = 11 |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Text = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.", |
|||
FontSize = 11, |
|||
FontWeight = FontWeight.Medium |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Text = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.", |
|||
FontSize = 11, |
|||
FontWeight = FontWeight.Bold |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Text = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.", |
|||
FontSize = 11, |
|||
FontStyle = FontStyle.Italic, |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Margin = new Thickness(0, 40, 0, 0), |
|||
Text = "HtmlLabel", |
|||
FontWeight = FontWeight.Medium, |
|||
FontSize = 20, |
|||
Foreground = Brush.Parse("#212121"), |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Text = "A label capable of displaying HTML content", |
|||
FontSize = 13, |
|||
Foreground = Brush.Parse("#727272"), |
|||
Margin = new Thickness(0, 0, 0, 10) |
|||
}, |
|||
new HtmlLabel |
|||
{ |
|||
Background = Brush.Parse("#CCCCCC"), |
|||
Padding = new Thickness(5), |
|||
Text = @"<p><strong>Pellentesque habitant morbi tristique</strong> senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. <em>Aenean ultricies mi vitae est.</em> Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, <code>commodo vitae</code>, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. <a href=""#"">Donec non enim</a> in turpis pulvinar facilisis. Ut felis.</p>
|
|||
<h2>Header Level 2</h2> |
|||
|
|||
<ol> |
|||
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li> |
|||
<li>Aliquam tincidunt mauris eu risus.</li> |
|||
</ol> |
|||
|
|||
<blockquote><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est.</p></blockquote> |
|||
|
|||
<h3>Header Level 3</h3> |
|||
|
|||
<ul> |
|||
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li> |
|||
<li>Aliquam tincidunt mauris eu risus.</li> |
|||
</ul>"
|
|||
} |
|||
} |
|||
} |
|||
} |
|||
}; |
|||
} |
|||
|
|||
private static TabItem TextTab() |
|||
{ |
|||
return new TabItem |
|||
{ |
|||
Header = "Input", |
|||
Content = new ScrollViewer() |
|||
{ |
|||
Content = new StackPanel |
|||
{ |
|||
Margin = new Thickness(10), |
|||
Orientation = Orientation.Vertical, |
|||
Gap = 4, |
|||
Children = new Controls |
|||
{ |
|||
new TextBlock |
|||
{ |
|||
Text = "TextBox", |
|||
FontWeight = FontWeight.Medium, |
|||
FontSize = 20, |
|||
Foreground = Brush.Parse("#212121"), |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Text = "A text box control", |
|||
FontSize = 13, |
|||
Foreground = Brush.Parse("#727272"), |
|||
Margin = new Thickness(0, 0, 0, 10) |
|||
}, |
|||
|
|||
new TextBox { Text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", Width = 200}, |
|||
new TextBox { Width = 200, Watermark="Watermark"}, |
|||
new TextBox { Width = 200, Watermark="Floating Watermark", UseFloatingWatermark = true }, |
|||
new TextBox { AcceptsReturn = true, TextWrapping = TextWrapping.Wrap, Width = 200, Height = 150, Text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est." }, |
|||
new TextBlock |
|||
{ |
|||
Margin = new Thickness(0, 40, 0, 0), |
|||
Text = "CheckBox", |
|||
FontWeight = FontWeight.Medium, |
|||
FontSize = 20, |
|||
Foreground = Brush.Parse("#212121"), |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Text = "A check box control", |
|||
FontSize = 13, |
|||
Foreground = Brush.Parse("#727272"), |
|||
Margin = new Thickness(0, 0, 0, 10) |
|||
}, |
|||
new CheckBox { IsChecked = true, Margin = new Thickness(0, 0, 0, 5), Content = "Checked" }, |
|||
new CheckBox { IsChecked = false, Content = "Unchecked" }, |
|||
new TextBlock |
|||
{ |
|||
Margin = new Thickness(0, 40, 0, 0), |
|||
Text = "RadioButton", |
|||
FontWeight = FontWeight.Medium, |
|||
FontSize = 20, |
|||
Foreground = Brush.Parse("#212121"), |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Text = "A radio button control", |
|||
FontSize = 13, |
|||
Foreground = Brush.Parse("#727272"), |
|||
Margin = new Thickness(0, 0, 0, 10) |
|||
}, |
|||
new RadioButton { IsChecked = true, Content = "Option 1" }, |
|||
new RadioButton { IsChecked = false, Content = "Option 2" }, |
|||
new RadioButton { IsChecked = false, Content = "Option 3" }, |
|||
} |
|||
} |
|||
} |
|||
}; |
|||
} |
|||
|
|||
public static string RootNamespace; |
|||
|
|||
static Stream GetImage(string path) |
|||
{ |
|||
return AvaloniaLocator.Current.GetService<IAssetLoader>().Open(new Uri("resm:" + RootNamespace + "." + path)); |
|||
} |
|||
|
|||
private static TabItem ListsTab() |
|||
{ |
|||
return new TabItem |
|||
{ |
|||
Header = "Lists", |
|||
Content = new ScrollViewer() |
|||
{ |
|||
CanScrollHorizontally = false, |
|||
Content = new StackPanel |
|||
{ |
|||
HorizontalAlignment = HorizontalAlignment.Left, |
|||
Orientation = Orientation.Vertical, |
|||
VerticalAlignment = VerticalAlignment.Top, |
|||
Gap = 4, |
|||
Margin = new Thickness(10), |
|||
DataTemplates = new DataTemplates |
|||
{ |
|||
new FuncDataTemplate<Item>(x => |
|||
new StackPanel |
|||
{ |
|||
Gap = 4, |
|||
Orientation = Orientation.Horizontal, |
|||
Children = new Controls |
|||
{ |
|||
new Image { Width = 50, Height = 50, Source = new Bitmap(GetImage("github_icon.png")) }, |
|||
new TextBlock { Text = x.Name, FontSize = 18 } |
|||
} |
|||
}) |
|||
}, |
|||
Children = new Controls |
|||
{ |
|||
new TextBlock |
|||
{ |
|||
Text = "ListBox", |
|||
FontWeight = FontWeight.Medium, |
|||
FontSize = 20, |
|||
Foreground = Brush.Parse("#212121"), |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Text = "A list box control.", |
|||
FontSize = 13, |
|||
Foreground = Brush.Parse("#727272"), |
|||
Margin = new Thickness(0, 0, 0, 10) |
|||
}, |
|||
new ListBox |
|||
{ |
|||
BorderThickness = 2, |
|||
Items = s_listBoxData, |
|||
Height = 300, |
|||
Width = 300, |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Margin = new Thickness(0, 40, 0, 0), |
|||
Text = "TreeView", |
|||
FontWeight = FontWeight.Medium, |
|||
FontSize = 20, |
|||
Foreground = Brush.Parse("#212121"), |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Text = "A tree view control.", |
|||
FontSize = 13, |
|||
Foreground = Brush.Parse("#727272"), |
|||
Margin = new Thickness(0, 0, 0, 10) |
|||
}, |
|||
new TreeView |
|||
{ |
|||
Name = "treeView", |
|||
Items = s_treeData, |
|||
Height = 300, |
|||
BorderThickness = 2, |
|||
Width = 300, |
|||
} |
|||
} |
|||
}, |
|||
} |
|||
}; |
|||
} |
|||
|
|||
private static TabItem ImagesTab() |
|||
{ |
|||
var imageCarousel = new Carousel |
|||
{ |
|||
Width = 400, |
|||
Height = 400, |
|||
Transition = new PageSlide(TimeSpan.FromSeconds(0.25)), |
|||
Items = new[] |
|||
{ |
|||
new Image { Source = new Bitmap(GetImage("github_icon.png")), Width = 400, Height = 400 }, |
|||
new Image { Source = new Bitmap(GetImage("pattern.jpg")), Width = 400, Height = 400 }, |
|||
} |
|||
}; |
|||
|
|||
var next = new Button |
|||
{ |
|||
VerticalAlignment = VerticalAlignment.Center, |
|||
Padding = new Thickness(20), |
|||
Content = new Avalonia.Controls.Shapes.Path |
|||
{ |
|||
Data = StreamGeometry.Parse("M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z"), |
|||
Fill = Brushes.Black |
|||
} |
|||
}; |
|||
|
|||
var prev = new Button |
|||
{ |
|||
VerticalAlignment = VerticalAlignment.Center, |
|||
Padding = new Thickness(20), |
|||
Content = new Avalonia.Controls.Shapes.Path |
|||
{ |
|||
Data = StreamGeometry.Parse("M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z"), |
|||
Fill = Brushes.Black |
|||
} |
|||
}; |
|||
|
|||
prev.Click += (s, e) => |
|||
{ |
|||
if (imageCarousel.SelectedIndex == 0) |
|||
imageCarousel.SelectedIndex = 1; |
|||
else |
|||
imageCarousel.SelectedIndex--; |
|||
}; |
|||
|
|||
next.Click += (s, e) => |
|||
{ |
|||
if (imageCarousel.SelectedIndex == 1) |
|||
imageCarousel.SelectedIndex = 0; |
|||
else |
|||
imageCarousel.SelectedIndex++; |
|||
}; |
|||
|
|||
return new TabItem |
|||
{ |
|||
Header = "Images", |
|||
Content = new ScrollViewer |
|||
{ |
|||
Content = new StackPanel |
|||
{ |
|||
HorizontalAlignment = HorizontalAlignment.Left, |
|||
Orientation = Orientation.Vertical, |
|||
VerticalAlignment = VerticalAlignment.Top, |
|||
Gap = 4, |
|||
Margin = new Thickness(10), |
|||
Children = new Controls |
|||
{ |
|||
new TextBlock |
|||
{ |
|||
Text = "Carousel", |
|||
FontWeight = FontWeight.Medium, |
|||
FontSize = 20, |
|||
Foreground = Brush.Parse("#212121"), |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Text = "An items control that displays its items as pages that fill the controls.", |
|||
FontSize = 13, |
|||
Foreground = Brush.Parse("#727272"), |
|||
Margin = new Thickness(0, 0, 0, 10) |
|||
}, |
|||
new StackPanel |
|||
{ |
|||
Name = "carouselVisual", |
|||
Orientation = Orientation.Horizontal, |
|||
Gap = 4, |
|||
Children = new Controls |
|||
{ |
|||
prev, |
|||
imageCarousel, |
|||
next |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}; |
|||
} |
|||
|
|||
private static TabItem LayoutTab() |
|||
{ |
|||
var polylinePoints = new Point[] { new Point(0, 0), new Point(5, 0), new Point(6, -2), new Point(7, 3), new Point(8, -3), |
|||
new Point(9, 1), new Point(10, 0), new Point(15, 0) }; |
|||
var polygonPoints = new Point[] { new Point(5, 0), new Point(8, 8), new Point(0, 3), new Point(10, 3), new Point(2, 8) }; |
|||
for (int i = 0; i < polylinePoints.Length; i++) |
|||
{ |
|||
polylinePoints[i] = polylinePoints[i] * 13; |
|||
} |
|||
for (int i = 0; i < polygonPoints.Length; i++) |
|||
{ |
|||
polygonPoints[i] = polygonPoints[i] * 15; |
|||
} |
|||
return new TabItem |
|||
{ |
|||
Header = "Layout", |
|||
Content = new ScrollViewer |
|||
{ |
|||
Content = new StackPanel |
|||
{ |
|||
HorizontalAlignment = HorizontalAlignment.Left, |
|||
Orientation = Orientation.Vertical, |
|||
VerticalAlignment = VerticalAlignment.Top, |
|||
Gap = 4, |
|||
Margin = new Thickness(10), |
|||
Children = new Controls |
|||
{ |
|||
new TextBlock |
|||
{ |
|||
Text = "Grid", |
|||
FontWeight = FontWeight.Medium, |
|||
FontSize = 20, |
|||
Foreground = Brush.Parse("#212121"), |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Text = "Lays out child controls according to a grid.", |
|||
FontSize = 13, |
|||
Foreground = Brush.Parse("#727272"), |
|||
Margin = new Thickness(0, 0, 0, 10) |
|||
}, |
|||
new Grid |
|||
{ |
|||
Width = 600, |
|||
ColumnDefinitions = new ColumnDefinitions |
|||
{ |
|||
new ColumnDefinition(1, GridUnitType.Star), |
|||
new ColumnDefinition(1, GridUnitType.Star), |
|||
}, |
|||
|
|||
RowDefinitions = new RowDefinitions |
|||
{ |
|||
new RowDefinition(1, GridUnitType.Auto), |
|||
new RowDefinition(1, GridUnitType.Auto) |
|||
}, |
|||
Children = new Controls |
|||
{ |
|||
|
|||
new Rectangle |
|||
{ |
|||
Fill = Brush.Parse("#FF5722"), |
|||
[Grid.ColumnSpanProperty] = 2, |
|||
Height = 200, |
|||
Margin = new Thickness(2.5) |
|||
}, |
|||
new Rectangle |
|||
{ |
|||
Fill = Brush.Parse("#FF5722"), |
|||
[Grid.RowProperty] = 1, |
|||
Height = 100, |
|||
Margin = new Thickness(2.5) |
|||
}, |
|||
new Rectangle |
|||
{ |
|||
Fill = Brush.Parse("#FF5722"), |
|||
[Grid.RowProperty] = 1, |
|||
[Grid.ColumnProperty] = 1, |
|||
Height = 100, |
|||
Margin = new Thickness(2.5) |
|||
}, |
|||
}, |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Margin = new Thickness(0, 40, 0, 0), |
|||
Text = "StackPanel", |
|||
FontWeight = FontWeight.Medium, |
|||
FontSize = 20, |
|||
Foreground = Brush.Parse("#212121"), |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Text = "A panel which lays out its children horizontally or vertically.", |
|||
FontSize = 13, |
|||
Foreground = Brush.Parse("#727272"), |
|||
Margin = new Thickness(0, 0, 0, 10) |
|||
}, |
|||
new StackPanel |
|||
{ |
|||
Orientation = Orientation.Vertical, |
|||
Gap = 4, |
|||
Width = 300, |
|||
Children = new Controls |
|||
{ |
|||
new Rectangle |
|||
{ |
|||
Fill = Brush.Parse("#FFC107"), |
|||
Height = 50, |
|||
}, |
|||
new Rectangle |
|||
{ |
|||
Fill = Brush.Parse("#FFC107"), |
|||
Height = 50, |
|||
}, |
|||
new Rectangle |
|||
{ |
|||
Fill = Brush.Parse("#FFC107"), |
|||
Height = 50, |
|||
}, |
|||
} |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Margin = new Thickness(0, 40, 0, 0), |
|||
Text = "Canvas", |
|||
FontWeight = FontWeight.Medium, |
|||
FontSize = 20, |
|||
Foreground = Brush.Parse("#212121"), |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Text = "A panel which lays out its children by explicit coordinates.", |
|||
FontSize = 13, |
|||
Foreground = Brush.Parse("#727272"), |
|||
Margin = new Thickness(0, 0, 0, 10) |
|||
}, |
|||
new Canvas |
|||
{ |
|||
Background = Brushes.Yellow, |
|||
Width = 300, |
|||
Height = 400, |
|||
Children = new Controls |
|||
{ |
|||
new Rectangle |
|||
{ |
|||
Fill = Brushes.Blue, |
|||
Width = 63, |
|||
Height = 41, |
|||
[Canvas.LeftProperty] = 40, |
|||
[Canvas.TopProperty] = 31, |
|||
}, |
|||
new Ellipse |
|||
{ |
|||
Fill = Brushes.Green, |
|||
Width = 58, |
|||
Height = 58, |
|||
[Canvas.LeftProperty] = 130, |
|||
[Canvas.TopProperty] = 79, |
|||
}, |
|||
new Line |
|||
{ |
|||
Stroke = Brushes.Red, |
|||
StrokeThickness = 2, |
|||
StartPoint = new Point(120, 185), |
|||
EndPoint = new Point(30, 115) |
|||
}, |
|||
new Avalonia.Controls.Shapes.Path |
|||
{ |
|||
Fill = Brushes.Orange, |
|||
Data = StreamGeometry.Parse("M 30,250 c 50,0 50,-50 c 50,0 50,50 h -50 v 50 l -50,-50 Z"), |
|||
}, |
|||
new Polygon |
|||
{ |
|||
Stroke = Brushes.DarkBlue, |
|||
Fill = Brushes.Violet, |
|||
Points = polygonPoints, |
|||
StrokeThickness = 1, |
|||
[Canvas.LeftProperty] = 150, |
|||
[Canvas.TopProperty] = 180, |
|||
}, |
|||
new Polyline |
|||
{ |
|||
Stroke = Brushes.Brown, |
|||
Points = polylinePoints, |
|||
StrokeThickness = 5, |
|||
StrokeJoin = PenLineJoin.Round, |
|||
StrokeStartLineCap = PenLineCap.Triangle, |
|||
StrokeEndLineCap = PenLineCap.Triangle, |
|||
[Canvas.LeftProperty] = 30, |
|||
[Canvas.TopProperty] = 350, |
|||
}, |
|||
} |
|||
}, |
|||
} |
|||
} |
|||
} |
|||
}; |
|||
} |
|||
|
|||
private static TabItem AnimationsTab() |
|||
{ |
|||
Border border1; |
|||
Border border2; |
|||
RotateTransform rotate; |
|||
Button button1; |
|||
|
|||
var result = new TabItem |
|||
{ |
|||
Header = "Animations", |
|||
Content = new StackPanel |
|||
{ |
|||
Orientation = Orientation.Vertical, |
|||
Gap = 4, |
|||
Margin = new Thickness(10), |
|||
Children = new Controls |
|||
{ |
|||
new TextBlock |
|||
{ |
|||
Text = "Animations", |
|||
FontWeight = FontWeight.Medium, |
|||
FontSize = 20, |
|||
Foreground = Brush.Parse("#212121"), |
|||
}, |
|||
new TextBlock |
|||
{ |
|||
Text = "A few animations showcased below", |
|||
FontSize = 13, |
|||
Foreground = Brush.Parse("#727272"), |
|||
Margin = new Thickness(0, 0, 0, 10) |
|||
}, |
|||
(button1 = new Button |
|||
{ |
|||
Content = "Animate", |
|||
Width = 120, |
|||
[Grid.ColumnProperty] = 1, |
|||
[Grid.RowProperty] = 1, |
|||
}), |
|||
new Canvas |
|||
{ |
|||
ClipToBounds = false, |
|||
Children = new Controls |
|||
{ |
|||
(border1 = new Border |
|||
{ |
|||
Width = 100, |
|||
Height = 100, |
|||
HorizontalAlignment = HorizontalAlignment.Center, |
|||
VerticalAlignment = VerticalAlignment.Center, |
|||
Background = Brushes.Crimson, |
|||
RenderTransform = new RotateTransform(), |
|||
Child = new Grid |
|||
{ |
|||
Children = new Controls |
|||
{ |
|||
new Ellipse() |
|||
{ |
|||
Width = 100, |
|||
Height = 100, |
|||
Fill = |
|||
new RadialGradientBrush() |
|||
{ |
|||
GradientStops = |
|||
{ |
|||
new GradientStop(Colors.Blue, 0), |
|||
new GradientStop(Colors.Green, 1) |
|||
}, |
|||
Radius = 75 |
|||
} |
|||
}, |
|||
new Avalonia.Controls.Shapes.Path |
|||
{ |
|||
Data = |
|||
StreamGeometry.Parse( |
|||
"F1 M 16.6309,18.6563C 17.1309,8.15625 29.8809,14.1563 29.8809,14.1563C 30.8809,11.1563 34.1308,11.4063 34.1308,11.4063C 33.5,12 34.6309,13.1563 34.6309,13.1563C 32.1309,13.1562 31.1309,14.9062 31.1309,14.9062C 41.1309,23.9062 32.6309,27.9063 32.6309,27.9062C 24.6309,24.9063 21.1309,22.1562 16.6309,18.6563 Z M 16.6309,19.9063C 21.6309,24.1563 25.1309,26.1562 31.6309,28.6562C 31.6309,28.6562 26.3809,39.1562 18.3809,36.1563C 18.3809,36.1563 18,38 16.3809,36.9063C 15,36 16.3809,34.9063 16.3809,34.9063C 16.3809,34.9063 10.1309,30.9062 16.6309,19.9063 Z"), |
|||
Fill = |
|||
new LinearGradientBrush() |
|||
{ |
|||
GradientStops = |
|||
{ |
|||
new GradientStop(Colors.Green, 0), |
|||
new GradientStop(Colors.LightSeaGreen, 1) |
|||
} |
|||
}, |
|||
HorizontalAlignment = HorizontalAlignment.Center, |
|||
VerticalAlignment = VerticalAlignment.Center, |
|||
RenderTransform = new MatrixTransform(Matrix.CreateScale(2, 2)) |
|||
} |
|||
} |
|||
}, |
|||
[Canvas.LeftProperty] = 100, |
|||
[Canvas.TopProperty] = 100, |
|||
}), |
|||
(border2 = new Border |
|||
{ |
|||
Width = 100, |
|||
Height = 100, |
|||
HorizontalAlignment = HorizontalAlignment.Center, |
|||
VerticalAlignment = VerticalAlignment.Center, |
|||
Background = Brushes.Coral, |
|||
Child = new Image |
|||
{ |
|||
Source = new Bitmap(GetImage("github_icon.png")), |
|||
HorizontalAlignment = HorizontalAlignment.Center, |
|||
VerticalAlignment = VerticalAlignment.Center, |
|||
}, |
|||
RenderTransform = (rotate = new RotateTransform |
|||
{ |
|||
PropertyTransitions = new PropertyTransitions |
|||
{ |
|||
RotateTransform.AngleProperty.Transition(500), |
|||
} |
|||
}), |
|||
PropertyTransitions = new PropertyTransitions |
|||
{ |
|||
Layoutable.WidthProperty.Transition(300), |
|||
Layoutable.HeightProperty.Transition(1000), |
|||
}, |
|||
[Canvas.LeftProperty] = 400, |
|||
[Canvas.TopProperty] = 100, |
|||
}), |
|||
} |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
|
|||
button1.Click += (s, e) => |
|||
{ |
|||
if (border2.Width == 100) |
|||
{ |
|||
border2.Width = border2.Height = 400; |
|||
rotate.Angle = 180; |
|||
} |
|||
else |
|||
{ |
|||
border2.Width = border2.Height = 100; |
|||
rotate.Angle = 0; |
|||
} |
|||
}; |
|||
|
|||
var start = Animate.Stopwatch.Elapsed; |
|||
var degrees = Animate.Timer |
|||
.Select(x => |
|||
{ |
|||
var elapsed = (x - start).TotalSeconds; |
|||
var cycles = elapsed / 4; |
|||
var progress = cycles % 1; |
|||
return 360.0 * progress; |
|||
}); |
|||
|
|||
border1.RenderTransform.Bind( |
|||
RotateTransform.AngleProperty, |
|||
degrees, |
|||
BindingPriority.Animation); |
|||
|
|||
return result; |
|||
} |
|||
} |
|||
} |
|||
@ -1,16 +0,0 @@ |
|||
using Avalonia.Collections; |
|||
|
|||
namespace TestApplication |
|||
{ |
|||
internal class Node |
|||
{ |
|||
public Node() |
|||
{ |
|||
Children = new AvaloniaList<Node>(); |
|||
} |
|||
|
|||
public string Name { get; set; } |
|||
public AvaloniaList<Node> Children { get; set; } |
|||
} |
|||
|
|||
} |
|||
@ -1,29 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<PropertyGroup> |
|||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects> |
|||
<HasSharedItems>true</HasSharedItems> |
|||
<SharedGUID>78345174-5b52-4a14-b9fd-d5f2428137f0</SharedGUID> |
|||
</PropertyGroup> |
|||
<PropertyGroup Label="Configuration"> |
|||
<Import_RootNamespace>TestApplication</Import_RootNamespace> |
|||
</PropertyGroup> |
|||
<ItemGroup> |
|||
<Compile Include="$(MSBuildThisFileDirectory)App.cs" /> |
|||
<Compile Include="$(MSBuildThisFileDirectory)GalleryStyle.cs" /> |
|||
<Compile Include="$(MSBuildThisFileDirectory)Item.cs" /> |
|||
<Compile Include="$(MSBuildThisFileDirectory)MainWindow.cs" /> |
|||
<Compile Include="$(MSBuildThisFileDirectory)Node.cs" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)html.htm" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)github_icon.png"> |
|||
<CopyToOutputDirectory>Never</CopyToOutputDirectory> |
|||
</EmbeddedResource> |
|||
<EmbeddedResource Include="$(MSBuildThisFileDirectory)pattern.jpg"> |
|||
<CopyToOutputDirectory>Never</CopyToOutputDirectory> |
|||
</EmbeddedResource> |
|||
</ItemGroup> |
|||
</Project> |
|||
@ -1,13 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<PropertyGroup Label="Globals"> |
|||
<ProjectGuid>78345174-5b52-4a14-b9fd-d5f2428137f0</ProjectGuid> |
|||
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion> |
|||
</PropertyGroup> |
|||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> |
|||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" /> |
|||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" /> |
|||
<PropertyGroup /> |
|||
<Import Project="TestApplicationShared.projitems" Label="Shared" /> |
|||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" /> |
|||
</Project> |
|||
@ -1,26 +0,0 @@ |
|||
<ProjectConfiguration> |
|||
<AutoDetectNugetBuildDependencies>true</AutoDetectNugetBuildDependencies> |
|||
<BuildPriority>1000</BuildPriority> |
|||
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace> |
|||
<ConsiderInconclusiveTestsAsPassing>false</ConsiderInconclusiveTestsAsPassing> |
|||
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies> |
|||
<AllowDynamicCodeContractChecking>true</AllowDynamicCodeContractChecking> |
|||
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking> |
|||
<AllowCodeAnalysis>false</AllowCodeAnalysis> |
|||
<IgnoreThisComponentCompletely>true</IgnoreThisComponentCompletely> |
|||
<RunPreBuildEvents>false</RunPreBuildEvents> |
|||
<RunPostBuildEvents>false</RunPostBuildEvents> |
|||
<PreviouslyBuiltSuccessfully>false</PreviouslyBuiltSuccessfully> |
|||
<InstrumentAssembly>true</InstrumentAssembly> |
|||
<PreventSigningOfAssembly>false</PreventSigningOfAssembly> |
|||
<AnalyseExecutionTimes>true</AnalyseExecutionTimes> |
|||
<DetectStackOverflow>true</DetectStackOverflow> |
|||
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace> |
|||
<DefaultTestTimeout>60000</DefaultTestTimeout> |
|||
<UseBuildConfiguration /> |
|||
<UseBuildPlatform /> |
|||
<ProxyProcessPath /> |
|||
<UseCPUArchitecture>AutoDetect</UseCPUArchitecture> |
|||
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState> |
|||
<BuildProcessArchitecture>x86</BuildProcessArchitecture> |
|||
</ProjectConfiguration> |
|||
|
Before Width: | Height: | Size: 17 KiB |
@ -1,128 +0,0 @@ |
|||
<html> |
|||
<head> |
|||
<title>Intro</title> |
|||
<style> |
|||
h1, h2, h3 { color: navy; font-weight:normal; } |
|||
h1 { margin-bottom: .47em } |
|||
h2 { margin-bottom: .3em } |
|||
h3 { margin-bottom: .4em } |
|||
ul { margin-top: .5em } |
|||
ul li {margin: .25em} |
|||
body { font:10pt Tahoma } |
|||
pre { border:solid 1px gray; background-color:#eee; padding:1em } |
|||
a:link { text-decoration: none; } |
|||
a:hover { text-decoration: underline; } |
|||
.gray { color:gray; } |
|||
.example { background-color:#efefef; corner-radius:5px; padding:0.5em; } |
|||
.whitehole { background-color:white; corner-radius:10px; padding:15px; } |
|||
.caption { font-size: 1.1em } |
|||
.comment { color: green; margin-bottom: 5px; margin-left: 3px; } |
|||
.comment2 { color: green; } |
|||
</style> |
|||
</head> |
|||
<body style=" margin: 0; background-color: #333; background-gradient: #707; background-gradient-angle: 60;"> |
|||
<h1 align="center" style="color: white;"> |
|||
HTML Renderer Project - Avalonia port |
|||
<br /> |
|||
<span style="font-size: x-small;">Beta support</span> |
|||
</h1> |
|||
<blockquote class="whitehole"> |
|||
<p style="margin-top: 0px"> |
|||
<table border="0" width="100%"> |
|||
<tr style="vertical-align: top> |
|||
<td> |
|||
Everything you see on this panel (see samples on the left) is <b>custom-painted</b> |
|||
by the <b>HTML Renderer</b>, including tables, images, links and videos.<br /> |
|||
This project allows you to have the rich format power of HTML on your desktop applications |
|||
without <b>WebBrowser</b> control or <b>MSHTML</b>.<br /> |
|||
The library is <b>100% managed code</b> without any external dependencies, the only |
|||
requirement is <b>.NET 2.0 or higher</b>, including support for Client Profile. |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
</p> |
|||
<h3> |
|||
Text selection (copy to clipboard) |
|||
</h3> |
|||
<div> |
|||
The rendered html has full support for <b>text selection</b> including <b>drag-and-drop</b> |
|||
and <b>copy</b> to clipboard of rich html and plain text to handle <b>paste</b> |
|||
operation to editor that support rich or/and plain text.<br /> |
|||
Additionally there is a <b>context-menu</b> with select all, copy text, copy image, |
|||
save image, open link, copy link url, open video, copy video url. |
|||
</div> |
|||
<h3> |
|||
Cascading Style Sheets (CSS) support |
|||
</h3> |
|||
<div> |
|||
The core layout engine of the renderer was builded according to <b>CSS Level 2 specification</b>, |
|||
so you can use Cascading Style Sheets to format your html documents.<br /> |
|||
Additionally there are a couple extensions: <b>Gradients</b> on backgrounds and |
|||
<b>rounded corners</b>. |
|||
</div> |
|||
|
|||
<h3> |
|||
Benefits |
|||
</h3> |
|||
<ul> |
|||
<li>100% managed code and no external dependencies.</li> |
|||
<li>Supports .NET 2.0 or higher including Client Profile.</li> |
|||
<li>Handles "real world" malformed HTML, it doesn't have to be XHTML.</li> |
|||
<li>Lightweight (~300K).</li> |
|||
<li>High performance and low memory footprint.</li> |
|||
<li>Extendable and configurable.</li> |
|||
</ul> |
|||
<h3> |
|||
Limitations |
|||
</h3> |
|||
<ul> |
|||
<li>All HTML <b>end tags</b> marked as <a href="http://www.w3.org/TR/1999/REC-html401-19991224/index/elements.html"> |
|||
optional</a> should be there. No problem with tags marked as forbidden.</li> |
|||
</ul> |
|||
<hr /> |
|||
<h3> |
|||
On the roadmap</h3> |
|||
Of course it's not quite finished yet. Here are some of the important things to |
|||
do. |
|||
<ul> |
|||
<li>Better performance</li> |
|||
<li>Support of position CSS property</li> |
|||
<li>Support of height and min-height CSS property</li> |
|||
<li>Better tables support, especially layouts</li> |
|||
<li>Support image align</li> |
|||
<li>Handle :hover selector</li> |
|||
<li>Selection by shift+arrows</li> |
|||
<li>Better HTML tag parsing (optional closing tags)</li> |
|||
<li>More styles support</li> |
|||
</ul> |
|||
<h3> |
|||
Vision |
|||
</h3> |
|||
<ul> |
|||
<li>Most complete static HTML Renderer (no java script).</li> |
|||
<li>Commercial web browser performance level.</li> |
|||
</ul> |
|||
<hr /> |
|||
<h3> |
|||
2015 - Nikita Tsukanov (Avalonia Port) |
|||
|
|||
</h3> |
|||
<blockquote> |
|||
<a href="https://avalonia.github.io/">https://avalonia.github.io/</a> |
|||
</blockquote> |
|||
|
|||
<h3> |
|||
2012 - Arthur Teplitzki |
|||
</h3> |
|||
<blockquote> |
|||
<a href="http://theartofdev.com/">http://TheArtOfDev.com</a> |
|||
</blockquote> |
|||
<h3> |
|||
2009 - Jose Manuel Menendez Poo |
|||
</h3> |
|||
<blockquote> |
|||
<a href="http://www.menendezpoo.com">www.menendezpoo.com</a> |
|||
</blockquote> |
|||
</blockquote> |
|||
</body> |
|||
</html> |
|||
|
Before Width: | Height: | Size: 133 KiB |
@ -1,22 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<configuration> |
|||
<startup> |
|||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> |
|||
</startup> |
|||
<runtime> |
|||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> |
|||
<dependentAssembly> |
|||
<assemblyIdentity name="SharpDX.Direct2D1" publicKeyToken="b4dcf0f35e5521f1" culture="neutral" /> |
|||
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" /> |
|||
</dependentAssembly> |
|||
<dependentAssembly> |
|||
<assemblyIdentity name="SharpDX" publicKeyToken="b4dcf0f35e5521f1" culture="neutral" /> |
|||
<bindingRedirect oldVersion="0.0.0.0-3.0.2.0" newVersion="3.0.2.0" /> |
|||
</dependentAssembly> |
|||
<dependentAssembly> |
|||
<assemblyIdentity name="SharpDX.DXGI" publicKeyToken="b4dcf0f35e5521f1" culture="neutral" /> |
|||
<bindingRedirect oldVersion="0.0.0.0-3.0.2.0" newVersion="3.0.2.0" /> |
|||
</dependentAssembly> |
|||
</assemblyBinding> |
|||
</runtime> |
|||
</configuration> |
|||
@ -1,11 +0,0 @@ |
|||
// Copyright (c) The Avalonia Project. All rights reserved.
|
|||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|||
|
|||
using System; |
|||
using Avalonia.Logging.Serilog; |
|||
using Serilog; |
|||
|
|||
namespace XamlTestApplication |
|||
{ |
|||
// No longer needed!
|
|||
} |
|||
@ -1,38 +0,0 @@ |
|||
// Copyright (c) The Avalonia Project. All rights reserved.
|
|||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|||
|
|||
using System.Linq; |
|||
using System.Diagnostics; |
|||
using System.Windows.Threading; |
|||
using Avalonia; |
|||
using Serilog; |
|||
using Avalonia.Logging.Serilog; |
|||
using Avalonia.Controls; |
|||
|
|||
namespace XamlTestApplication |
|||
{ |
|||
internal class Program |
|||
{ |
|||
private static void Main(string[] args) |
|||
{ |
|||
// this sucks. Can we fix this? Do we even need it anymore?
|
|||
var foo = Dispatcher.CurrentDispatcher; |
|||
|
|||
InitializeLogging(); |
|||
|
|||
AppBuilder.Configure<XamlTestApp>() |
|||
.UsePlatformDetect() |
|||
.Start<Views.MainWindow>(); |
|||
} |
|||
|
|||
private static void InitializeLogging() |
|||
{ |
|||
#if DEBUG
|
|||
SerilogLogger.Initialize(new LoggerConfiguration() |
|||
.MinimumLevel.Warning() |
|||
.WriteTo.Trace(outputTemplate: "{Area}: {Message}") |
|||
.CreateLogger()); |
|||
#endif
|
|||
} |
|||
} |
|||
} |
|||
@ -1,39 +0,0 @@ |
|||
// Copyright (c) The Avalonia Project. All rights reserved.
|
|||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|||
|
|||
using System.Reflection; |
|||
using System.Runtime.CompilerServices; |
|||
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("TestApplication")] |
|||
[assembly: AssemblyDescription("")] |
|||
[assembly: AssemblyConfiguration("")] |
|||
[assembly: AssemblyCompany("")] |
|||
[assembly: AssemblyProduct("TestApplication")] |
|||
[assembly: AssemblyCopyright("Copyright \u00A9 2013")] |
|||
[assembly: AssemblyTrademark("")] |
|||
[assembly: AssemblyCulture("")] |
|||
|
|||
// Setting ComVisible to false makes the types in this assembly not visible
|
|||
// to COM components. If you need to access a type in this assembly from
|
|||
// COM, set the ComVisible attribute to true on that type.
|
|||
[assembly: ComVisible(false)] |
|||
|
|||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|||
[assembly: Guid("f8dad012-f4ec-4b63-b64f-320901338290")] |
|||
|
|||
// 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,187 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> |
|||
<PropertyGroup> |
|||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|||
<ProjectGuid>{78CAFE33-DBEB-4132-8A28-81CFE8A4933C}</ProjectGuid> |
|||
<OutputType>WinExe</OutputType> |
|||
<AppDesignerFolder>Properties</AppDesignerFolder> |
|||
<RootNamespace>XamlTestApplication</RootNamespace> |
|||
<AssemblyName>XamlTestApplication</AssemblyName> |
|||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> |
|||
<FileAlignment>512</FileAlignment> |
|||
<NuGetPackageImportStamp> |
|||
</NuGetPackageImportStamp> |
|||
<TargetFrameworkProfile /> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|||
<PlatformTarget>AnyCPU</PlatformTarget> |
|||
<DebugSymbols>true</DebugSymbols> |
|||
<DebugType>full</DebugType> |
|||
<Optimize>false</Optimize> |
|||
<OutputPath>bin\Debug\</OutputPath> |
|||
<DefineConstants>TRACE;DEBUG</DefineConstants> |
|||
<ErrorReport>prompt</ErrorReport> |
|||
<WarningLevel>4</WarningLevel> |
|||
<Prefer32Bit>true</Prefer32Bit> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|||
<PlatformTarget>AnyCPU</PlatformTarget> |
|||
<DebugType>pdbonly</DebugType> |
|||
<Optimize>true</Optimize> |
|||
<OutputPath>bin\Release\</OutputPath> |
|||
<DefineConstants>TRACE</DefineConstants> |
|||
<ErrorReport>prompt</ErrorReport> |
|||
<WarningLevel>4</WarningLevel> |
|||
</PropertyGroup> |
|||
<ItemGroup> |
|||
<Reference Include="Serilog, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL"> |
|||
<HintPath>..\..\packages\Serilog.1.5.14\lib\net45\Serilog.dll</HintPath> |
|||
<Private>True</Private> |
|||
</Reference> |
|||
<Reference Include="Serilog.FullNetFx, Version=1.5.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL"> |
|||
<HintPath>..\..\packages\Serilog.1.5.14\lib\net45\Serilog.FullNetFx.dll</HintPath> |
|||
<Private>True</Private> |
|||
</Reference> |
|||
<Reference Include="Splat, Version=1.6.2.0, Culture=neutral, processorArchitecture=MSIL"> |
|||
<HintPath>..\..\packages\Splat.1.6.2\lib\Net45\Splat.dll</HintPath> |
|||
<Private>True</Private> |
|||
</Reference> |
|||
<Reference Include="Sprache, Version=2.0.0.51, Culture=neutral, processorArchitecture=MSIL"> |
|||
<HintPath>..\..\packages\Sprache.2.0.0.51\lib\portable-net4+netcore45+win8+wp8+sl5+MonoAndroid+Xamarin.iOS10+MonoTouch\Sprache.dll</HintPath> |
|||
<Private>True</Private> |
|||
</Reference> |
|||
<Reference Include="System" /> |
|||
<Reference Include="System.Core" /> |
|||
<Reference Include="System.Drawing" /> |
|||
<Reference Include="System.Reactive.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> |
|||
<HintPath>..\..\packages\System.Reactive.Core.3.0.0\lib\net45\System.Reactive.Core.dll</HintPath> |
|||
<Private>True</Private> |
|||
</Reference> |
|||
<Reference Include="System.Reactive.Interfaces, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> |
|||
<HintPath>..\..\packages\System.Reactive.Interfaces.3.0.0\lib\net45\System.Reactive.Interfaces.dll</HintPath> |
|||
<Private>True</Private> |
|||
</Reference> |
|||
<Reference Include="System.Reactive.Linq, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> |
|||
<HintPath>..\..\packages\System.Reactive.Linq.3.0.0\lib\net45\System.Reactive.Linq.dll</HintPath> |
|||
<Private>True</Private> |
|||
</Reference> |
|||
<Reference Include="System.Reactive.PlatformServices, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> |
|||
<HintPath>..\..\packages\System.Reactive.PlatformServices.3.0.0\lib\net45\System.Reactive.PlatformServices.dll</HintPath> |
|||
<Private>True</Private> |
|||
</Reference> |
|||
<Reference Include="System.Reactive.Windows.Threading, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> |
|||
<HintPath>..\..\packages\System.Reactive.Windows.Threading.3.0.0\lib\net45\System.Reactive.Windows.Threading.dll</HintPath> |
|||
<Private>True</Private> |
|||
</Reference> |
|||
<Reference Include="System.Windows.Forms" /> |
|||
<Reference Include="System.Xml.Linq" /> |
|||
<Reference Include="System.Data.DataSetExtensions" /> |
|||
<Reference Include="System.Data" /> |
|||
<Reference Include="System.Xml" /> |
|||
<Reference Include="WindowsBase" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<Compile Include="App.cs" /> |
|||
<Compile Include="Program.cs" /> |
|||
<Compile Include="Properties\AssemblyInfo.cs" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<None Include="App.config" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\src\Avalonia.DotNetFrameworkRuntime\Avalonia.DotNetFrameworkRuntime.csproj"> |
|||
<Project>{4A1ABB09-9047-4BD5-A4AD-A055E52C5EE0}</Project> |
|||
<Name>Avalonia.DotNetFrameworkRuntime</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\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.DesignerSupport\Avalonia.DesignerSupport.csproj"> |
|||
<Project>{799a7bb5-3c2c-48b6-85a7-406a12c420da}</Project> |
|||
<Name>Avalonia.DesignerSupport</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.HtmlRenderer\Avalonia.HtmlRenderer.csproj"> |
|||
<Project>{5fb2b005-0a7f-4dad-add4-3ed01444e63d}</Project> |
|||
<Name>Avalonia.HtmlRenderer</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.Logging.Serilog\Avalonia.Logging.Serilog.csproj"> |
|||
<Project>{b61b66a3-b82d-4875-8001-89d3394fe0c9}</Project> |
|||
<Name>Avalonia.Logging.Serilog</Name> |
|||
</ProjectReference> |
|||
<ProjectReference Include="..\..\src\Avalonia.ReactiveUI\Avalonia.ReactiveUI.csproj"> |
|||
<Project>{6417B24E-49C2-4985-8DB2-3AB9D898EC91}</Project> |
|||
<Name>Avalonia.ReactiveUI</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\Windows\Avalonia.Direct2D1\Avalonia.Direct2D1.csproj" Condition="'$(Platform)'!='Mono'"> |
|||
<Project>{3E908F67-5543-4879-A1DC-08EACE79B3CD}</Project> |
|||
<Name>Avalonia.Direct2D1</Name> |
|||
</ProjectReference> |
|||
<ProjectReference Include="..\..\src\Windows\Avalonia.Win32\Avalonia.Win32.csproj" Condition="'$(Platform)'!='Mono'"> |
|||
<Project>{811A76CF-1CF6-440F-963B-BBE31BD72A82}</Project> |
|||
<Name>Avalonia.Win32</Name> |
|||
</ProjectReference> |
|||
<ProjectReference Include="..\XamlTestApplicationPcl\XamlTestApplicationPcl.csproj"> |
|||
<Project>{ea113f1a-d8d7-4142-9948-353270e7ebae}</Project> |
|||
<Name>XamlTestApplicationPcl</Name> |
|||
</ProjectReference> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<None Include="packages.config" /> |
|||
</ItemGroup> |
|||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
|||
<Import Project="..\..\src\Shared\avalonia.platform.targets" /> |
|||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
|||
Other similar extension points exist, see Microsoft.Common.targets. |
|||
<Target Name="BeforeBuild"> |
|||
</Target> |
|||
<Target Name="AfterBuild"> |
|||
</Target> |
|||
--> |
|||
</Project> |
|||
@ -1,26 +0,0 @@ |
|||
<ProjectConfiguration> |
|||
<AutoDetectNugetBuildDependencies>true</AutoDetectNugetBuildDependencies> |
|||
<BuildPriority>1000</BuildPriority> |
|||
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace> |
|||
<ConsiderInconclusiveTestsAsPassing>false</ConsiderInconclusiveTestsAsPassing> |
|||
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies> |
|||
<AllowDynamicCodeContractChecking>true</AllowDynamicCodeContractChecking> |
|||
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking> |
|||
<AllowCodeAnalysis>false</AllowCodeAnalysis> |
|||
<IgnoreThisComponentCompletely>true</IgnoreThisComponentCompletely> |
|||
<RunPreBuildEvents>false</RunPreBuildEvents> |
|||
<RunPostBuildEvents>false</RunPostBuildEvents> |
|||
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully> |
|||
<InstrumentAssembly>true</InstrumentAssembly> |
|||
<PreventSigningOfAssembly>false</PreventSigningOfAssembly> |
|||
<AnalyseExecutionTimes>true</AnalyseExecutionTimes> |
|||
<DetectStackOverflow>true</DetectStackOverflow> |
|||
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace> |
|||
<DefaultTestTimeout>60000</DefaultTestTimeout> |
|||
<UseBuildConfiguration></UseBuildConfiguration> |
|||
<UseBuildPlatform></UseBuildPlatform> |
|||
<ProxyProcessPath></ProxyProcessPath> |
|||
<UseCPUArchitecture>AutoDetect</UseCPUArchitecture> |
|||
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState> |
|||
<BuildProcessArchitecture>x86</BuildProcessArchitecture> |
|||
</ProjectConfiguration> |
|||
@ -1,12 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="Serilog" version="1.5.14" targetFramework="net45" /> |
|||
<package id="Splat" version="1.6.2" targetFramework="net45" /> |
|||
<package id="Sprache" version="2.0.0.51" targetFramework="net45" /> |
|||
<package id="System.Reactive" version="3.0.0" targetFramework="net45" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="net45" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="net45" /> |
|||
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="net45" /> |
|||
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="net45" /> |
|||
<package id="System.Reactive.Windows.Threading" version="3.0.0" targetFramework="net45" /> |
|||
</packages> |
|||
@ -1,30 +0,0 @@ |
|||
using System.Resources; |
|||
using System.Reflection; |
|||
using System.Runtime.CompilerServices; |
|||
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("XamlTestApplicationPcl")] |
|||
[assembly: AssemblyDescription("")] |
|||
[assembly: AssemblyConfiguration("")] |
|||
[assembly: AssemblyCompany("")] |
|||
[assembly: AssemblyProduct("XamlTestApplicationPcl")] |
|||
[assembly: AssemblyCopyright("Copyright © 2015")] |
|||
[assembly: AssemblyTrademark("")] |
|||
[assembly: AssemblyCulture("")] |
|||
[assembly: NeutralResourcesLanguage("en")] |
|||
|
|||
// 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,113 +0,0 @@ |
|||
using System; |
|||
using Avalonia; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Controls.Primitives; |
|||
using Avalonia.Input; |
|||
using Avalonia.Media; |
|||
using Avalonia.VisualTree; |
|||
|
|||
namespace XamlTestApplication |
|||
{ |
|||
public class TestScrollable : Control, ILogicalScrollable |
|||
{ |
|||
private int itemCount = 100; |
|||
private Size _extent; |
|||
private Vector _offset; |
|||
private Size _viewport; |
|||
private Size _lineSize; |
|||
|
|||
public bool IsLogicalScrollEnabled => true; |
|||
public Action InvalidateScroll { get; set; } |
|||
|
|||
Size IScrollable.Extent |
|||
{ |
|||
get { return _extent; } |
|||
} |
|||
|
|||
Vector IScrollable.Offset |
|||
{ |
|||
get { return _offset; } |
|||
|
|||
set |
|||
{ |
|||
_offset = value; |
|||
InvalidateVisual(); |
|||
} |
|||
} |
|||
|
|||
Size IScrollable.Viewport |
|||
{ |
|||
get { return _viewport; } |
|||
} |
|||
|
|||
public Size ScrollSize |
|||
{ |
|||
get |
|||
{ |
|||
return new Size(double.PositiveInfinity, 1); |
|||
} |
|||
} |
|||
|
|||
public Size PageScrollSize |
|||
{ |
|||
get |
|||
{ |
|||
return new Size(double.PositiveInfinity, Bounds.Height); |
|||
} |
|||
} |
|||
|
|||
public override void Render(DrawingContext context) |
|||
{ |
|||
var y = 0.0; |
|||
|
|||
for (var i = (int)_offset.Y; i < itemCount; ++i) |
|||
{ |
|||
using (var line = new FormattedText( |
|||
"Item " + (i + 1), |
|||
TextBlock.GetFontFamily(this), |
|||
TextBlock.GetFontSize(this), |
|||
TextBlock.GetFontStyle(this), |
|||
TextAlignment.Left, |
|||
TextBlock.GetFontWeight(this))) |
|||
{ |
|||
context.DrawText(Brushes.Black, new Point(-_offset.X, y), line); |
|||
y += _lineSize.Height; |
|||
} |
|||
} |
|||
} |
|||
|
|||
public bool BringIntoView(IControl target, Rect targetRect) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
public IControl GetControlInDirection(NavigationDirection direction, IControl from) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
protected override Size MeasureOverride(Size availableSize) |
|||
{ |
|||
using (var line = new FormattedText( |
|||
"Item 100", |
|||
TextBlock.GetFontFamily(this), |
|||
TextBlock.GetFontSize(this), |
|||
TextBlock.GetFontStyle(this), |
|||
TextAlignment.Left, |
|||
TextBlock.GetFontWeight(this))) |
|||
{ |
|||
line.Constraint = availableSize; |
|||
_lineSize = line.Measure(); |
|||
return new Size(_lineSize.Width, _lineSize.Height * itemCount); |
|||
} |
|||
} |
|||
|
|||
protected override Size ArrangeOverride(Size finalSize) |
|||
{ |
|||
_viewport = new Size(finalSize.Width, finalSize.Height / _lineSize.Height); |
|||
_extent = new Size(_lineSize.Width, itemCount + 1); |
|||
InvalidateScroll?.Invoke(); |
|||
return finalSize; |
|||
} |
|||
} |
|||
} |
|||
@ -1,103 +0,0 @@ |
|||
using Avalonia.Threading; |
|||
|
|||
namespace XamlTestApplication.ViewModels |
|||
{ |
|||
using ReactiveUI; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Collections.ObjectModel; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
public class ShellViewModel : ReactiveObject |
|||
{ |
|||
private ShellViewModel() |
|||
{ |
|||
documents = new ObservableCollection<EditorViewModel>(); |
|||
|
|||
AddDocumentCommand = ReactiveCommand.Create(); |
|||
AddDocumentCommand.Subscribe(_ => |
|||
{ |
|||
Documents.Add(new EditorViewModel()); |
|||
}); |
|||
|
|||
GCCommand = ReactiveCommand.Create(); |
|||
GCCommand.Subscribe(_ => |
|||
{ |
|||
GC.Collect(); |
|||
}); |
|||
} |
|||
|
|||
public static ShellViewModel Instance = new ShellViewModel(); |
|||
|
|||
private ObservableCollection<EditorViewModel> documents; |
|||
public ObservableCollection<EditorViewModel> Documents |
|||
{ |
|||
get { return documents; } |
|||
set { this.RaiseAndSetIfChanged(ref documents, value); } |
|||
} |
|||
|
|||
private EditorViewModel selectedDocument; |
|||
|
|||
public EditorViewModel SelectedDocument |
|||
{ |
|||
get { return selectedDocument; } |
|||
set { this.RaiseAndSetIfChanged(ref selectedDocument, value); } |
|||
} |
|||
|
|||
private int instanceCount; |
|||
|
|||
public int InstanceCount |
|||
{ |
|||
get { return instanceCount; } |
|||
set { this.RaiseAndSetIfChanged(ref instanceCount, value); } |
|||
} |
|||
|
|||
|
|||
|
|||
public ReactiveCommand<object> AddDocumentCommand { get; } |
|||
public ReactiveCommand<object> GCCommand { get; } |
|||
} |
|||
|
|||
public class EditorViewModel : ReactiveObject |
|||
{ |
|||
private static int InstanceCount = 0; |
|||
|
|||
public EditorViewModel() |
|||
{ |
|||
InstanceCount++; |
|||
ShellViewModel.Instance.InstanceCount = InstanceCount; |
|||
text = "This is some text."; |
|||
|
|||
CloseCommand = ReactiveCommand.Create(); |
|||
|
|||
CloseCommand.Subscribe(_ => |
|||
{ |
|||
ShellViewModel.Instance.Documents.Remove(this); |
|||
}); |
|||
} |
|||
|
|||
~EditorViewModel() |
|||
{ |
|||
|
|||
|
|||
//System.Console.WriteLine("EVM Destructed");
|
|||
InstanceCount--; |
|||
Dispatcher.UIThread.InvokeAsync(() => |
|||
{ |
|||
ShellViewModel.Instance.InstanceCount = InstanceCount; |
|||
}); |
|||
|
|||
} |
|||
|
|||
private string text; |
|||
public string Text |
|||
{ |
|||
get { return text; } |
|||
set { this.RaiseAndSetIfChanged(ref text, value); } |
|||
} |
|||
|
|||
public ReactiveCommand<object> CloseCommand { get; } |
|||
} |
|||
} |
|||
@ -1,127 +0,0 @@ |
|||
// Copyright (c) The Avalonia Project. All rights reserved.
|
|||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|||
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using ReactiveUI; |
|||
using Avalonia.Controls; |
|||
|
|||
namespace XamlTestApplication.ViewModels |
|||
{ |
|||
public class MainWindowViewModel |
|||
{ |
|||
public MainWindowViewModel() |
|||
{ |
|||
Items = new List<TestItem>(); |
|||
|
|||
for (int i = 0; i < 10; ++i) |
|||
{ |
|||
Items.Add(new TestItem($"Item {i}", $"Item {i} Value")); |
|||
} |
|||
|
|||
Nodes = new List<TestNode> |
|||
{ |
|||
new TestNode |
|||
{ |
|||
Header = "Root", |
|||
SubHeader = "Root Item", |
|||
IsExpanded = true, |
|||
Children = new[] |
|||
{ |
|||
new TestNode |
|||
{ |
|||
Header = "Child 1", |
|||
SubHeader = "Child 1 Value", |
|||
}, |
|||
new TestNode |
|||
{ |
|||
Header = "Child 2", |
|||
SubHeader = "Child 2 Value", |
|||
IsExpanded = false, |
|||
Children = new[] |
|||
{ |
|||
new TestNode |
|||
{ |
|||
Header = "Grandchild", |
|||
SubHeader = "Grandchild Value", |
|||
}, |
|||
new TestNode |
|||
{ |
|||
Header = "Grandmaster Flash", |
|||
SubHeader = "White Lines", |
|||
}, |
|||
} |
|||
}, |
|||
} |
|||
} |
|||
}; |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
CollapseNodesCommand = ReactiveCommand.Create(); |
|||
CollapseNodesCommand.Subscribe(_ => ExpandNodes(false)); |
|||
ExpandNodesCommand = ReactiveCommand.Create(); |
|||
ExpandNodesCommand.Subscribe(_ => ExpandNodes(true)); |
|||
|
|||
OpenFileCommand = ReactiveCommand.Create(); |
|||
OpenFileCommand.Subscribe(_ => |
|||
{ |
|||
var ofd = new OpenFileDialog(); |
|||
|
|||
ofd.ShowAsync(); |
|||
}); |
|||
|
|||
OpenFolderCommand = ReactiveCommand.Create(); |
|||
OpenFolderCommand.Subscribe(_ => |
|||
{ |
|||
var ofd = new OpenFolderDialog(); |
|||
|
|||
ofd.ShowAsync(); |
|||
}); |
|||
|
|||
shell = ShellViewModel.Instance; |
|||
} |
|||
|
|||
private ShellViewModel shell; |
|||
|
|||
public ShellViewModel Shell |
|||
{ |
|||
get { return shell; } |
|||
set { shell = value; } |
|||
} |
|||
|
|||
public List<TestItem> Items { get; } |
|||
public List<TestNode> Nodes { get; } |
|||
|
|||
public ReactiveCommand<object> CollapseNodesCommand { get; } |
|||
|
|||
public ReactiveCommand<object> ExpandNodesCommand { get; } |
|||
|
|||
public ReactiveCommand<object> OpenFileCommand { get; } |
|||
|
|||
public ReactiveCommand<object> OpenFolderCommand { get; } |
|||
|
|||
public void ExpandNodes(bool expanded) |
|||
{ |
|||
foreach (var node in Nodes) |
|||
{ |
|||
ExpandNodes(node, expanded); |
|||
} |
|||
} |
|||
|
|||
private void ExpandNodes(TestNode node, bool expanded) |
|||
{ |
|||
node.IsExpanded = expanded; |
|||
|
|||
if (node.Children != null) |
|||
{ |
|||
foreach (var child in node.Children) |
|||
{ |
|||
ExpandNodes(child, expanded); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -1,17 +0,0 @@ |
|||
// Copyright (c) The Avalonia Project. All rights reserved.
|
|||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|||
|
|||
namespace XamlTestApplication.ViewModels |
|||
{ |
|||
public class TestItem |
|||
{ |
|||
public TestItem(string header, string subheader) |
|||
{ |
|||
Header = header; |
|||
SubHeader = subheader; |
|||
} |
|||
|
|||
public string Header { get; } |
|||
public string SubHeader { get; } |
|||
} |
|||
} |
|||
@ -1,23 +0,0 @@ |
|||
// Copyright (c) The Avalonia Project. All rights reserved.
|
|||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|||
|
|||
using System.Collections.Generic; |
|||
using ReactiveUI; |
|||
|
|||
namespace XamlTestApplication.ViewModels |
|||
{ |
|||
public class TestNode : ReactiveObject |
|||
{ |
|||
private bool _isExpanded; |
|||
|
|||
public string Header { get; set; } |
|||
public string SubHeader { get; set; } |
|||
public IEnumerable<TestNode> Children { get; set; } |
|||
|
|||
public bool IsExpanded |
|||
{ |
|||
get { return _isExpanded; } |
|||
set { this.RaiseAndSetIfChanged(ref this._isExpanded, value); } |
|||
} |
|||
} |
|||
} |
|||
@ -1,32 +0,0 @@ |
|||
// Copyright (c) The Avalonia Project. All rights reserved.
|
|||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|||
|
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using Avalonia; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Diagnostics; |
|||
using Avalonia.Markup.Xaml; |
|||
using XamlTestApplication.ViewModels; |
|||
|
|||
namespace XamlTestApplication.Views |
|||
{ |
|||
public class MainWindow : Window |
|||
{ |
|||
private MenuItem _exitMenu; |
|||
|
|||
public MainWindow() |
|||
{ |
|||
InitializeComponent(); |
|||
DataContext = new MainWindowViewModel(); |
|||
DevTools.Attach(this); |
|||
} |
|||
|
|||
private void InitializeComponent() |
|||
{ |
|||
AvaloniaXamlLoader.Load(this); |
|||
_exitMenu = this.FindControl<MenuItem>("exitMenu"); |
|||
_exitMenu.Click += (s, e) => Application.Current.Exit(); |
|||
} |
|||
} |
|||
} |
|||
@ -1,400 +0,0 @@ |
|||
<Window x:Class="XamlTestApplication.MainWindow" |
|||
xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:local="clr-namespace:XamlTestApplication;assembly=XamlTestApplicationPcl" |
|||
xmlns:vm="clr-namespace:XamlTestApplication.ViewModels;assembly=XamlTestApplicationPcl" |
|||
Title="Avalonia Test Application" Width="800" Height="600"> |
|||
<Grid RowDefinitions="Auto,*,Auto" ColumnDefinitions="*,*"> |
|||
<Menu Grid.ColumnSpan="2"> |
|||
<MenuItem Header="_File"> |
|||
<MenuItem Header="_Open" Command="{Binding OpenFileCommand}" /> |
|||
<MenuItem Header="_Open Folder" Command="{Binding OpenFolderCommand}" /> |
|||
<MenuItem Header="_Hello"> |
|||
<MenuItem Header="_Goodbye"/> |
|||
<Separator/> |
|||
<MenuItem Header="_World" /> |
|||
</MenuItem> |
|||
<Separator Background="Red"/> |
|||
<MenuItem Header="_Test"/> |
|||
<Separator/> |
|||
<MenuItem Name="exitMenu" Header="_Exit"/> |
|||
</MenuItem> |
|||
</Menu> |
|||
<TabControl Grid.Row="1" Grid.ColumnSpan="2" Padding="5"> |
|||
<TabControl.Transition> |
|||
<PageSlide Duration="0.25" /> |
|||
</TabControl.Transition> |
|||
|
|||
<TabItem Header="Buttons"> |
|||
<ScrollViewer CanScrollHorizontally="False"> |
|||
<StackPanel Margin="10" Gap="4"> |
|||
<TextBlock Text="Button" FontWeight="Medium" FontSize="20" Foreground="#212121" /> |
|||
<TextBlock Text="A button control" FontSize="13" Foreground="#727272" Margin="0,0,0,10" /> |
|||
<Button Content="Button" Width="150" /> |
|||
<Button Content="Button" Width="150" IsEnabled="False" /> |
|||
<TextBlock Text="ToggleButton" Margin="0, 40, 0, 0" FontSize="20" Foreground="#212121" /> |
|||
<TextBlock Text="A toggle button control" FontSize="13" Foreground="#727272" Margin="0,0,0,10" /> |
|||
<ToggleButton Width="150" IsChecked="True" Content="On" /> |
|||
<ToggleButton Width="150" IsChecked="False" Content="Off" /> |
|||
</StackPanel> |
|||
</ScrollViewer> |
|||
</TabItem> |
|||
<TabItem Header="Text"> |
|||
<StackPanel Margin="10" Gap="4"> |
|||
<TextBlock Text="TextBlock with ContextMenu" FontWeight="Medium" FontSize="20" Foreground="#212121"> |
|||
<TextBlock.ContextMenu> |
|||
<ContextMenu> |
|||
<MenuItem Header="Testing 1" /> |
|||
<MenuItem Header="Testing 2" /> |
|||
<MenuItem Header="Testing 3" /> |
|||
<MenuItem Header="Testing 4"> |
|||
<MenuItem Header="SubItem 1" /> |
|||
<MenuItem Header="SubItem 2" /> |
|||
<MenuItem Header="SubItem 3" /> |
|||
<MenuItem Header="SubItem 4" /> |
|||
</MenuItem> |
|||
</ContextMenu> |
|||
</TextBlock.ContextMenu> |
|||
</TextBlock> |
|||
<TextBlock Text="A control for displaying text." |
|||
FontSize="13" |
|||
Foreground="#727272" |
|||
Margin="0, 0, 0, 10" /> |
|||
<TextBlock Text="Lorem ipsum dolor sit amet, consectetuer adipiscing elit." FontSize="11" /> |
|||
<TextBlock Text="Lorem ipsum dolor sit amet, consectetuer adipiscing elit." FontSize="11" |
|||
FontWeight="Medium" /> |
|||
<TextBlock Text="Lorem ipsum dolor sit amet, consectetuer adipiscing elit." FontSize="11" |
|||
FontWeight="Bold" /> |
|||
<TextBlock Text="Lorem ipsum dolor sit amet, consectetuer adipiscing elit." FontSize="11" |
|||
FontStyle="Italic" /> |
|||
<TextBlock Margin="0,40,0,0" Text="HtmlLabel" FontWeight="Medium" FontSize="20" |
|||
Foreground="#212121" /> |
|||
<TextBlock Text="A label capable of displaying HTML content" FontSize="13" Foreground="#727272" |
|||
Margin="0, 0, 0, 10" /> |
|||
</StackPanel> |
|||
</TabItem> |
|||
<TabItem Header="Input"> |
|||
<ScrollViewer CanScrollHorizontally="False"> |
|||
<StackPanel Margin="10" Gap="4"> |
|||
<TextBlock Text="TextBlock" FontWeight="Medium" FontSize="20" Foreground="#212121" /> |
|||
<TextBlock Text="A text box control" |
|||
FontSize="13" |
|||
Foreground="#727272" |
|||
Margin="0, 0, 0, 10" /> |
|||
<TextBox Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit." Width="200" /> |
|||
<TextBox Width="200" Watermark="Watermark" /> |
|||
<TextBox Width="200" Watermark="Floating Watermark" UseFloatingWatermark="True" /> |
|||
<TextBox AcceptsReturn="True" TextWrapping="Wrap" Width="200" Height="150" |
|||
Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est." /> |
|||
<TextBox Width="200" Text="Left aligned text" TextAlignment="Left" /> |
|||
<TextBox Width="200" Text="Center aligned text" TextAlignment="Center" /> |
|||
<TextBox Width="200" Text="Right aligned text" TextAlignment="Right" /> |
|||
<TextBlock Margin="0, 40, 0, 0" Text="CheckBox" FontWeight="Medium" FontSize="20" |
|||
Foreground="#212121" /> |
|||
<TextBlock Text="A check box control" FontSize="13" Foreground="#727272" Margin="0, 0, 0, 10" /> |
|||
|
|||
<CheckBox IsChecked="True" Margin="0, 0, 0, 5" Content="Checked" /> |
|||
<CheckBox IsChecked="False" Content="Unchecked" /> |
|||
<TextBlock Margin="0, 40, 0, 0" Text="RadioButton" FontWeight="Medium" FontSize="20" |
|||
Foreground="#212121" /> |
|||
<TextBlock Text="A radio button control" FontSize="13" Foreground="#727272" |
|||
Margin="0, 0, 0, 10" /> |
|||
<RadioButton IsChecked="True" Content="Option 1" /> |
|||
<RadioButton IsChecked="False" Content="Option 2" /> |
|||
<RadioButton IsChecked="False" Content="Option 3" /> |
|||
</StackPanel> |
|||
</ScrollViewer> |
|||
</TabItem> |
|||
<TabItem Header="Images"> |
|||
|
|||
<StackPanel Margin="10" Gap="4" HorizontalAlignment="Center"> |
|||
|
|||
<TextBlock Text="Carousel" FontWeight="Medium" FontSize="20" Foreground="#212121" /> |
|||
<TextBlock Text="An items control that displays its items as pages that fill the controls." |
|||
FontSize="13" |
|||
Foreground="#727272" Margin="0, 0, 0, 10" /> |
|||
<StackPanel Name="carouselVisual" Orientation="Horizontal"> |
|||
|
|||
<Button VerticalAlignment="Center" Margin="5"> |
|||
<Button.Content> |
|||
<Path Fill="Black" |
|||
Data="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" /> |
|||
</Button.Content> |
|||
</Button> |
|||
|
|||
<Carousel Width="400" Height="400"> |
|||
<Carousel.Transition> |
|||
<PageSlide Duration="0.25" /> |
|||
</Carousel.Transition> |
|||
<Image Source="github_icon.png" Width="400" Height="400" /> |
|||
<Image Source="pattern.jpg" Width="400" Height="400" /> |
|||
</Carousel> |
|||
|
|||
<Button VerticalAlignment="Center" Margin="5"> |
|||
<Button.Content> |
|||
<Path Fill="Black" |
|||
Data="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z" /> |
|||
</Button.Content> |
|||
</Button> |
|||
|
|||
</StackPanel> |
|||
</StackPanel> |
|||
|
|||
</TabItem> |
|||
<TabItem Header="Lists"> |
|||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center"> |
|||
<ListBox Items="{Binding Items}" SelectionMode="Multiple"> |
|||
<ListBox.ItemTemplate> |
|||
<DataTemplate DataType="vm:TestItem"> |
|||
<StackPanel> |
|||
<TextBlock Text="{Binding Header}" FontSize="24" /> |
|||
<TextBlock Text="{Binding SubHeader}" /> |
|||
</StackPanel> |
|||
</DataTemplate> |
|||
</ListBox.ItemTemplate> |
|||
</ListBox> |
|||
<DropDown VerticalAlignment="Center" SelectedIndex="0"> |
|||
<StackPanel> |
|||
<TextBlock Text="Item 1" FontSize="24" /> |
|||
<TextBlock Text="Item 1 Value" /> |
|||
</StackPanel> |
|||
<StackPanel> |
|||
<TextBlock Text="Item 2" FontSize="24" /> |
|||
<TextBlock Text="Item 2 Value" /> |
|||
</StackPanel> |
|||
</DropDown> |
|||
<TreeView Items="{Binding Nodes}"> |
|||
<TreeView.Styles> |
|||
<Style Selector="TreeViewItem"> |
|||
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/> |
|||
</Style> |
|||
</TreeView.Styles> |
|||
<TreeView.ItemTemplate> |
|||
<TreeDataTemplate DataType="vm:TestNode" ItemsSource="{Binding Children}"> |
|||
<StackPanel> |
|||
<TextBlock Text="{Binding Header}" FontSize="24" /> |
|||
<TextBlock Text="{Binding SubHeader}" /> |
|||
</StackPanel> |
|||
</TreeDataTemplate> |
|||
</TreeView.ItemTemplate> |
|||
</TreeView> |
|||
<StackPanel Orientation="Vertical" Gap="4"> |
|||
<Button Command="{Binding CollapseNodesCommand}">Collapse Nodes</Button> |
|||
<Button Command="{Binding ExpandNodesCommand}">Expand Nodes</Button> |
|||
</StackPanel> |
|||
</StackPanel> |
|||
</TabItem> |
|||
<TabItem Header="Layout"> |
|||
<ScrollViewer CanScrollHorizontally="False"> |
|||
<StackPanel Margin="10" Gap="4"> |
|||
<TextBlock Text="Grid" FontWeight="Medium" FontSize="20" Foreground="#212121" /> |
|||
<TextBlock Text="Lays out child controls according to a grid." |
|||
FontSize="13" |
|||
Foreground="#727272" |
|||
Margin="0, 0, 0, 10" /> |
|||
<Grid ColumnDefinitions="*,*" RowDefinitions="Auto,Auto" Width="300"> |
|||
<Rectangle Grid.ColumnSpan="2" Fill="#FF5722" Height="200" Margin="2.5" /> |
|||
<Rectangle Grid.Row="1" Fill="#FF5722" Height="100" Margin="2.5" /> |
|||
<Rectangle Grid.Row="1" Grid.Column="1" Fill="#FF5722" Height="100" Margin="2.5" /> |
|||
</Grid> |
|||
|
|||
<TextBlock Text="StackPanel" FontWeight="Medium" FontSize="20" Foreground="#212121" /> |
|||
<TextBlock Text="A panel which lays out its children horizontally or vertically." |
|||
FontSize="13" |
|||
Foreground="#727272" |
|||
Margin="0, 0, 0, 10" /> |
|||
<StackPanel Gap="4" Width="300"> |
|||
<Rectangle Fill="#FFC107" Height="50" /> |
|||
<Rectangle Fill="#FFC107" Height="50" /> |
|||
<Rectangle Fill="#FFC107" Height="50" /> |
|||
</StackPanel> |
|||
|
|||
<TextBlock Text="WrapPanel" FontWeight="Medium" FontSize="20" Foreground="#212121" /> |
|||
<TextBlock Text="Wraps children to new lines if no space is left:" |
|||
FontSize="13" |
|||
Foreground="#727272" |
|||
Margin="0, 0, 0, 10" /> |
|||
<WrapPanel> |
|||
<Rectangle Fill="#FFC107" Height="50" Width="100" Margin="2.5" /> |
|||
<Rectangle Fill="#FFC107" Height="100" Width="100" Margin="2.5" /> |
|||
<Rectangle Fill="#FFC107" Height="50" Width="100" Margin="2.5" /> |
|||
<Rectangle Fill="#FFC107" Height="50" Width="200" Margin="2.5" /> |
|||
<Rectangle Fill="#FFC107" Height="100" Width="50" Margin="2.5" /> |
|||
<Rectangle Fill="#FFC107" Height="50" Width="100" Margin="2.5" /> |
|||
<Rectangle Fill="#FFC107" Height="50" Width="100" Margin="2.5" /> |
|||
</WrapPanel> |
|||
|
|||
<TextBlock Text="Canvas" FontWeight="Medium" FontSize="20" Foreground="#212121" /> |
|||
<TextBlock Text="A panel which lays out its children by explicit coordinates." |
|||
FontSize="13" |
|||
Foreground="#727272" |
|||
Margin="0, 0, 0, 10" /> |
|||
<Canvas Width="300" Height="200" Background="Yellow"> |
|||
<Rectangle Fill="Blue" Width="63" Height="41" Canvas.Left="40" Canvas.Top="31" /> |
|||
<Rectangle Fill="Green" Width="58" Height="58" Canvas.Left="130" Canvas.Top="79" /> |
|||
</Canvas> |
|||
|
|||
<TextBlock Text="DockPanel" FontWeight="Medium" FontSize="20" Foreground="#212121" /> |
|||
<TextBlock |
|||
Text="A panel which lays docks its children on the sides and optionally fills the remaining space with the last child" |
|||
FontSize="13" |
|||
Foreground="#727272" |
|||
Margin="0, 0, 0, 10" /> |
|||
<DockPanel Width="300" Height="300"> |
|||
<Rectangle Fill="Red" Width="25" DockPanel.Dock="Left" /> |
|||
<Rectangle Fill="Green" Height="25" DockPanel.Dock="Top" /> |
|||
<Rectangle Fill="Blue" Width="25" DockPanel.Dock="Right" /> |
|||
<Rectangle Fill="Yellow" Height="25" DockPanel.Dock="Bottom" /> |
|||
<Rectangle Fill="Pink" /> |
|||
</DockPanel> |
|||
|
|||
<TextBlock Text="GridSplitter" FontWeight="Medium" FontSize="20" Foreground="#212121" /> |
|||
<Grid Height="500" Width="500" ColumnDefinitions="*,Auto,*,Auto,*" RowDefinitions="*,Auto,*"> |
|||
<Border Grid.Column="0" Grid.Row="0" Background="Red" /> |
|||
<GridSplitter Grid.Column="0" Grid.Row="1" Orientation="Horizontal" /> |
|||
<Border Grid.Column="0" Grid.Row="2" Background="Yellow" /> |
|||
<GridSplitter Grid.Column="1" Grid.RowSpan="3" Orientation="Vertical" /> |
|||
<Border Grid.Column="2" Grid.RowSpan="3" Background="Green" /> |
|||
<GridSplitter Grid.Column="3" Grid.RowSpan="3" Orientation="Vertical"/> |
|||
<Border Grid.Column="4" Grid.Row="0" Background="Blue" /> |
|||
<GridSplitter Grid.Column="4" Grid.Row="1" Orientation="Horizontal" /> |
|||
<Border Grid.Column="4" Grid.Row="3" Background="Pink" /> |
|||
</Grid> |
|||
</StackPanel> |
|||
</ScrollViewer> |
|||
</TabItem> |
|||
<TabItem Header="Animations"> |
|||
<Grid> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition /> |
|||
<ColumnDefinition /> |
|||
</Grid.ColumnDefinitions> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<Border Width="100" Height="100"> |
|||
<Border.Background> |
|||
<LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%"> |
|||
<GradientStop Color="Red" Offset="0" /> |
|||
<GradientStop Color="Green" Offset="1" /> |
|||
</LinearGradientBrush> |
|||
</Border.Background> |
|||
<TextBox HorizontalAlignment="Center" VerticalAlignment="Center" Text="hello!"></TextBox> |
|||
</Border> |
|||
<Border Grid.Row="0" Grid.Column="1" Background="Coral" HorizontalAlignment="Center" |
|||
VerticalAlignment="Center"> |
|||
<Image Width="100" Height="100" Source="github_icon.png"> |
|||
</Image> |
|||
</Border> |
|||
<Button Grid.Row="1" Grid.Column="1" Content="Animate" HorizontalAlignment="Center"></Button> |
|||
</Grid> |
|||
</TabItem> |
|||
<TabItem Header="Brushes"> |
|||
<Grid ColumnDefinitions="Auto" RowDefinitions="Auto"> |
|||
<Border Grid.Row="0" Grid.Column="0" Width="200" Height="200" Margin="10"> |
|||
<Border.Background> |
|||
<VisualBrush TileMode="Tile" Stretch="None" AlignmentX="Left" AlignmentY="Top" SourceRect="0%,0%,100%,100%" DestinationRect="0,0,20,20"> |
|||
<VisualBrush.Visual> |
|||
<StackPanel Orientation="Horizontal"> |
|||
<StackPanel Orientation="Vertical"> |
|||
<Rectangle Width="10" Height="10" Fill="DarkGray"/> |
|||
<Rectangle Width="10" Height="10" Fill="LightGray"/> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Vertical"> |
|||
<Rectangle Width="10" Height="10" Fill="LightGray"/> |
|||
<Rectangle Width="10" Height="10" Fill="DarkGray"/> |
|||
</StackPanel> |
|||
</StackPanel> |
|||
</VisualBrush.Visual> |
|||
</VisualBrush> |
|||
</Border.Background> |
|||
</Border> |
|||
</Grid> |
|||
</TabItem> |
|||
<TabItem Header="IScrollable"> |
|||
<ScrollViewer> |
|||
<local:TestScrollable/> |
|||
</ScrollViewer> |
|||
</TabItem> |
|||
<TabItem Header="Mem Leak Repro"> |
|||
<Grid DataContext="{Binding Shell}"> |
|||
<StackPanel> |
|||
|
|||
<TabStrip Name="strip" Items="{Binding Documents}" SelectedItem="{Binding SelectedDocument, Mode=TwoWay}" Focusable="false"> |
|||
<TabStrip.Styles> |
|||
|
|||
<Style Selector="TabStripItem"> |
|||
<Setter Property="Height" Value="20" /> |
|||
<Setter Property="Background" Value="#2D2D30" /> |
|||
<Setter Property="BorderBrush" Value="#3E3E42" /> |
|||
<Setter Property="BorderThickness" Value="0" /> |
|||
<Setter Property="Margin" Value="0 0 0 -1" /> |
|||
<Setter Property="Padding" Value="4 0 4 0" /> |
|||
<Setter Property="FontSize" Value="12"/> |
|||
</Style> |
|||
<Style Selector="TabStripItem:pointerover"> |
|||
<Setter Property="Background" Value="#1c97ea" /> |
|||
</Style> |
|||
<Style Selector="TabStripItem:selected"> |
|||
<Setter Property="Background" Value="#007ACC" /> |
|||
</Style> |
|||
</TabStrip.Styles> |
|||
|
|||
<TabStrip.DataTemplates> |
|||
<DataTemplate> |
|||
<StackPanel Orientation="Horizontal" Gap="2"> |
|||
<TextBlock Text="{Binding Title}" Foreground="WhiteSmoke" Margin="2"/> |
|||
<Button Height="14" Width="14"> |
|||
<Button.Styles> |
|||
<Style Selector="Button"> |
|||
<Setter Property="BorderThickness" Value="0"/> |
|||
<Setter Property="Padding" Value="0"/> |
|||
<Setter Property="Margin" Value="0"/> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
</Style> |
|||
|
|||
<Style Selector="Button:pointerover"> |
|||
<Setter Property="Background" Value="#1c97ea" /> |
|||
</Style> |
|||
</Button.Styles> |
|||
<Path Margin="2" Stretch="Uniform" UseLayoutRounding="False" Data="M16,12V4H17V2H7V4H8V12L6,14V16H11.2V22H12.8V16H18V14L16,12Z" Fill="WhiteSmoke" /> |
|||
|
|||
</Button> |
|||
|
|||
<Button Height="14" Width="14" Command="{Binding CloseCommand}"> |
|||
<Button.Styles> |
|||
<Style Selector="Button"> |
|||
<Setter Property="BorderThickness" Value="0"/> |
|||
<Setter Property="Padding" Value="0"/> |
|||
<Setter Property="Margin" Value="0"/> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
</Style> |
|||
<Style Selector="Button:pointerover"> |
|||
<Setter Property="Background" Value="#1c97ea" /> |
|||
</Style> |
|||
</Button.Styles> |
|||
<Path Margin="2" Stretch="Uniform" UseLayoutRounding="False" Data="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" Fill="WhiteSmoke" /> |
|||
</Button> |
|||
</StackPanel> |
|||
</DataTemplate> |
|||
</TabStrip.DataTemplates> |
|||
</TabStrip> |
|||
<Grid Background="#007ACC" Height="2" /> |
|||
<Button Content="AddTab" Command="{Binding AddDocumentCommand}" Width="50" Height="30" /> |
|||
<Button Content="GC.Collecy" Command="{Binding GCCommand}" Width="50" Height="30" /> |
|||
<TextBox Text="{Binding InstanceCount}" /> |
|||
|
|||
<Carousel Items="{Binding Documents}" SelectedIndex="{Binding #strip.SelectedIndex}" IsVirtualized="false"> |
|||
<Carousel.DataTemplates> |
|||
<DataTemplate> |
|||
<TextBox Text="{Binding Text}" /> |
|||
</DataTemplate> |
|||
</Carousel.DataTemplates> |
|||
</Carousel> |
|||
</StackPanel> |
|||
</Grid> |
|||
</TabItem> |
|||
</TabControl> |
|||
</Grid> |
|||
</Window> |
|||
@ -1,14 +0,0 @@ |
|||
using Avalonia; |
|||
using Avalonia.Markup.Xaml; |
|||
using XamlTestApplication.Views; |
|||
|
|||
namespace XamlTestApplication |
|||
{ |
|||
public class XamlTestApp : Application |
|||
{ |
|||
public override void Initialize() |
|||
{ |
|||
AvaloniaXamlLoader.Load(this); |
|||
} |
|||
} |
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
<Application x:Class="XamlTestApplicationPcl.XamlTestApp" |
|||
xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Application.Styles> |
|||
<StyleInclude Source="resm:Avalonia.Themes.Default.DefaultTheme.xaml?assembly=Avalonia.Themes.Default"/> |
|||
<StyleInclude Source="resm:Avalonia.Themes.Default.Accents.BaseLight.xaml?assembly=Avalonia.Themes.Default"/> |
|||
</Application.Styles> |
|||
</Application> |
|||
@ -1,150 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> |
|||
<PropertyGroup> |
|||
<MinimumVisualStudioVersion>10.0</MinimumVisualStudioVersion> |
|||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|||
<ProjectGuid>{EA113F1A-D8D7-4142-9948-353270E7EBAE}</ProjectGuid> |
|||
<OutputType>Library</OutputType> |
|||
<AppDesignerFolder>Properties</AppDesignerFolder> |
|||
<RootNamespace>XamlTestApplication</RootNamespace> |
|||
<AssemblyName>XamlTestApplicationPcl</AssemblyName> |
|||
<DefaultLanguage>en-US</DefaultLanguage> |
|||
<FileAlignment>512</FileAlignment> |
|||
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> |
|||
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile> |
|||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> |
|||
</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> |
|||
</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> |
|||
</PropertyGroup> |
|||
<ItemGroup> |
|||
<!-- A reference to the entire .NET Framework is automatically included --> |
|||
<EmbeddedResource Include="Views\MainWindow.xaml"> |
|||
<SubType>Designer</SubType> |
|||
</EmbeddedResource> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<Compile Include="Properties\AssemblyInfo.cs" /> |
|||
<Compile Include="TestScrollable.cs" /> |
|||
<Compile Include="ViewModels\EditorViewModel.cs" /> |
|||
<Compile Include="ViewModels\MainWindowViewModel.cs" /> |
|||
<Compile Include="ViewModels\TestItem.cs" /> |
|||
<Compile Include="ViewModels\TestNode.cs" /> |
|||
<Compile Include="Views\MainWindow.cs" /> |
|||
<Compile Include="XamlTestApp.cs" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<Content Include="github_icon.png"> |
|||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
|||
</Content> |
|||
<Content Include="pattern.jpg"> |
|||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
|||
</Content> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<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\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.DesignerSupport\Avalonia.DesignerSupport.csproj"> |
|||
<Project>{799a7bb5-3c2c-48b6-85a7-406a12c420da}</Project> |
|||
<Name>Avalonia.DesignerSupport</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.HtmlRenderer\Avalonia.HtmlRenderer.csproj"> |
|||
<Project>{5fb2b005-0a7f-4dad-add4-3ed01444e63d}</Project> |
|||
<Name>Avalonia.HtmlRenderer</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.ReactiveUI\Avalonia.ReactiveUI.csproj"> |
|||
<Project>{6417b24e-49c2-4985-8db2-3ab9d898ec91}</Project> |
|||
<Name>Avalonia.ReactiveUI</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> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<Reference Include="Splat, Version=1.6.2.0, Culture=neutral, processorArchitecture=MSIL"> |
|||
<HintPath>..\..\packages\Splat.1.6.2\lib\Portable-net45+win+wpa81+wp80\Splat.dll</HintPath> |
|||
<Private>True</Private> |
|||
</Reference> |
|||
<Reference Include="System.Reactive.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> |
|||
<HintPath>..\..\packages\System.Reactive.Core.3.0.0\lib\netstandard1.1\System.Reactive.Core.dll</HintPath> |
|||
<Private>True</Private> |
|||
</Reference> |
|||
<Reference Include="System.Reactive.Interfaces, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL"> |
|||
<HintPath>..\..\packages\System.Reactive.Interfaces.3.0.0\lib\netstandard1.0\System.Reactive.Interfaces.dll</HintPath> |
|||
<Private>True</Private> |
|||
</Reference> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<EmbeddedResource Include="XamlTestApp.xaml"> |
|||
<SubType>Designer</SubType> |
|||
</EmbeddedResource> |
|||
<None Include="packages.config" /> |
|||
</ItemGroup> |
|||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" /> |
|||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
|||
Other similar extension points exist, see Microsoft.Common.targets. |
|||
<Target Name="BeforeBuild"> |
|||
</Target> |
|||
<Target Name="AfterBuild"> |
|||
</Target> |
|||
--> |
|||
</Project> |
|||
@ -1,26 +0,0 @@ |
|||
<ProjectConfiguration> |
|||
<AutoDetectNugetBuildDependencies>true</AutoDetectNugetBuildDependencies> |
|||
<BuildPriority>1000</BuildPriority> |
|||
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace> |
|||
<ConsiderInconclusiveTestsAsPassing>false</ConsiderInconclusiveTestsAsPassing> |
|||
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies> |
|||
<AllowDynamicCodeContractChecking>true</AllowDynamicCodeContractChecking> |
|||
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking> |
|||
<AllowCodeAnalysis>false</AllowCodeAnalysis> |
|||
<IgnoreThisComponentCompletely>true</IgnoreThisComponentCompletely> |
|||
<RunPreBuildEvents>false</RunPreBuildEvents> |
|||
<RunPostBuildEvents>false</RunPostBuildEvents> |
|||
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully> |
|||
<InstrumentAssembly>true</InstrumentAssembly> |
|||
<PreventSigningOfAssembly>false</PreventSigningOfAssembly> |
|||
<AnalyseExecutionTimes>true</AnalyseExecutionTimes> |
|||
<DetectStackOverflow>true</DetectStackOverflow> |
|||
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace> |
|||
<DefaultTestTimeout>60000</DefaultTestTimeout> |
|||
<UseBuildConfiguration></UseBuildConfiguration> |
|||
<UseBuildPlatform></UseBuildPlatform> |
|||
<ProxyProcessPath></ProxyProcessPath> |
|||
<UseCPUArchitecture>AutoDetect</UseCPUArchitecture> |
|||
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState> |
|||
<BuildProcessArchitecture>x86</BuildProcessArchitecture> |
|||
</ProjectConfiguration> |
|||
|
Before Width: | Height: | Size: 17 KiB |
@ -1,6 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="Splat" version="1.6.2" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
</packages> |
|||
|
Before Width: | Height: | Size: 133 KiB |
@ -0,0 +1,59 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
|
|||
using Android.App; |
|||
using Android.Content; |
|||
using Android.OS; |
|||
using Android.Runtime; |
|||
using Android.Views; |
|||
using Android.Widget; |
|||
using Avalonia.Platform; |
|||
using System.IO; |
|||
|
|||
namespace Avalonia.Android |
|||
{ |
|||
class PlatformIconLoader : IPlatformIconLoader |
|||
{ |
|||
public IWindowIconImpl LoadIcon(IBitmapImpl bitmap) |
|||
{ |
|||
using (var stream = new MemoryStream()) |
|||
{ |
|||
bitmap.Save(stream); |
|||
return LoadIcon(stream); |
|||
} |
|||
} |
|||
|
|||
public IWindowIconImpl LoadIcon(Stream stream) |
|||
{ |
|||
return new FakeIcon(stream); |
|||
} |
|||
|
|||
public IWindowIconImpl LoadIcon(string fileName) |
|||
{ |
|||
using (var file = File.Open(fileName, FileMode.Open)) |
|||
{ |
|||
return new FakeIcon(file); |
|||
} |
|||
} |
|||
} |
|||
|
|||
// Stores the icon created as a stream to support saving even though an icon is never shown
|
|||
public class FakeIcon : IWindowIconImpl |
|||
{ |
|||
private Stream stream = new MemoryStream(); |
|||
|
|||
public FakeIcon(Stream stream) |
|||
{ |
|||
stream.CopyTo(this.stream); |
|||
} |
|||
|
|||
public Stream Save() |
|||
{ |
|||
var returnStream = new MemoryStream(); |
|||
stream.CopyTo(returnStream); |
|||
return returnStream; |
|||
} |
|||
} |
|||
} |
|||
@ -1,9 +1,12 @@ |
|||
// Copyright (c) The Avalonia Project. All rights reserved.
|
|||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|||
|
|||
using System.IO; |
|||
|
|||
namespace Avalonia.Platform |
|||
{ |
|||
public interface IWindowIconImpl |
|||
{ |
|||
Stream Save(); |
|||
} |
|||
} |
|||
|
|||
Loading…
Reference in new issue