84 changed files with 747 additions and 152 deletions
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,5 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<IgnoreThisComponentCompletely>True</IgnoreThisComponentCompletely> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,3 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings /> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,3 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings /> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>DerivedFilesIncludedInWorkspace</Value> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>DerivedFilesIncludedInWorkspace</Value> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,5 +1,8 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -0,0 +1,7 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<HiddenComponentWarnings> |
|||
<Value>MissingOrIgnoredProjectReference</Value> |
|||
</HiddenComponentWarnings> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,20 +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 Avalonia.Controls; |
|||
using Avalonia.Threading; |
|||
|
|||
namespace Avalonia |
|||
{ |
|||
public static class AppBuilderExtensions |
|||
{ |
|||
public static TAppBuilder UseDataGrid<TAppBuilder>(this TAppBuilder builder) |
|||
where TAppBuilder : AppBuilderBase<TAppBuilder>, new() |
|||
{ |
|||
// Portable.Xaml doesn't correctly load referenced assemblies and so doesn't
|
|||
// find `DataGrid` when loading XAML. Call this method from AppBuilder as a
|
|||
// temporary workaround until we fix XAML.
|
|||
return builder; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
// 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; |
|||
|
|||
namespace Avalonia.Controls |
|||
{ |
|||
/// <summary>
|
|||
/// Contains the arguments for the <see cref="IApplicationLifecycle.Exit"/> event.
|
|||
/// </summary>
|
|||
public class ExitEventArgs : EventArgs |
|||
{ |
|||
/// <summary>
|
|||
/// Gets or sets the exit code that an application returns to the operating system when the application exits.
|
|||
/// </summary>
|
|||
public int ApplicationExitCode { get; set; } |
|||
} |
|||
} |
|||
@ -1,26 +1,26 @@ |
|||
// 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 Avalonia |
|||
namespace Avalonia.Controls |
|||
{ |
|||
/// <summary>
|
|||
/// Enum for ExitMode
|
|||
/// Describes the possible values for <see cref="Application.ShutdownMode"/>.
|
|||
/// </summary>
|
|||
public enum ExitMode |
|||
public enum ShutdownMode |
|||
{ |
|||
/// <summary>
|
|||
/// Indicates an implicit call to Application.Exit when the last window closes.
|
|||
/// Indicates an implicit call to Application.Shutdown when the last window closes.
|
|||
/// </summary>
|
|||
OnLastWindowClose, |
|||
|
|||
/// <summary>
|
|||
/// Indicates an implicit call to Application.Exit when the main window closes.
|
|||
/// Indicates an implicit call to Application.Shutdown when the main window closes.
|
|||
/// </summary>
|
|||
OnMainWindowClose, |
|||
|
|||
/// <summary>
|
|||
/// Indicates that the application only exits on an explicit call to Application.Exit.
|
|||
/// Indicates that the application only exits on an explicit call to Application.Shutdown.
|
|||
/// </summary>
|
|||
OnExplicitExit |
|||
OnExplicitShutdown |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
// 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 System.Linq; |
|||
|
|||
namespace Avalonia.Controls |
|||
{ |
|||
/// <summary>
|
|||
/// Contains the arguments for the <see cref="IApplicationLifecycle.Startup"/> event.
|
|||
/// </summary>
|
|||
public class StartupEventArgs : EventArgs |
|||
{ |
|||
private string[] _args; |
|||
|
|||
/// <summary>
|
|||
/// Gets the command line arguments that were passed to the application.
|
|||
/// </summary>
|
|||
public IReadOnlyList<string> Args => _args ?? (_args = GetArgs()); |
|||
|
|||
private static string[] GetArgs() |
|||
{ |
|||
try |
|||
{ |
|||
var args = Environment.GetCommandLineArgs(); |
|||
|
|||
return args.Length > 1 ? args.Skip(1).ToArray() : new string[0]; |
|||
} |
|||
catch (NotSupportedException) |
|||
{ |
|||
return new string[0]; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,73 @@ |
|||
using System; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Avalonia.Animation; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Styling; |
|||
using Avalonia.UnitTests; |
|||
using Avalonia.Data; |
|||
using Xunit; |
|||
using Avalonia.Animation.Easings; |
|||
|
|||
namespace Avalonia.Animation.UnitTests |
|||
{ |
|||
public class TransitionsTests |
|||
{ |
|||
[Fact] |
|||
public void Check_Transitions_Interpolation_Negative_Bounds_Clamp() |
|||
{ |
|||
var clock = new MockGlobalClock(); |
|||
|
|||
using (UnitTestApplication.Start(new TestServices(globalClock: clock))) |
|||
{ |
|||
var border = new Border |
|||
{ |
|||
Transitions = |
|||
{ |
|||
new DoubleTransition |
|||
{ |
|||
Duration = TimeSpan.FromSeconds(1), |
|||
Property = Border.OpacityProperty, |
|||
} |
|||
} |
|||
}; |
|||
|
|||
border.Opacity = 0; |
|||
|
|||
clock.Pulse(TimeSpan.FromSeconds(0)); |
|||
clock.Pulse(TimeSpan.FromSeconds(-0.5)); |
|||
|
|||
Assert.Equal(0, border.Opacity); |
|||
} |
|||
} |
|||
|
|||
[Fact] |
|||
public void Check_Transitions_Interpolation_Positive_Bounds_Clamp() |
|||
{ |
|||
var clock = new MockGlobalClock(); |
|||
|
|||
using (UnitTestApplication.Start(new TestServices(globalClock: clock))) |
|||
{ |
|||
var border = new Border |
|||
{ |
|||
Transitions = |
|||
{ |
|||
new DoubleTransition |
|||
{ |
|||
Duration = TimeSpan.FromSeconds(1), |
|||
Property = Border.OpacityProperty, |
|||
} |
|||
} |
|||
}; |
|||
|
|||
border.Opacity = 0; |
|||
|
|||
clock.Pulse(TimeSpan.FromSeconds(0)); |
|||
clock.Pulse(TimeSpan.FromMilliseconds(1001)); |
|||
|
|||
Assert.Equal(0, border.Opacity); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,60 @@ |
|||
using System; |
|||
using Avalonia.Animation; |
|||
using Avalonia.Controls; |
|||
using Avalonia.UnitTests; |
|||
using JetBrains.dotMemoryUnit; |
|||
using Xunit; |
|||
using Xunit.Abstractions; |
|||
|
|||
namespace Avalonia.LeakTests |
|||
{ |
|||
[DotMemoryUnit(FailIfRunWithoutSupport = false)] |
|||
public class TransitionTests |
|||
{ |
|||
public TransitionTests(ITestOutputHelper atr) |
|||
{ |
|||
DotMemoryUnitTestOutput.SetOutputMethod(atr.WriteLine); |
|||
} |
|||
|
|||
[Fact(Skip = "TODO: Fix this leak")] |
|||
public void Transition_On_StyledProperty_Is_Freed() |
|||
{ |
|||
var clock = new MockGlobalClock(); |
|||
|
|||
using (UnitTestApplication.Start(new TestServices(globalClock: clock))) |
|||
{ |
|||
Func<Border> run = () => |
|||
{ |
|||
var border = new Border |
|||
{ |
|||
Transitions = |
|||
{ |
|||
new DoubleTransition |
|||
{ |
|||
Duration = TimeSpan.FromSeconds(1), |
|||
Property = Border.OpacityProperty, |
|||
} |
|||
} |
|||
}; |
|||
|
|||
border.Opacity = 0; |
|||
|
|||
clock.Pulse(TimeSpan.FromSeconds(0)); |
|||
clock.Pulse(TimeSpan.FromSeconds(0.5)); |
|||
|
|||
Assert.Equal(0.5, border.Opacity); |
|||
|
|||
clock.Pulse(TimeSpan.FromSeconds(1)); |
|||
|
|||
Assert.Equal(0, border.Opacity); |
|||
return border; |
|||
}; |
|||
|
|||
var result = run(); |
|||
|
|||
dotMemory.Check(memory => |
|||
Assert.Equal(0, memory.GetObjects(where => where.Type.Is<TransitionInstance>()).ObjectsCount)); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
using System; |
|||
using Avalonia.Animation; |
|||
|
|||
namespace Avalonia.UnitTests |
|||
{ |
|||
public class MockGlobalClock : ClockBase, IGlobalClock |
|||
{ |
|||
public new void Pulse(TimeSpan systemTime) => base.Pulse(systemTime); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue