Nikita Tsukanov 10 лет назад
Родитель
Сommit
7827d0daef

+ 9 - 3
Perspex.sln

@@ -122,21 +122,25 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perspex.Skia.iOS.TestApp",
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perspex.Skia.iOS", "src\Skia\Perspex.Skia.iOS\Perspex.Skia.iOS.csproj", "{47BE08A7-5985-410B-9FFC-2264B8EA595F}"
 EndProject
+Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "TestApplicationShared", "samples\TestApplicationShared\TestApplicationShared.shproj", "{78345174-5B52-4A14-B9FD-D5F2428137F0}"
+EndProject
 Global
 	GlobalSection(SharedMSBuildProjectFiles) = preSolution
 		src\Shared\RenderHelpers\RenderHelpers.projitems*{fb05ac90-89ba-4f2f-a924-f37875fb547c}*SharedItemsImports = 4
 		src\Shared\PlatformSupport\PlatformSupport.projitems*{e4d9629c-f168-4224-3f51-a5e482ffbc42}*SharedItemsImports = 13
 		src\Skia\Perspex.Skia\Perspex.Skia.projitems*{2f59f3d0-748d-4652-b01e-e0d954756308}*SharedItemsImports = 13
 		src\Shared\PlatformSupport\PlatformSupport.projitems*{db070a10-bf39-4752-8456-86e9d5928478}*SharedItemsImports = 4
-		src\Skia\Perspex.Skia\Perspex.Skia.projitems*{925dd807-b651-475f-9f7c-cbeb974ce43d}*SharedItemsImports = 4
 		src\Shared\RenderHelpers\RenderHelpers.projitems*{925dd807-b651-475f-9f7c-cbeb974ce43d}*SharedItemsImports = 4
+		src\Skia\Perspex.Skia\Perspex.Skia.projitems*{925dd807-b651-475f-9f7c-cbeb974ce43d}*SharedItemsImports = 4
+		samples\TestApplicationShared\TestApplicationShared.projitems*{78345174-5b52-4a14-b9fd-d5f2428137f0}*SharedItemsImports = 13
 		src\Shared\PlatformSupport\PlatformSupport.projitems*{54f237d5-a70a-4752-9656-0c70b1a7b047}*SharedItemsImports = 4
 		src\Shared\RenderHelpers\RenderHelpers.projitems*{3c4c0cb4-0c0f-4450-a37b-148c84ff905f}*SharedItemsImports = 13
 		src\Shared\PlatformSupport\PlatformSupport.projitems*{811a76cf-1cf6-440f-963b-bbe31bd72a82}*SharedItemsImports = 4
-		src\Skia\Perspex.Skia\Perspex.Skia.projitems*{47be08a7-5985-410b-9ffc-2264b8ea595f}*SharedItemsImports = 4
 		src\Shared\RenderHelpers\RenderHelpers.projitems*{47be08a7-5985-410b-9ffc-2264b8ea595f}*SharedItemsImports = 4
-		src\Skia\Perspex.Skia\Perspex.Skia.projitems*{bd43f7c0-396b-4aa1-bad9-dfde54d51298}*SharedItemsImports = 4
+		src\Skia\Perspex.Skia\Perspex.Skia.projitems*{47be08a7-5985-410b-9ffc-2264b8ea595f}*SharedItemsImports = 4
+		samples\TestApplicationShared\TestApplicationShared.projitems*{e3a1060b-50d0-44e8-88b6-f44ef2e5bd72}*SharedItemsImports = 4
 		src\Shared\RenderHelpers\RenderHelpers.projitems*{bd43f7c0-396b-4aa1-bad9-dfde54d51298}*SharedItemsImports = 4
