From 17fdde66d94155fc62a034fa6658995bef6fd6e5 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Tue, 22 Mar 2016 13:02:25 -0700 Subject: Initial import --- Xamarin.Forms.Controls/App.cs | 321 ++++++++++++++++ .../ControlGalleryPages/AppearingGalleryPage.cs | 129 +++++++ .../ControlGalleryPages/AutomationIDGallery.cs | 104 +++++ .../ControlGalleryPages/BehaviorsAndTriggers.xaml | 37 ++ .../BehaviorsAndTriggers.xaml.cs | 75 ++++ .../CellForceUpdateSizeGalleryPage.cs | 193 ++++++++++ .../ControlGalleryPages/LayoutAddPerformance.xaml | 15 + .../LayoutAddPerformance.xaml.cs | 36 ++ .../ControlGalleryPages/ListRefresh.cs | 115 ++++++ .../ControlGalleryPages/ListScrollTo.cs | 93 +++++ .../ControlGalleryPages/ListViewSelectionColor.cs | 150 ++++++++ .../ControlGalleryPages/NavBarTitleTestPage.cs | 91 +++++ .../NestedNativeControlGalleryPage.cs | 27 ++ .../ControlGalleryPages/PanGestureGalleryPage.cs | 96 +++++ .../ControlGalleryPages/PinchGestureTestPage.cs | 91 +++++ .../ControlGalleryPages/ToolbarItems.cs | 55 +++ Xamarin.Forms.Controls/Controls/Issue3076Button.cs | 14 + Xamarin.Forms.Controls/CoreGallery.cs | 419 +++++++++++++++++++++ .../ActivityIndicatorCoreGalleryPage.cs | 39 ++ .../CoreGalleryPages/ButtonCoreGalleryPage.cs | 106 ++++++ .../CoreGalleryPages/CoreBoxViewGalleryPage.cs | 37 ++ .../CoreGalleryPages/CoreGalleryPage.cs | 185 +++++++++ .../CoreGalleryPages/DatePickerCoreGalleryPage.cs | 34 ++ .../CoreGalleryPages/EditorCoreGalleryPage.cs | 51 +++ .../CoreGalleryPages/EntryCoreGalleryPage.cs | 92 +++++ .../CoreGalleryPages/FrameCoreGalleryPage.cs | 36 ++ .../CoreGalleryPages/ImageCoreGalleryPage.cs | 56 +++ .../CoreGalleryPages/KeyboardCoreGalleryPage.cs | 49 +++ .../CoreGalleryPages/LabelCoreGalleryPage.cs | 158 ++++++++ .../CoreGalleryPages/ListViewCoreGalleryPage.cs | 268 +++++++++++++ .../CoreGalleryPages/OpenGLViewCoreGalleryPage.cs | 16 + .../CoreGalleryPages/PickerCoreGalleryPage.cs | 35 ++ .../CoreGalleryPages/ProgressBarCoreGalleryPage.cs | 27 ++ .../CoreGalleryPages/SearchBarCoreGalleryPage.cs | 89 +++++ .../CoreGalleryPages/SliderCoreGalleryPage.cs | 29 ++ .../CoreGalleryPages/StepperCoreGalleryPage.cs | 29 ++ .../CoreGalleryPages/SwitchCoreGalleryPage.cs | 25 ++ .../CoreGalleryPages/TableViewCoreGalleryPage.cs | 16 + .../CoreGalleryPages/TimePickerCoreGalleryPage.cs | 24 ++ .../CoreGalleryPages/WebViewCoreGalleryPage.cs | 62 +++ .../GalleryPages/AbsoluteLayoutGallery.cs | 151 ++++++++ .../GalleryPages/ActionSheetGallery.cs | 64 ++++ .../GalleryPages/AlertGallery.cs | 28 ++ .../GalleryPages/BackgroundImageGallery.cs | 109 ++++++ .../GalleryPages/BoundContentPage.cs | 79 ++++ .../GalleryPages/ButtonGallery.cs | 115 ++++++ .../GalleryPages/CarouselPageGallery.cs | 76 ++++ .../GalleryPages/CarouselViewGallery.cs | 292 ++++++++++++++ .../GalleryPages/CellTypeList.cs | 63 ++++ .../CellsGalleries/EntryCellListPage.cs | 54 +++ .../CellsGalleries/EntryCellTablePage.cs | 85 +++++ .../CellsGalleries/ImageCellListPage.cs | 121 ++++++ .../CellsGalleries/ImageCellTablePage.cs | 68 ++++ .../GalleryPages/CellsGalleries/ProductViewCell.cs | 33 ++ .../CellsGalleries/SwitchCellListPage.cs | 47 +++ .../CellsGalleries/SwitchCellTablePage.cs | 65 ++++ .../CellsGalleries/TextCellListPage.cs | 48 +++ .../CellsGalleries/TextCellTablePage.cs | 58 +++ .../CellsGalleries/UnEvenViewCellGallery.cs | 34 ++ .../GalleryPages/CellsGalleries/ViewCellGallery.cs | 115 ++++++ .../GalleryPages/ClipToBoundsGallery.cs | 31 ++ .../GalleryPages/ControlTemplatePage.cs | 48 +++ .../GalleryPages/ControlTemplateXamlPage.xaml | 24 ++ .../GalleryPages/ControlTemplateXamlPage.xaml.cs | 31 ++ .../GalleryPages/DisposeGallery.cs | 58 +++ .../GalleryPages/EditableList.cs | 116 ++++++ .../GalleryPages/EditorGallery.cs | 132 +++++++ .../GalleryPages/EntryGallery.cs | 104 +++++ .../GalleryPages/FrameGallery.cs | 32 ++ Xamarin.Forms.Controls/GalleryPages/GridGallery.cs | 174 +++++++++ .../GalleryPages/GroupedListActionsGallery.cs | 282 ++++++++++++++ .../GalleryPages/GroupedListContactsGallery.cs | 244 ++++++++++++ .../GalleryPages/ImageGallery.cs | 71 ++++ .../GalleryPages/ImageLoadingGallery.cs | 43 +++ .../GalleryPages/InputIntentGallery.cs | 101 +++++ .../GalleryPages/LabelGallery.cs | 116 ++++++ .../GalleryPages/LayoutOptionsGallery.cs | 108 ++++++ .../GalleryPages/LayoutPerformanceGallery.cs | 116 ++++++ .../GalleryPages/LineBreakModeGallery.cs | 41 ++ Xamarin.Forms.Controls/GalleryPages/ListPage.cs | 117 ++++++ .../GalleryPages/ListViewDemoPage.cs | 231 ++++++++++++ Xamarin.Forms.Controls/GalleryPages/MapGallery.cs | 153 ++++++++ .../GalleryPages/MasterDetailPageTabletPage.cs | 40 ++ .../GalleryPages/MinimumSizeGallery.cs | 50 +++ .../GalleryPages/MultiGallery.cs | 58 +++ .../GalleryPages/NavigationBarGallery.cs | 62 +++ .../GalleryPages/NavigationMenuGallery.cs | 38 ++ .../GalleryPages/NavigationPropertiesGallery.cs | 64 ++++ .../GalleryPages/OpenGLGallery.cs | 70 ++++ .../GalleryPages/PickerGallery.cs | 45 +++ .../GalleryPages/ProgressBarGallery.cs | 26 ++ .../GalleryPages/RelativeLayoutGallery.cs | 47 +++ Xamarin.Forms.Controls/GalleryPages/ScaleRotate.cs | 157 ++++++++ .../GalleryPages/ScrollGallery.cs | 158 ++++++++ .../GalleryPages/SearchBarGallery.cs | 128 +++++++ .../GalleryPages/SettingsPage.cs | 57 +++ .../GalleryPages/SliderGallery.cs | 33 ++ .../GalleryPages/StackLayoutGallery.cs | 47 +++ .../GalleryPages/StepperGallery.cs | 49 +++ .../GalleryPages/StyleGallery.cs | 41 ++ .../GalleryPages/StyleXamlGallery.xaml | 17 + .../GalleryPages/StyleXamlGallery.xaml.cs | 15 + .../GalleryPages/SwitchGallery.cs | 53 +++ .../GalleryPages/TableViewGallery.cs | 24 ++ .../GalleryPages/TemplatedCarouselGallery.cs | 114 ++++++ .../GalleryPages/TemplatedTabbedGallery.cs | 169 +++++++++ .../GalleryPages/ToolbarGallery.cs | 40 ++ .../GalleryPages/UnevenListGallery.cs | 112 ++++++ .../GalleryPages/WebViewGallery.cs | 50 +++ Xamarin.Forms.Controls/GalleryPages/XamlPage.xaml | 4 + .../GalleryPages/XamlPage.xaml.cs | 13 + Xamarin.Forms.Controls/GalleryPages/crimson.jpg | Bin 0 -> 79109 bytes .../Helpers/ITestCloudService.cs | 12 + Xamarin.Forms.Controls/LegacyRepro/Page1.xaml | 13 + Xamarin.Forms.Controls/LegacyRepro/Page1.xaml.cs | 193 ++++++++++ .../LegacyRepro/SampleViewCell.xaml | 34 ++ .../LegacyRepro/SampleViewCell.xaml.cs | 149 ++++++++ Xamarin.Forms.Controls/Properties/AssemblyInfo.cs | 33 ++ Xamarin.Forms.Controls/RootPages/CaseTenPage.cs | 27 ++ Xamarin.Forms.Controls/RootPages/Issue465Page.cs | 28 ++ .../RootPages/RootContentPage.cs | 19 + .../RootPages/RootMDPNavigationContentPage.cs | 40 ++ .../RootMDPNavigationTabbedContentPage.cs | 49 +++ .../RootPages/RootNavigationContentPage.cs | 26 ++ .../RootPages/RootNavigationManyTabbedPage.cs | 63 ++++ .../RootPages/RootNavigationTabbedContentPage.cs | 45 +++ .../RootPages/RootTabbedContentPage.cs | 43 +++ .../RootTabbedMDPNavigationContentPage.cs | 57 +++ .../RootTabbedManyNavigationContentPage.cs | 77 ++++ .../RootPages/RootTabbedNavigationContentPage.cs | 46 +++ .../RootPages/SwapHierachyStackLayout.cs | 69 ++++ Xamarin.Forms.Controls/RootPages/TabbedNavPage.cs | 33 ++ Xamarin.Forms.Controls/TestCases.cs | 213 +++++++++++ .../ViewContainers/EventViewContainer.cs | 32 ++ .../ViewContainers/LayeredViewContainer.cs | 38 ++ .../ViewContainers/MultiBindingHack.cs | 47 +++ .../ViewContainers/StateViewContainer.cs | 48 +++ .../ViewContainers/ValueViewContainer.cs | 16 + .../ViewContainers/ViewContainer.cs | 44 +++ .../Xamarin.Forms.Controls.csproj | 285 ++++++++++++++ Xamarin.Forms.Controls/app.config | 11 + Xamarin.Forms.Controls/packages.config | 4 + 142 files changed, 11177 insertions(+) create mode 100644 Xamarin.Forms.Controls/App.cs create mode 100644 Xamarin.Forms.Controls/ControlGalleryPages/AppearingGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/ControlGalleryPages/AutomationIDGallery.cs create mode 100644 Xamarin.Forms.Controls/ControlGalleryPages/BehaviorsAndTriggers.xaml create mode 100644 Xamarin.Forms.Controls/ControlGalleryPages/BehaviorsAndTriggers.xaml.cs create mode 100644 Xamarin.Forms.Controls/ControlGalleryPages/CellForceUpdateSizeGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/ControlGalleryPages/LayoutAddPerformance.xaml create mode 100644 Xamarin.Forms.Controls/ControlGalleryPages/LayoutAddPerformance.xaml.cs create mode 100644 Xamarin.Forms.Controls/ControlGalleryPages/ListRefresh.cs create mode 100644 Xamarin.Forms.Controls/ControlGalleryPages/ListScrollTo.cs create mode 100644 Xamarin.Forms.Controls/ControlGalleryPages/ListViewSelectionColor.cs create mode 100644 Xamarin.Forms.Controls/ControlGalleryPages/NavBarTitleTestPage.cs create mode 100644 Xamarin.Forms.Controls/ControlGalleryPages/NestedNativeControlGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/ControlGalleryPages/PanGestureGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/ControlGalleryPages/PinchGestureTestPage.cs create mode 100644 Xamarin.Forms.Controls/ControlGalleryPages/ToolbarItems.cs create mode 100644 Xamarin.Forms.Controls/Controls/Issue3076Button.cs create mode 100644 Xamarin.Forms.Controls/CoreGallery.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/ActivityIndicatorCoreGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/ButtonCoreGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/CoreBoxViewGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/CoreGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/DatePickerCoreGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/EditorCoreGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/EntryCoreGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/FrameCoreGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/ImageCoreGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/KeyboardCoreGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/LabelCoreGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/ListViewCoreGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/OpenGLViewCoreGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/PickerCoreGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/ProgressBarCoreGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/SearchBarCoreGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/SliderCoreGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/StepperCoreGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/SwitchCoreGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/TableViewCoreGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/TimePickerCoreGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/CoreGalleryPages/WebViewCoreGalleryPage.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/AbsoluteLayoutGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/ActionSheetGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/AlertGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/BackgroundImageGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/BoundContentPage.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/ButtonGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/CarouselPageGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/CarouselViewGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/CellTypeList.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/CellsGalleries/EntryCellListPage.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/CellsGalleries/EntryCellTablePage.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/CellsGalleries/ImageCellListPage.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/CellsGalleries/ImageCellTablePage.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/CellsGalleries/ProductViewCell.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/CellsGalleries/SwitchCellListPage.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/CellsGalleries/SwitchCellTablePage.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/CellsGalleries/TextCellListPage.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/CellsGalleries/TextCellTablePage.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/CellsGalleries/UnEvenViewCellGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/CellsGalleries/ViewCellGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/ClipToBoundsGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/ControlTemplatePage.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/ControlTemplateXamlPage.xaml create mode 100644 Xamarin.Forms.Controls/GalleryPages/ControlTemplateXamlPage.xaml.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/DisposeGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/EditableList.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/EditorGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/EntryGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/FrameGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/GridGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/GroupedListActionsGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/GroupedListContactsGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/ImageGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/ImageLoadingGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/InputIntentGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/LabelGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/LayoutOptionsGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/LayoutPerformanceGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/LineBreakModeGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/ListPage.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/ListViewDemoPage.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/MapGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/MasterDetailPageTabletPage.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/MinimumSizeGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/MultiGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/NavigationBarGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/NavigationMenuGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/NavigationPropertiesGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/OpenGLGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/PickerGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/ProgressBarGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/RelativeLayoutGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/ScaleRotate.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/ScrollGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/SearchBarGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/SettingsPage.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/SliderGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/StackLayoutGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/StepperGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/StyleGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/StyleXamlGallery.xaml create mode 100644 Xamarin.Forms.Controls/GalleryPages/StyleXamlGallery.xaml.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/SwitchGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/TableViewGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/TemplatedCarouselGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/TemplatedTabbedGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/ToolbarGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/UnevenListGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/WebViewGallery.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/XamlPage.xaml create mode 100644 Xamarin.Forms.Controls/GalleryPages/XamlPage.xaml.cs create mode 100644 Xamarin.Forms.Controls/GalleryPages/crimson.jpg create mode 100644 Xamarin.Forms.Controls/Helpers/ITestCloudService.cs create mode 100644 Xamarin.Forms.Controls/LegacyRepro/Page1.xaml create mode 100644 Xamarin.Forms.Controls/LegacyRepro/Page1.xaml.cs create mode 100644 Xamarin.Forms.Controls/LegacyRepro/SampleViewCell.xaml create mode 100644 Xamarin.Forms.Controls/LegacyRepro/SampleViewCell.xaml.cs create mode 100644 Xamarin.Forms.Controls/Properties/AssemblyInfo.cs create mode 100644 Xamarin.Forms.Controls/RootPages/CaseTenPage.cs create mode 100644 Xamarin.Forms.Controls/RootPages/Issue465Page.cs create mode 100644 Xamarin.Forms.Controls/RootPages/RootContentPage.cs create mode 100644 Xamarin.Forms.Controls/RootPages/RootMDPNavigationContentPage.cs create mode 100644 Xamarin.Forms.Controls/RootPages/RootMDPNavigationTabbedContentPage.cs create mode 100644 Xamarin.Forms.Controls/RootPages/RootNavigationContentPage.cs create mode 100644 Xamarin.Forms.Controls/RootPages/RootNavigationManyTabbedPage.cs create mode 100644 Xamarin.Forms.Controls/RootPages/RootNavigationTabbedContentPage.cs create mode 100644 Xamarin.Forms.Controls/RootPages/RootTabbedContentPage.cs create mode 100644 Xamarin.Forms.Controls/RootPages/RootTabbedMDPNavigationContentPage.cs create mode 100644 Xamarin.Forms.Controls/RootPages/RootTabbedManyNavigationContentPage.cs create mode 100644 Xamarin.Forms.Controls/RootPages/RootTabbedNavigationContentPage.cs create mode 100644 Xamarin.Forms.Controls/RootPages/SwapHierachyStackLayout.cs create mode 100644 Xamarin.Forms.Controls/RootPages/TabbedNavPage.cs create mode 100644 Xamarin.Forms.Controls/TestCases.cs create mode 100644 Xamarin.Forms.Controls/ViewContainers/EventViewContainer.cs create mode 100644 Xamarin.Forms.Controls/ViewContainers/LayeredViewContainer.cs create mode 100644 Xamarin.Forms.Controls/ViewContainers/MultiBindingHack.cs create mode 100644 Xamarin.Forms.Controls/ViewContainers/StateViewContainer.cs create mode 100644 Xamarin.Forms.Controls/ViewContainers/ValueViewContainer.cs create mode 100644 Xamarin.Forms.Controls/ViewContainers/ViewContainer.cs create mode 100644 Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj create mode 100644 Xamarin.Forms.Controls/app.config create mode 100644 Xamarin.Forms.Controls/packages.config (limited to 'Xamarin.Forms.Controls') diff --git a/Xamarin.Forms.Controls/App.cs b/Xamarin.Forms.Controls/App.cs new file mode 100644 index 00000000..53424cce --- /dev/null +++ b/Xamarin.Forms.Controls/App.cs @@ -0,0 +1,321 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using System.Reflection; +using System.Threading.Tasks; + +namespace Xamarin.Forms.Controls +{ + public class AppLifeCycle : Application + { + protected override void OnStart () + { + base.OnStart (); + } + + protected override void OnSleep () + { + base.OnSleep (); + } + + protected override void OnResume () + { + base.OnResume (); + } + + public AppLifeCycle () + { + MainPage = new ContentPage { + Content = new Label { + Text = "Testing Lifecycle events" + } + }; + } + } + + public class SimpleApp : Application + { + Label label; + + public SimpleApp () + { + label = new Label { VerticalOptions = LayoutOptions.CenterAndExpand }; + + if (Current.Properties.ContainsKey ("LabelText")) { + label.Text = (string) Current.Properties["LabelText"] + " Restored!"; + Debug.WriteLine ("Initialized"); + } else { + Current.Properties["LabelText"] = "Wowza"; + label.Text = (string) Current.Properties["LabelText"] + " Set!"; + Debug.WriteLine ("Saved"); + } + + MainPage = new ContentPage { + Content = new StackLayout { + Children = { + label + } + } + }; + + SerializeProperties (); + } + + async void SerializeProperties () + { + await Current.SavePropertiesAsync (); + } + } + + public class App : Application + { + public string InsightsApiKey = Secrets["InsightsApiKey"]; + public const string AppName = "XamarinFormsControls"; + public const string AppVersion = "1.4.3"; + public static int IOSVersion = -1; + readonly ITestCloudService _testCloudService; + // make sure serialized data is available here + + //protected override void OnStart () + //{ + // // called right after property store is populated + // MainPage.BackgroundColor = Color.Green; + // Current.Properties["TimesStarted"] = ((int)Current.Properties["TimesStarted"]) + 1; + // ((MainPageLifeCycleTests)MainPage).UpdateLabels (); + //} + + //protected override void OnResume () + //{ + // MainPage.BackgroundColor = Color.White; + // Current.Properties["TimesResumed"] = ((int)Current.Properties["TimesResumed"]) + 1; + // ((MainPageLifeCycleTests)MainPage).UpdateLabels (); + //} + + //protected override void OnSleep () + //{ + // MainPage.BackgroundColor = Color.Red; + // Current.Properties["TimesSlept"] = ((int)Current.Properties["TimesSlept"]) + 1; + // ((MainPageLifeCycleTests)MainPage).UpdateLabels (); + //} + public static List AppearingMessages = new List(); + + public static ContentPage MenuPage { get; set; } + + + + public App () + { + _testCloudService = DependencyService.Get (); + InitInsights (); + // MainPage = new MainPageLifeCycleTests (); + MainPage = new MasterDetailPage () { + Master = new ContentPage { Title = "Master", BackgroundColor = Color.Red }, + Detail = CoreGallery.GetMainPage () + }; + } + + public void SetMainPage (Page rootPage) + { + MainPage = rootPage; + } + + void InitInsights () + { + if (Insights.IsInitialized) { + Insights.ForceDataTransmission = true; + if (_testCloudService != null && _testCloudService.IsOnTestCloud ()) + Insights.Identify (_testCloudService.GetTestCloudDevice (), "Name", _testCloudService.GetTestCloudDeviceName ()); + else + Insights.Identify ("DemoUser", "Name", "Demo User"); + } + } + + public static Assembly GetAssembly (out string assemblystring) + { + assemblystring = typeof(App).AssemblyQualifiedName.Split (',')[1].Trim (); + var assemblyname = new AssemblyName (assemblystring); + return Assembly.Load (assemblyname); + } + + public static async Task LoadResource (string filename) + { + string assemblystring; + Assembly assembly = GetAssembly (out assemblystring); + + Stream stream = assembly.GetManifestResourceStream ($"{assemblystring}.{filename}"); + string text; + using (var reader = new StreamReader (stream)) { + text = await reader.ReadToEndAsync (); + } + return text; + } + + public static void InitSecrets () + { + secrets = new Dictionary (); + + string keyData = LoadResource ("secrets.txt").Result; + string[] entries = keyData.Split ("\n\r".ToCharArray (), StringSplitOptions.RemoveEmptyEntries); + foreach (string entry in entries) { + string[] parts = entry.Split (':'); + if (parts.Length < 2) { + continue; + } + + secrets.Add (parts[0].Trim (), parts[1].Trim ()); + } + } + + private static Dictionary secrets; + + public static Dictionary Secrets + { + get + { + if (secrets == null) { + InitSecrets (); + } + + return secrets; + } + } + } + + // Not quite sure how to turn this into a test case, effectively replace the normal Application with this to repro issues reported. + // Full repro requires assignment to MainPage, hence the issue + public class NavReproApp : Application + { + NavigationPage navPage1 = new NavigationPage (); + + public NavReproApp () + { + + var btn = new Button () { Text = "Start" }; + + btn.Clicked += Btn_Clicked; + + navPage1.PushAsync (new ContentPage () { Content = btn }); + + MainPage = navPage1; + + } + + async void Btn_Clicked (object sender, EventArgs e) + { + await navPage1.PushAsync (new ContentPage () { Content = new Label () { Text = "Page 2" } }); + await navPage1.PushAsync (new ContentPage () { Content = new Label () { Text = "Page 3" } }); + + + var navPage2 = new NavigationPage (); + + var btn = new Button () { Text = "Start Next" }; + btn.Clicked += Btn_Clicked1; + + await navPage2.PushAsync (new ContentPage () { Content = btn }); + + MainPage = navPage2; + + + } + + async void Btn_Clicked1 (object sender, EventArgs e) + { + MainPage = navPage1; + await navPage1.PopAsync (); + + + await navPage1.PushAsync (new ContentPage () { Content = new Label () { Text = "Page 3a" } }); + } + + protected override void OnStart () + { + // Handle when your app starts + } + + protected override void OnSleep () + { + // Handle when your app sleeps + } + + protected override void OnResume () + { + // Handle when your app resumes + } + } + + public class MainPageLifeCycleTests : ContentPage + { + int numTimesStarted; + int numTimesSlept; + int numTimesResumed; + + StackLayout numTimesStartedLayout; + StackLayout numTimesSleptLayout; + StackLayout numTimesResumedLayout; + + public MainPageLifeCycleTests () + { + object timesStarted; + if (!Application.Current.Properties.TryGetValue ("TimesStarted", out timesStarted)) { + Application.Current.Properties["TimesStarted"] = 0; + } + var numTimesStarted = (int)Application.Current.Properties["TimesStarted"]; + + + object timesSlept; + if (!Application.Current.Properties.TryGetValue ("TimesSlept", out timesSlept)) { + Application.Current.Properties["TimesSlept"] = 0; + } + var numTimesSlept = (int)Application.Current.Properties["TimesSlept"]; + + + object timesResumed; + if (!Application.Current.Properties.TryGetValue ("TimesResumed", out timesResumed)) { + Application.Current.Properties["TimesResumed"] = 0; + } + var numTimesResumed = (int)Application.Current.Properties["TimesResumed"]; + + numTimesStartedLayout = BuildLabelLayout ("TimesStarted", numTimesStarted); + numTimesSleptLayout = BuildLabelLayout ("TimesSlept", numTimesSlept); + numTimesResumedLayout = BuildLabelLayout ("TimesResumed", numTimesResumed); + + var layout = new StackLayout { + Children = { + numTimesStartedLayout, + numTimesSleptLayout, + numTimesResumedLayout + } + }; + + Content = layout; + } + + StackLayout BuildLabelLayout (string title, int property) + { + var labelTitle = new Label { + Text = title + }; + + var valueLabel = new Label { + Text = property.ToString () + }; + + return new StackLayout { + Children = { + labelTitle, + valueLabel + } + }; + } + + public void UpdateLabels () + { + ((Label)numTimesStartedLayout.Children[1]).Text = ((int)Application.Current.Properties["TimesStarted"]).ToString (); + ((Label)numTimesSleptLayout.Children[1]).Text = ((int)Application.Current.Properties["TimesSlept"]).ToString (); + ((Label)numTimesResumedLayout.Children[1]).Text = ((int)Application.Current.Properties["TimesResumed"]).ToString (); + } + } +} diff --git a/Xamarin.Forms.Controls/ControlGalleryPages/AppearingGalleryPage.cs b/Xamarin.Forms.Controls/ControlGalleryPages/AppearingGalleryPage.cs new file mode 100644 index 00000000..0df2eeb3 --- /dev/null +++ b/Xamarin.Forms.Controls/ControlGalleryPages/AppearingGalleryPage.cs @@ -0,0 +1,129 @@ +using System; + +using Xamarin.Forms; +using System.Diagnostics; +using System.Collections.Generic; + +namespace Xamarin.Forms.Controls +{ + public class AppearingGalleryPage : ContentPage + { + const string NavPageTitle = "NavAppearingPage"; + const string MasterPageTitle = "MasterAppearingPage"; + const string TabbedPageTitle = "TabbedAppearingPage"; + const string CarouselPageTitle = "CarouselAppearingPage"; + + public AppearingGalleryPage () + { + var initalPage = new AppearingPage (1); + var initalPage2 = new AppearingPage (2); + + Content = new StackLayout { + Children = { + new Button { Text = NavPageTitle, Command = new Command (() => { + Application.Current.MainPage = new NavAppearingPage(initalPage); + }) + }, + new Button { Text = MasterPageTitle, Command = new Command (() => { + var page = new MasterDetailPage { + Title = MasterPageTitle, + Master = new ContentPage { Title = "Master", BackgroundColor = Color.Red }, + Detail = new NavAppearingPage(initalPage) + }; + SetMainPage (page); + }) + }, + new Button { Text = TabbedPageTitle, Command = new Command (() => { + var page = new TabbedPage { + Title = TabbedPageTitle, + Children = { initalPage, initalPage2 } + }; + SetMainPage (page); + }) + }, + new Button { Text = CarouselPageTitle, Command = new Command (() => { + + var page = new CarouselPage { + Title = CarouselPageTitle, + Children = { initalPage, initalPage2 } + }; + SetMainPage (page); + }) + } + } + }; + } + + static void SetMainPage (Page page) + { + var tracker = new AppearingTracker (page); + Application.Current.MainPage = page; + } + + class AppearingTracker + { + int _isAppearingFired; + int _isDisappearingFired; + + public AppearingTracker (Page page) + { + page.Appearing += (object sender, EventArgs e) => { + _isAppearingFired++; + App.AppearingMessages.Add ($"Appearing {page.Title}"); + Debug.WriteLine ($"Appearing {page.Title}"); + }; + + page.Disappearing += (object sender, EventArgs e) => { + _isDisappearingFired++; + App.AppearingMessages.Add ($"Disappearing {page.Title}"); + Debug.WriteLine( $"Disappearing {page.Title}"); + }; + } + } + + class AppearingPage : ContentPage + { + int _theId; + ListView _listMessages; + public AppearingPage (int id) + { + var tracker = new AppearingTracker (this); + _listMessages = new ListView (); + _theId = id; + Title = $"Page {_theId}"; + Padding = new Thickness (20); + Content = new StackLayout { + Children = { + new Label { Text = $"Hello Appearing {_theId} page" }, + new Button { Text = "Push new Page", Command = new Command ( async () => { await Navigation.PushAsync( new AppearingPage(2)); }) }, + new Button { Text = "Pop page", Command = new Command ( async () => { await Navigation.PopAsync(); }) }, + new Button { Text = "Pop to root", Command = new Command ( async () => { await Navigation.PopToRootAsync(); }) }, + new Button { Text = "Change Main Page", Command = new Command ( () => { + App.AppearingMessages.Clear(); + Application.Current.MainPage = new AppearingPage(3); }) + }, + _listMessages + } + }; + } + protected override void OnAppearing () + { + base.OnAppearing (); + Device.StartTimer (new TimeSpan (200), () => { + _listMessages.ItemsSource = App.AppearingMessages; + return false; + }); + } + } + + class NavAppearingPage : NavigationPage + { + public NavAppearingPage (Page page) : base(page) + { + Title = NavPageTitle; + var tracker = new AppearingTracker (this); + } + } + } +} + diff --git a/Xamarin.Forms.Controls/ControlGalleryPages/AutomationIDGallery.cs b/Xamarin.Forms.Controls/ControlGalleryPages/AutomationIDGallery.cs new file mode 100644 index 00000000..c93a9b69 --- /dev/null +++ b/Xamarin.Forms.Controls/ControlGalleryPages/AutomationIDGallery.cs @@ -0,0 +1,104 @@ +using System; + +namespace Xamarin.Forms.Controls +{ + public class AutomationIdGallery : ContentPage + { + + public AutomationIdGallery () + { + var scrollView = new ScrollView { AutomationId = "scrollMain" }; + var rootLayout = new StackLayout { AutomationId = "stckMain" }; + + var btn = new Button { + AutomationId = "btnTest1", + Text = "Test1", + Command = new Command (async () => await Navigation.PushModalAsync (new TestPage1 ())) + }; + + var btn2 = new Button { + AutomationId = "btnTest2", + Text = "Test2", + Command = new Command (async () => await Navigation.PushModalAsync (new TestPage2 ())) + }; + + rootLayout.Children.Add (btn); + rootLayout.Children.Add (btn2); + + var toolBarItem = new ToolbarItem { AutomationId = "tbItemHello", Text= "Hello", Command = new Command(async ()=> { await DisplayAlert("Hello","","ok"); }) }; + var toolBarItem2 = new ToolbarItem { AutomationId = "tbItemHello2", Order= ToolbarItemOrder.Secondary, Text= "Hello2", Command = new Command(async ()=> { await DisplayAlert("Hello2","","ok"); }) }; + + ToolbarItems.Add (toolBarItem); + ToolbarItems.Add (toolBarItem2); + + scrollView.Content = rootLayout; + Content = scrollView; + } + + internal class TestPage1 : ContentPage + { + public TestPage1 () + { + var rootLayout = new StackLayout { AutomationId = "stckMain" }; + var btn = new Button { + AutomationId = "popModal", + Text = "Pop", + Command = new Command (async () => Navigation.PopModalAsync ()) + }; + rootLayout.Children.Add (btn); + rootLayout.Children.Add (new ActivityIndicator { AutomationId = "actHello", IsRunning = true }); + rootLayout.Children.Add (new BoxView { + AutomationId = "bxvHello", + WidthRequest = 40, + HeightRequest = 40, + BackgroundColor = Color.Red + }); + rootLayout.Children.Add (new Button { AutomationId = "btnHello", Text = "Hello" }); + rootLayout.Children.Add (new DatePicker { AutomationId = "dtPicker", Date = DateTime.Parse ("01/01/2014") }); + rootLayout.Children.Add (new TimePicker { AutomationId = "tPicker", Time = new TimeSpan (14, 45, 50) }); + rootLayout.Children.Add (new Label { AutomationId = "lblHello", Text = "Hello Label" }); + rootLayout.Children.Add (new Editor { AutomationId = "editorHello", Text = "Hello Editor" }); + rootLayout.Children.Add (new Entry { AutomationId = "entryHello", Text = "Hello Entry" }); + + Content = rootLayout; + } + } + + internal class TestPage2 : ContentPage + { + public TestPage2 () + { + var rootLayout = new StackLayout { AutomationId = "stckMain" }; + var btn = new Button { + AutomationId = "popModal", + Text = "Pop", + Command = new Command (async () => Navigation.PopModalAsync ()) + }; + rootLayout.Children.Add (btn); + rootLayout.Children.Add (new Image { AutomationId = "imgHello", Source = "menuIcon" }); + rootLayout.Children.Add (new ListView { + AutomationId = "lstView", + ItemsSource = new string[2] { "one", "two" }, + HeightRequest = 50 + }); + rootLayout.Children.Add (new Picker { AutomationId = "pickerHello", Items = { "one", "two" } }); + rootLayout.Children.Add (new ProgressBar { AutomationId = "progressHello", Progress = 2 }); + rootLayout.Children.Add (new SearchBar { AutomationId = "srbHello", Text = "Hello Search" }); + rootLayout.Children.Add (new Slider { AutomationId = "sliHello", Value = 0.5 }); + rootLayout.Children.Add (new Stepper { AutomationId = "stepperHello", Value = 5 }); + rootLayout.Children.Add (new Switch { AutomationId = "switchHello" }); + rootLayout.Children.Add (new WebView { + AutomationId = "webviewHello", + WidthRequest = 100, + HeightRequest = 50, + Source = new UrlWebViewSource { Url = "http://blog.xamarin.com/" } + }); + + Content = rootLayout; + } + } + + + } +} + diff --git a/Xamarin.Forms.Controls/ControlGalleryPages/BehaviorsAndTriggers.xaml b/Xamarin.Forms.Controls/ControlGalleryPages/BehaviorsAndTriggers.xaml new file mode 100644 index 00000000..accd9186 --- /dev/null +++ b/Xamarin.Forms.Controls/ControlGalleryPages/BehaviorsAndTriggers.xaml @@ -0,0 +1,37 @@ + + + + + \ No newline at end of file diff --git a/Xamarin.Forms.Controls/ControlGalleryPages/BehaviorsAndTriggers.xaml.cs b/Xamarin.Forms.Controls/ControlGalleryPages/BehaviorsAndTriggers.xaml.cs new file mode 100644 index 00000000..de9d4d2b --- /dev/null +++ b/Xamarin.Forms.Controls/ControlGalleryPages/BehaviorsAndTriggers.xaml.cs @@ -0,0 +1,75 @@ +using Xamarin.Forms; +using System; + +namespace Xamarin.Forms.Controls +{ + [Preserve (AllMembers = true)] + public partial class BehaviorsAndTriggers : ContentPage + { + public BehaviorsAndTriggers () + { + InitializeComponent (); + } + } + + [Preserve (AllMembers = true)] + public class Throb : TriggerAction + { + bool _horizontal; + + public Throb (bool horizontal) + { + _horizontal = horizontal; + } + + protected override async void Invoke (VisualElement sender) + { + for (var i=0;i<5;i++){ + await sender.TranslateTo (_horizontal ? -5:0,!_horizontal ? -5 : 0, 25); + await sender.TranslateTo (_horizontal ? 5:0,!_horizontal ? 5: 0, 25); + } + await sender.TranslateTo (0, 0, 25); + } + } + + [Preserve (AllMembers = true)] + public class HThrob : Throb + { + [Preserve] + public HThrob () + : base (true) + { + } + } + + [Preserve (AllMembers = true)] + public class VThrob : Throb + { + public VThrob () : base (false) + { + } + } + + [Preserve (AllMembers = true)] + public class StopItBehavior : Behavior