diff --git a/samples/ControlCatalog/ControlCatalog.csproj b/samples/ControlCatalog/ControlCatalog.csproj
index dea9b35e24..61f2443eb7 100644
--- a/samples/ControlCatalog/ControlCatalog.csproj
+++ b/samples/ControlCatalog/ControlCatalog.csproj
@@ -35,4 +35,4 @@
-
\ No newline at end of file
+
diff --git a/samples/ControlCatalog/MainView.xaml b/samples/ControlCatalog/MainView.xaml
index 87cb5e9c5c..ec3bf799b4 100644
--- a/samples/ControlCatalog/MainView.xaml
+++ b/samples/ControlCatalog/MainView.xaml
@@ -20,8 +20,9 @@
+
-
+
diff --git a/samples/ControlCatalog/Pages/ListBoxPage.xaml b/samples/ControlCatalog/Pages/ListBoxPage.xaml
new file mode 100644
index 0000000000..3dd8be91c2
--- /dev/null
+++ b/samples/ControlCatalog/Pages/ListBoxPage.xaml
@@ -0,0 +1,13 @@
+
+
+ ListBox
+ Hosts a collection of ListBoxItem.
+
+
+
+
+
+
diff --git a/samples/ControlCatalog/Pages/ListBoxPage.xaml.cs b/samples/ControlCatalog/Pages/ListBoxPage.xaml.cs
new file mode 100644
index 0000000000..dbe6c74800
--- /dev/null
+++ b/samples/ControlCatalog/Pages/ListBoxPage.xaml.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace ControlCatalog.Pages
+{
+ public class ListBoxPage : UserControl
+ {
+ public ListBoxPage()
+ {
+ this.InitializeComponent();
+ DataContext = Enumerable.Range(1, 10).Select(i => $"Item {i}" )
+ .ToArray();
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+
+ }
+}
diff --git a/samples/ControlCatalog/Pages/NumericUpDownPage.xaml b/samples/ControlCatalog/Pages/NumericUpDownPage.xaml
index 305bcd177c..2bb6214b58 100644
--- a/samples/ControlCatalog/Pages/NumericUpDownPage.xaml
+++ b/samples/ControlCatalog/Pages/NumericUpDownPage.xaml
@@ -14,7 +14,7 @@
AllowSpin:
-
+
ClipValueToMinMax:
@@ -77,4 +77,4 @@
-
\ No newline at end of file
+
diff --git a/samples/ControlCatalog/Pages/ScreenPage.cs b/samples/ControlCatalog/Pages/ScreenPage.cs
index 34aa85b8aa..fd66185832 100644
--- a/samples/ControlCatalog/Pages/ScreenPage.cs
+++ b/samples/ControlCatalog/Pages/ScreenPage.cs
@@ -42,7 +42,11 @@ namespace ControlCatalog.Pages
context.DrawRectangle(p, boundsRect);
context.DrawRectangle(p, workingAreaRect);
- FormattedText text = new FormattedText();
+ FormattedText text = new FormattedText()
+ {
+ Typeface = Typeface.Default
+ };
+
text.Text = $"Bounds: {screen.Bounds.Width}:{screen.Bounds.Height}";
context.DrawText(Brushes.Black, boundsRect.Position.WithY(boundsRect.Size.Height), text);
@@ -59,4 +63,4 @@ namespace ControlCatalog.Pages
context.DrawRectangle(p, new Rect(w.Position.X / 10f + Math.Abs(_leftMost), w.Position.Y / 10, w.Bounds.Width / 10, w.Bounds.Height / 10));
}
}
-}
\ No newline at end of file
+}
diff --git a/samples/ControlCatalog/SideBar.xaml b/samples/ControlCatalog/SideBar.xaml
index 7d72d1821b..cc3c31d13a 100644
--- a/samples/ControlCatalog/SideBar.xaml
+++ b/samples/ControlCatalog/SideBar.xaml
@@ -36,7 +36,7 @@
-
+
diff --git a/samples/RenderDemo/SideBar.xaml b/samples/RenderDemo/SideBar.xaml
index b5f8ccaf01..26da2cc556 100644
--- a/samples/RenderDemo/SideBar.xaml
+++ b/samples/RenderDemo/SideBar.xaml
@@ -37,7 +37,7 @@
-
+
diff --git a/samples/RenderDemo/ViewModels/AnimationsPageViewModel.cs b/samples/RenderDemo/ViewModels/AnimationsPageViewModel.cs
index 626a3e7c77..f724baf3c6 100644
--- a/samples/RenderDemo/ViewModels/AnimationsPageViewModel.cs
+++ b/samples/RenderDemo/ViewModels/AnimationsPageViewModel.cs
@@ -10,21 +10,21 @@ namespace RenderDemo.ViewModels
public AnimationsPageViewModel()
{
- ToggleGlobalPlayState = ReactiveCommand.Create(()=>TogglePlayState());
+ ToggleGlobalPlayState = ReactiveCommand.Create(() => TogglePlayState());
}
void TogglePlayState()
{
- switch (Timing.GetGlobalPlayState())
+ switch (Animation.GlobalPlayState)
{
case PlayState.Run:
PlayStateText = "Resume all animations";
- Timing.SetGlobalPlayState(PlayState.Pause);
+ Animation.GlobalPlayState = PlayState.Pause;
break;
case PlayState.Pause:
PlayStateText = "Pause all animations";
- Timing.SetGlobalPlayState(PlayState.Run);
+ Animation.GlobalPlayState = PlayState.Run;
break;
}
}
@@ -36,5 +36,5 @@ namespace RenderDemo.ViewModels
}
public ReactiveCommand ToggleGlobalPlayState { get; }
- }
+ }
}
diff --git a/src/Android/Avalonia.Android/AndroidPlatform.cs b/src/Android/Avalonia.Android/AndroidPlatform.cs
index 7134e7d1b4..2b46bfa492 100644
--- a/src/Android/Avalonia.Android/AndroidPlatform.cs
+++ b/src/Android/Avalonia.Android/AndroidPlatform.cs
@@ -1,8 +1,4 @@
using System;
-using System.IO;
-using System.Linq;
-using Android.Content;
-using Android.Views;
using Avalonia.Android.Platform;
using Avalonia.Android.Platform.Input;
using Avalonia.Android.Platform.SkiaPlatform;
@@ -79,4 +75,4 @@ namespace Avalonia.Android
return new PopupImpl();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Android/Avalonia.Android/AndroidThreadingInterface.cs b/src/Android/Avalonia.Android/AndroidThreadingInterface.cs
index 77dfc60b83..6fe77adca1 100644
--- a/src/Android/Avalonia.Android/AndroidThreadingInterface.cs
+++ b/src/Android/Avalonia.Android/AndroidThreadingInterface.cs
@@ -1,16 +1,7 @@
using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
using System.Reactive.Disposables;
-using System.Text;
using System.Threading;
-using Android.App;
-using Android.Content;
using Android.OS;
-using Android.Runtime;
-using Android.Views;
-using Android.Widget;
using Avalonia.Platform;
using Avalonia.Threading;
@@ -88,4 +79,3 @@ namespace Avalonia.Android
public event Action Signaled;
}
}
-
\ No newline at end of file
diff --git a/src/Android/Avalonia.Android/AppBuilder.cs b/src/Android/Avalonia.Android/AppBuilder.cs
index 6078e3bb98..805bb61655 100644
--- a/src/Android/Avalonia.Android/AppBuilder.cs
+++ b/src/Android/Avalonia.Android/AppBuilder.cs
@@ -1,16 +1,4 @@
-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.Controls;
-using Avalonia.Platform;
using Avalonia.Shared.PlatformSupport;
namespace Avalonia
@@ -23,4 +11,4 @@ namespace Avalonia
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Android/Avalonia.Android/AvaloniaActivity.cs b/src/Android/Avalonia.Android/AvaloniaActivity.cs
index 21ce555086..d3696aa41d 100644
--- a/src/Android/Avalonia.Android/AvaloniaActivity.cs
+++ b/src/Android/Avalonia.Android/AvaloniaActivity.cs
@@ -1,14 +1,7 @@
-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;
namespace Avalonia.Android
{
@@ -48,4 +41,4 @@ namespace Avalonia.Android
return View.DispatchKeyEvent(e);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Android/Avalonia.Android/AvaloniaView.cs b/src/Android/Avalonia.Android/AvaloniaView.cs
index 6c4274a6e4..fbe027db00 100644
--- a/src/Android/Avalonia.Android/AvaloniaView.cs
+++ b/src/Android/Avalonia.Android/AvaloniaView.cs
@@ -1,12 +1,5 @@
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.Android.Platform.SkiaPlatform;
@@ -66,4 +59,4 @@ namespace Avalonia.Android
public IDisposable ShowDialog() => null;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Android/Avalonia.Android/CursorFactory.cs b/src/Android/Avalonia.Android/CursorFactory.cs
index e6b9433cca..9eb28c67f9 100644
--- a/src/Android/Avalonia.Android/CursorFactory.cs
+++ b/src/Android/Avalonia.Android/CursorFactory.cs
@@ -9,4 +9,4 @@ namespace Avalonia.Android
public IPlatformHandle GetCursor(StandardCursorType cursorType)
=> new PlatformHandle(IntPtr.Zero, "ZeroCursor");
}
-}
\ No newline at end of file
+}
diff --git a/src/Android/Avalonia.Android/Platform/ClipboardImpl.cs b/src/Android/Avalonia.Android/Platform/ClipboardImpl.cs
index 8c28b48019..51e0a1e799 100644
--- a/src/Android/Avalonia.Android/Platform/ClipboardImpl.cs
+++ b/src/Android/Avalonia.Android/Platform/ClipboardImpl.cs
@@ -1,9 +1,9 @@
+using System.Threading.Tasks;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Avalonia.Input.Platform;
using Avalonia.Platform;
-using System.Threading.Tasks;
namespace Avalonia.Android.Platform
{
@@ -44,4 +44,4 @@ namespace Avalonia.Android.Platform
return Task.FromResult