+		src\Skia\Perspex.Skia\Perspex.Skia.projitems*{bd43f7c0-396b-4aa1-bad9-dfde54d51298}*SharedItemsImports = 4
 		src\Shared\RenderHelpers\RenderHelpers.projitems*{3e908f67-5543-4879-a1dc-08eace79b3cd}*SharedItemsImports = 4
 	EndGlobalSection
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -792,6 +796,7 @@ Global
 		{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
 		{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
 		{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Debug|iPhone.ActiveCfg = Debug|Any CPU
 		{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Debug|iPhone.Build.0 = Debug|Any CPU
 		{E3A1060B-50D0-44E8-88B6-F44EF2E5BD72}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
@@ -1183,5 +1188,6 @@ Global
 		{F92E55A5-ED73-4CCB-AB4B-0541B6757F31} = {3743B0F2-CC41-4F14-A8C8-267F579BF91E}
 		{DA49C5F3-BE95-461C-B999-072128CCF59E} = {3743B0F2-CC41-4F14-A8C8-267F579BF91E}
 		{47BE08A7-5985-410B-9FFC-2264B8EA595F} = {3743B0F2-CC41-4F14-A8C8-267F579BF91E}
+		{78345174-5B52-4A14-B9FD-D5F2428137F0} = {9B9E3891-2366-4253-A952-D08BCEB71098}
 	EndGlobalSection
 EndGlobal

+ 4 - 817
samples/TestApplication/Program.cs

@@ -26,828 +26,15 @@ namespace TestApplication
 {
     internal class Program
     {
-        private static readonly PerspexList<Node> s_treeData = new PerspexList<Node>
-        {
-            new Node
-            {
-                Name = "Root 1",
-                Children = new PerspexList<Node>
-                {
-                    new Node
-                    {
-                        Name = "Child 1",
-                    },
-                    new Node
-                    {
-                        Name = "Child 2",
-                        Children = new PerspexList<Node>
-                        {
-                            new Node
-                            {
-                                Name = "Grandchild 1",
-                            },
-                            new Node
-                            {
-                                Name = "Grandmaster Flash",
-                            },
-                        }
-                    },
-                    new Node
-                    {
-                        Name = "Child 3",
-                    },
-                }
-            },
-            new Node
-            {
-                Name = "Root 2",
-            },
-        };
-
-        private static readonly PerspexList<Item> s_listBoxData = new PerspexList<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" },
-        };
-
         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;
-
-            new App
-            {
-                DataTemplates = new DataTemplates
-                {
-                    new FuncTreeDataTemplate<Node>(
-                        x => new TextBlock { Text = x.Name },
-                        x => x.Children,
-                        x => true),
-                },
-            };
-
-            TabControl container;
-
-            Window window = new Window
-            {
-                Title = "Perspex Test Application",
-                Width = 900,
-                Height = 480,
-                Content = new Grid
-                {
-                    ColumnDefinitions = new ColumnDefinitions
-                    {
-                        new ColumnDefinition(1, GridUnitType.Star),
-                        new ColumnDefinition(1, GridUnitType.Star),
-                    },
-                    RowDefinitions = new RowDefinitions
-                    {
-                        new RowDefinition(GridLength.Auto),
-                        new RowDefinition(1, GridUnitType.Star),
-                        new RowDefinition(GridLength.Auto),
-                    },
-                    Children = new Controls
-                    {
-                        (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");
-
-            DevTools.Attach(window);
-            window.Show();
-            Application.Current.Run(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 = SolidColorBrush.Parse("#212121"),
-							},
-							new TextBlock
-							{
-								Text = "A button control",
-								FontSize = 13,
-								Foreground = SolidColorBrush.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 = SolidColorBrush.Parse("#212121"),
-							},
-							new TextBlock
-							{
-								Text = "A toggle button control",
-								FontSize = 13,
-								Foreground = SolidColorBrush.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 = SolidColorBrush.Parse("#212121"),
-							},
-							new TextBlock
-							{
-								Text = "A control for displaying text.",
-								FontSize = 13,
-								Foreground = SolidColorBrush.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 = SolidColorBrush.Parse("#212121"),
-							},
-							new TextBlock
-							{
-								Text = "A label capable of displaying HTML content",
-								FontSize = 13,
-								Foreground = SolidColorBrush.Parse("#727272"),
-								Margin = new Thickness(0, 0, 0, 10)
-							},
-							new HtmlLabel 
-							{ 
-								Background = SolidColorBrush.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 = SolidColorBrush.Parse("#212121"),
-							},
-							new TextBlock
-							{
-								Text = "A text box control",
-								FontSize = 13,
-								Foreground = SolidColorBrush.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 = SolidColorBrush.Parse("#212121"),
-							},
-							new TextBlock
-							{
-								Text = "A check box control",
-								FontSize = 13,
-								Foreground = SolidColorBrush.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 = SolidColorBrush.Parse("#212121"),
-							},
-							new TextBlock
-							{
-								Text = "A radio button control",
-								FontSize = 13,
-								Foreground = SolidColorBrush.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" },
-						}
-					}
-				}
-            };
-        }
-
-        
-        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("github_icon.png") },
-										new TextBlock { Text = x.Name, FontSize = 18 }
-									}
-								})
-						},
-						Children = new Controls
-						{
-							new TextBlock
-							{
-								Text = "ListBox",
-								FontWeight = FontWeight.Medium,
-								FontSize = 20,
-								Foreground = SolidColorBrush.Parse("#212121"),
-							},
-							new TextBlock
-							{
-								Text = "A list box control.",
-								FontSize = 13,
-								Foreground = SolidColorBrush.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 = SolidColorBrush.Parse("#212121"),
-							},
-							new TextBlock
-							{
-								Text = "A tree view control.",
-								FontSize = 13,
-								Foreground = SolidColorBrush.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("github_icon.png"),  Width = 400, Height = 400 },
-					new Image { Source = new Bitmap("pattern.jpg"), Width = 400, Height = 400 },
-				}
-			};
-
-			var next = new Button 
-			{
-				VerticalAlignment = VerticalAlignment.Center,
-				Padding = new Thickness(20),
-				Content = new Perspex.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 Perspex.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 = SolidColorBrush.Parse("#212121"),
-							},
-							new TextBlock
-							{
-								Text = "An items control that displays its items as pages that fill the controls.",
-								FontSize = 13,
-								Foreground = SolidColorBrush.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()
-        {
-            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 = SolidColorBrush.Parse("#212121"),
-							},
-							new TextBlock
-							{
-								Text = "Lays out child controls according to a grid.",
-								FontSize = 13,
-								Foreground = SolidColorBrush.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 = SolidColorBrush.Parse("#FF5722"),
-										[Grid.ColumnSpanProperty] = 2,
-										Height = 200,
-										Margin = new Thickness(2.5)
-									},
-									new Rectangle
-									{
-										Fill = SolidColorBrush.Parse("#FF5722"),
-										[Grid.RowProperty] = 1,
-										Height = 100,
-										Margin = new Thickness(2.5)
-									},
-									new Rectangle
-									{
-										Fill = SolidColorBrush.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 = SolidColorBrush.Parse("#212121"),
-							},
-							new TextBlock
-							{
-								Text = "A panel which lays out its children horizontally or vertically.",
-								FontSize = 13,
-								Foreground = SolidColorBrush.Parse("#727272"),
-								Margin = new Thickness(0, 0, 0, 10)
-							},
-							new StackPanel 
-							{
-								Orientation = Orientation.Vertical,
-								Gap = 4,
-								Width = 300,
-								Children = new Controls
-								{
-									new Rectangle
-									{
-										Fill = SolidColorBrush.Parse("#FFC107"),
-										Height = 50,
-									},
-									new Rectangle
-									{
-										Fill = SolidColorBrush.Parse("#FFC107"),
-										Height = 50,
-									},
-									new Rectangle
-									{
-										Fill = SolidColorBrush.Parse("#FFC107"),
-										Height = 50,
-									},
-								}
-							},
-                            new TextBlock
-                            {
-                                Margin = new Thickness(0, 40, 0, 0),
-                                Text = "Canvas",
-                                FontWeight = FontWeight.Medium,
-                                FontSize = 20,
-                                Foreground = SolidColorBrush.Parse("#212121"),
-                            },
-                            new TextBlock
-                            {
-                                Text = "A panel which lays out its children by explicit coordinates.",
-                                FontSize = 13,
-                                Foreground = SolidColorBrush.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,
-                                    },
-                                }
-                            },
-                        }
-					}
-				}
-            };
-        }
-
-        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 = SolidColorBrush.Parse("#212121"),
-						},
-						new TextBlock
-						{
-							Text = "A few animations showcased below",
-							FontSize = 13,
-							Foreground = SolidColorBrush.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 TextBox
-									{
-										Background = Brushes.White,
-										Text = "Hello!",
-										HorizontalAlignment = HorizontalAlignment.Center,
-										VerticalAlignment = VerticalAlignment.Center,
-									},
-									[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("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;
+            new App();
+            var wnd = MainWindow.Create();
+            DevTools.Attach(wnd);
+            Application.Current.Run(wnd);
         }
     }
 }

+ 0 - 153
samples/TestApplication/TestApplication-Mono.csproj

@@ -1,153 +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>{B6FDF644-8EE5-4A6B-8ECC-C2C2E4DAF116}</ProjectGuid>
-    <OutputType>WinExe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>TestApplication</RootNamespace>
-    <AssemblyName>TestApplication</AssemblyName>
-    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-    <NuGetPackageImportStamp>caf18def</NuGetPackageImportStamp>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug-Mono\</OutputPath>
-    <BaseIntermediateOutputPath>obj\Debug-Mono</BaseIntermediateOutputPath>
-    <DefineConstants>TRACE;DEBUG;PERSPEX_CAIRO;PERSPEX_GTK</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-Mono\</OutputPath>
-    <BaseIntermediateOutputPath>obj\Release-Mono</BaseIntermediateOutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Drawing" />
-    <Reference Include="System.Reactive.Windows.Threading">
-      <HintPath>..\packages\Rx-Xaml.2.2.5\lib\net45\System.Reactive.Windows.Threading.dll</HintPath>
-    </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" />
-    <Reference Include="ReactiveUI">
-      <HintPath>..\packages\reactiveui-core.6.4.0.1\lib\Net45\ReactiveUI.dll</HintPath>
-    </Reference>
-    <Reference Include="Splat">
-      <HintPath>..\packages\Splat.1.6.2\lib\Net45\Splat.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Reactive.Core">
-      <HintPath>..\packages\Rx-Core.2.2.5\lib\net45\System.Reactive.Core.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Reactive.Interfaces">
-      <HintPath>..\packages\Rx-Interfaces.2.2.5\lib\net45\System.Reactive.Interfaces.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Reactive.Linq">
-      <HintPath>..\packages\Rx-Linq.2.2.5\lib\net45\System.Reactive.Linq.dll</HintPath>
-    </Reference>
-    <Reference Include="System.Reactive.PlatformServices">
-      <HintPath>..\packages\Rx-PlatformServices.2.2.5\lib\net45\System.Reactive.PlatformServices.dll</HintPath>
-    </Reference>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="App.cs" />
-    <Compile Include="Program.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="App.config" />
-    <None Include="packages.config" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\Cairo\Perspex.Cairo\Perspex.Cairo.csproj">
-      <Project>{FB05AC90-89BA-4F2F-A924-F37875FB547C}</Project>
-      <Name>Perspex.Cairo</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\Perspex.Animation\Perspex.Animation.csproj">
-      <Project>{d211e587-d8bc-45b9-95a4-f297c8fa5200}</Project>
-      <Name>Perspex.Animation</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\Perspex.Application\Perspex.Application.csproj">
-      <Project>{799A7BB5-3C2C-48B6-85A7-406A12C420DA}</Project>
-      <Name>Perspex.Application</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\Perspex.Base\Perspex.Base.csproj">
-      <Project>{B09B78D8-9B26-48B0-9149-D64A2F120F3F}</Project>
-      <Name>Perspex.Base</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\Perspex.Controls\Perspex.Controls.csproj">
-      <Project>{D2221C82-4A25-4583-9B43-D791E3F6820C}</Project>
-      <Name>Perspex.Controls</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\Perspex.Diagnostics\Perspex.Diagnostics.csproj">
-      <Project>{7062AE20-5DCC-4442-9645-8195BDECE63E}</Project>
-      <Name>Perspex.Diagnostics</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\Perspex.Input\Perspex.Input.csproj">
-      <Project>{62024B2D-53EB-4638-B26B-85EEAA54866E}</Project>
-      <Name>Perspex.Input</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\Perspex.Interactivity\Perspex.Interactivity.csproj">
-      <Project>{6B0ED19D-A08B-461C-A9D9-A9EE40B0C06B}</Project>
-      <Name>Perspex.Interactivity</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\Perspex.Layout\Perspex.Layout.csproj">
-      <Project>{42472427-4774-4C81-8AFF-9F27B8E31721}</Project>
-      <Name>Perspex.Layout</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\Perspex.SceneGraph\Perspex.SceneGraph.csproj">
-      <Project>{EB582467-6ABB-43A1-B052-E981BA910E3A}</Project>
-      <Name>Perspex.SceneGraph</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\Perspex.Styling\Perspex.Styling.csproj">
-      <Project>{F1BAA01A-F176-4C6A-B39D-5B40BB1B148F}</Project>
-      <Name>Perspex.Styling</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\Perspex.Themes.Default\Perspex.Themes.Default.csproj">
-      <Project>{3E10A5FA-E8DA-48B1-AD44-6A5B6CB7750F}</Project>
-      <Name>Perspex.Themes.Default</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\Gtk\Perspex.Gtk\Perspex.Gtk.csproj">
-      <Project>{54F237D5-A70A-4752-9656-0C70B1A7B047}</Project>
-      <Name>Perspex.Gtk</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <Content Include="github_icon.png">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-  </ItemGroup>
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <Import Project="..\packages\SharpDX.2.6.3\build\SharpDX.targets" Condition="Exists('..\packages\SharpDX.2.6.3\build\SharpDX.targets')" />
-  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
-    <PropertyGroup>
-      <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
-    </PropertyGroup>
-    <Error Condition="!Exists('..\packages\SharpDX.2.6.3\build\SharpDX.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SharpDX.2.6.3\build\SharpDX.targets'))" />
-  </Target>
-  <!-- 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 - 5
samples/TestApplication/TestApplication.csproj

@@ -68,10 +68,6 @@
     </Reference>
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="App.cs" />
-    <Compile Include="GalleryStyle.cs" />
-    <Compile Include="Item.cs" />
-    <Compile Include="Node.cs" />
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
@@ -153,11 +149,11 @@
     <Content Include="github_icon.png">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
-    <EmbeddedResource Include="html.htm" />
     <Content Include="pattern.jpg">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
   </ItemGroup>
+  <Import Project="..\TestApplicationShared\TestApplicationShared.projitems" Label="Shared" />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Import Project="..\..\src\Shared\perspex.platform.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 

+ 11 - 0
samples/TestApplication/App.cs → samples/TestApplicationShared/App.cs

@@ -3,6 +3,8 @@
 
 using System;
 using Perspex;
+using Perspex.Controls;
+using Perspex.Controls.Templates;
 using Perspex.Themes.Default;
 
 namespace TestApplication
@@ -15,6 +17,15 @@ namespace TestApplication
             InitializeSubsystems((int)Environment.OSVersion.Platform);            
             Styles = new DefaultTheme();
             Styles.Add(new SampleTabStyle());
+            DataTemplates = new DataTemplates
+            {
+                new FuncTreeDataTemplate<Node>(
+                    x => new TextBlock {Text = x.Name},
+                    x => x.Children,
+                    x => true),
+            };
         }
+
+
     }
 }

+ 0 - 0
samples/TestApplication/GalleryStyle.cs → samples/TestApplicationShared/GalleryStyle.cs


+ 0 - 0
samples/TestApplication/Item.cs → samples/TestApplicationShared/Item.cs


+ 833 - 0
samples/TestApplicationShared/MainWindow.cs

@@ -0,0 +1,833 @@
+using System;
+using System.Collections.Generic;
+using System.Reactive.Linq;
+using System.Text;
+using Perspex;
+using Perspex.Animation;
+using Perspex.Collections;
+using Perspex.Controls;
+using Perspex.Controls.Html;
+using Perspex.Controls.Primitives;
+using Perspex.Controls.Shapes;
+using Perspex.Controls.Templates;
+using Perspex.Diagnostics;
+using Perspex.Layout;
+using Perspex.Media;
+using Perspex.Media.Imaging;
+using TestApplication;
+
+namespace TestApplication
+{
+    class MainWindow
+    {
+        private static readonly PerspexList<Node> s_treeData = new PerspexList<Node>
+        {
+            new Node
+            {
+                Name = "Root 1",
+                Children = new PerspexList<Node>
+                {
+                    new Node
+                    {
+                        Name = "Child 1",
+                    },
+                    new Node
+                    {
+                        Name = "Child 2",
+                        Children = new PerspexList<Node>
+                        {
+                            new Node
+                            {
+                                Name = "Grandchild 1",
+                            },
+                            new Node
+                            {
+                                Name = "Grandmaster Flash",
+                            },
+                        }
+                    },
+                    new Node
+                    {
+                        Name = "Child 3",
+                    },
+                }
+            },
+            new Node
+            {
+                Name = "Root 2",
+            },
+        };
+
+        private static readonly PerspexList<Item> s_listBoxData = new PerspexList<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 = "Perspex Test Application",
+                Width = 900,
+                Height = 480,
+                Content = new Grid
+                {
+                    ColumnDefinitions = new ColumnDefinitions
+                    {
+                        new ColumnDefinition(1, GridUnitType.Star),
+                        new ColumnDefinition(1, GridUnitType.Star),
+                    },
+                    RowDefinitions = new RowDefinitions
+                    {
+                        new RowDefinition(GridLength.Auto),
+                        new RowDefinition(1, GridUnitType.Star),
+                        new RowDefinition(GridLength.Auto),
+                    },
+                    Children = new Controls
+                    {
+                        (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 = SolidColorBrush.Parse("#212121"),
+                            },
+                            new TextBlock
+                            {
+                                Text = "A button control",
+                                FontSize = 13,
+                                Foreground = SolidColorBrush.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 = SolidColorBrush.Parse("#212121"),
+                            },
+                            new TextBlock
+                            {
+                                Text = "A toggle button control",
+                                FontSize = 13,
+                                Foreground = SolidColorBrush.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 = SolidColorBrush.Parse("#212121"),
+                            },
+                            new TextBlock
+                            {
+                                Text = "A control for displaying text.",
+                                FontSize = 13,
+                                Foreground = SolidColorBrush.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 = SolidColorBrush.Parse("#212121"),
+                            },
+                            new TextBlock
+                            {
+                                Text = "A label capable of displaying HTML content",
+                                FontSize = 13,
+                                Foreground = SolidColorBrush.Parse("#727272"),
+                                Margin = new Thickness(0, 0, 0, 10)
+                            },
+                            new HtmlLabel
+                            {
+                                Background = SolidColorBrush.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 = SolidColorBrush.Parse("#212121"),
+                            },
+                            new TextBlock
+                            {
+                                Text = "A text box control",
+                                FontSize = 13,
+                                Foreground = SolidColorBrush.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 = SolidColorBrush.Parse("#212121"),
+                            },
+                            new TextBlock
+                            {
+                                Text = "A check box control",
+                                FontSize = 13,
+                                Foreground = SolidColorBrush.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 = SolidColorBrush.Parse("#212121"),
+                            },
+                            new TextBlock
+                            {
+                                Text = "A radio button control",
+                                FontSize = 13,
+                                Foreground = SolidColorBrush.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" },
+                        }
+                    }
+                }
+            };
+        }
+
+
+        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("github_icon.png") },
+                                        new TextBlock { Text = x.Name, FontSize = 18 }
+                                    }
+                                })
+                        },
+                        Children = new Controls
+                        {
+                            new TextBlock
+                            {
+                                Text = "ListBox",
+                                FontWeight = FontWeight.Medium,
+                                FontSize = 20,
+                                Foreground = SolidColorBrush.Parse("#212121"),
+                            },
+                            new TextBlock
+                            {
+                                Text = "A list box control.",
+                                FontSize = 13,
+                                Foreground = SolidColorBrush.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 = SolidColorBrush.Parse("#212121"),
+                            },
+                            new TextBlock
+                            {
+                                Text = "A tree view control.",
+                                FontSize = 13,
+                                Foreground = SolidColorBrush.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("github_icon.png"),  Width = 400, Height = 400 },
+                    new Image { Source = new Bitmap("pattern.jpg"), Width = 400, Height = 400 },
+                }
+            };
+
+            var next = new Button
+            {
+                VerticalAlignment = VerticalAlignment.Center,
+                Padding = new Thickness(20),
+                Content = new Perspex.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 Perspex.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 = SolidColorBrush.Parse("#212121"),
+                            },
+                            new TextBlock
+                            {
+                                Text = "An items control that displays its items as pages that fill the controls.",
+                                FontSize = 13,
+                                Foreground = SolidColorBrush.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()
+        {
+            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 = SolidColorBrush.Parse("#212121"),
+                            },
+                            new TextBlock
+                            {
+                                Text = "Lays out child controls according to a grid.",
+                                FontSize = 13,
+                                Foreground = SolidColorBrush.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 = SolidColorBrush.Parse("#FF5722"),
+                                        [Grid.ColumnSpanProperty] = 2,
+                                        Height = 200,
+                                        Margin = new Thickness(2.5)
+                                    },
+                                    new Rectangle
+                                    {
+                                        Fill = SolidColorBrush.Parse("#FF5722"),
+                                        [Grid.RowProperty] = 1,
+                                        Height = 100,
+                                        Margin = new Thickness(2.5)
+                                    },
+                                    new Rectangle
+                                    {
+                                        Fill = SolidColorBrush.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 = SolidColorBrush.Parse("#212121"),
+                            },
+                            new TextBlock
+                            {
+                                Text = "A panel which lays out its children horizontally or vertically.",
+                                FontSize = 13,
+                                Foreground = SolidColorBrush.Parse("#727272"),
+                                Margin = new Thickness(0, 0, 0, 10)
+                            },
+                            new StackPanel
+                            {
+                                Orientation = Orientation.Vertical,
+                                Gap = 4,
+                                Width = 300,
+                                Children = new Controls
+                                {
+                                    new Rectangle
+                                    {
+                                        Fill = SolidColorBrush.Parse("#FFC107"),
+                                        Height = 50,
+                                    },
+                                    new Rectangle
+                                    {
+                                        Fill = SolidColorBrush.Parse("#FFC107"),
+                                        Height = 50,
+                                    },
+                                    new Rectangle
+                                    {
+                                        Fill = SolidColorBrush.Parse("#FFC107"),
+                                        Height = 50,
+                                    },
+                                }
+                            },
+                            new TextBlock
+                            {
+                                Margin = new Thickness(0, 40, 0, 0),
+                                Text = "Canvas",
+                                FontWeight = FontWeight.Medium,
+                                FontSize = 20,
+                                Foreground = SolidColorBrush.Parse("#212121"),
+                            },
+                            new TextBlock
+                            {
+                                Text = "A panel which lays out its children by explicit coordinates.",
+                                FontSize = 13,
+                                Foreground = SolidColorBrush.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,
+                                    },
+                                }
+                            },
+                        }
+                    }
+                }
+            };
+        }
+
+        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 = SolidColorBrush.Parse("#212121"),
+                        },
+                        new TextBlock
+                        {
+                            Text = "A few animations showcased below",
+                            FontSize = 13,
+                            Foreground = SolidColorBrush.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 TextBox
+                                    {
+                                        Background = Brushes.White,
+                                        Text = "Hello!",
+                                        HorizontalAlignment = HorizontalAlignment.Center,
+                                        VerticalAlignment = VerticalAlignment.Center,
+                                    },
+                                    [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("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;
+        }
+    }
+}

+ 0 - 0
samples/TestApplication/Node.cs → samples/TestApplicationShared/Node.cs


+ 21 - 0
samples/TestApplicationShared/TestApplicationShared.projitems

@@ -0,0 +1,21 @@
+<?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>
+</Project>

+ 13 - 0
samples/TestApplicationShared/TestApplicationShared.shproj

@@ -0,0 +1,13 @@
+<?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>

+ 0 - 0
samples/TestApplication/html.htm → samples/TestApplicationShared/html.htm