diff --git a/src/Sample/XFShimmerLayoutSample/XFShimmerLayoutPCLSample/App.xaml b/src/Sample/XFShimmerLayoutSample/XFShimmerLayoutPCLSample/App.xaml new file mode 100644 index 0000000..90013cf --- /dev/null +++ b/src/Sample/XFShimmerLayoutSample/XFShimmerLayoutPCLSample/App.xaml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/src/Sample/XFShimmerLayoutSample/XFShimmerLayoutPCLSample/App.xaml.cs b/src/Sample/XFShimmerLayoutSample/XFShimmerLayoutPCLSample/App.xaml.cs new file mode 100644 index 0000000..c2da10f --- /dev/null +++ b/src/Sample/XFShimmerLayoutSample/XFShimmerLayoutPCLSample/App.xaml.cs @@ -0,0 +1,19 @@ +using Xamarin.Essentials; +using Xamarin.Forms.Xaml; +using XFShimmerLayoutPCLSample.Controls; + +[assembly: XamlCompilation(XamlCompilationOptions.Compile)] +namespace XFShimmerLayoutPCLSample +{ + public partial class App + { + public App() + { + InitializeComponent(); + + ShimmerLayout.Init(DeviceDisplay.ScreenMetrics.Density); + + MainPage = new Views.ShimmerTestPage(); + } + } +} diff --git a/src/Sample/XFShimmerLayoutSample/XFShimmerLayoutPCLSample/Models/NotifyingObject.cs b/src/Sample/XFShimmerLayoutSample/XFShimmerLayoutPCLSample/Models/NotifyingObject.cs new file mode 100644 index 0000000..b07450a --- /dev/null +++ b/src/Sample/XFShimmerLayoutSample/XFShimmerLayoutPCLSample/Models/NotifyingObject.cs @@ -0,0 +1,29 @@ +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using Xamarin.Forms; + +namespace XFShimmerLayoutPCLSample.Models +{ + public class NotifyingObject : BindableObject + { + private readonly Dictionary _properties; + + public NotifyingObject() + { + _properties = new Dictionary(); + } + + #region [Notify Property Changed] + + protected virtual bool Set(ref T storage, T value, [CallerMemberName] string propertyName = null) + { + if (EqualityComparer.Default.Equals(storage, value)) return false; + + storage = value; + OnPropertyChanged(propertyName); + return true; + } + + #endregion + } +} diff --git a/src/Sample/XFShimmerLayoutSample/XFShimmerLayoutPCLSample/Properties/AssemblyInfo.cs b/src/Sample/XFShimmerLayoutSample/XFShimmerLayoutPCLSample/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..9074093 --- /dev/null +++ b/src/Sample/XFShimmerLayoutSample/XFShimmerLayoutPCLSample/Properties/AssemblyInfo.cs @@ -0,0 +1,26 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("XFShimmerLayoutPCLSample")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("${AuthorCopyright}")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.*")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] diff --git a/src/Sample/XFShimmerLayoutSample/XFShimmerLayoutPCLSample/ViewModels/ShimmerTestPageViewModel.cs b/src/Sample/XFShimmerLayoutSample/XFShimmerLayoutPCLSample/ViewModels/ShimmerTestPageViewModel.cs new file mode 100644 index 0000000..565a824 --- /dev/null +++ b/src/Sample/XFShimmerLayoutSample/XFShimmerLayoutPCLSample/ViewModels/ShimmerTestPageViewModel.cs @@ -0,0 +1,35 @@ +using System.Threading.Tasks; +using Xamarin.Forms; +using XFShimmerLayoutPCLSample.Models; + +namespace XFShimmerLayoutPCLSample.ViewModels +{ + public class ShimmerTestPageViewModel : NotifyingObject + { + private bool _isBusy; + public bool IsBusy + { + get => _isBusy; + set => Set(ref _isBusy, value); + } + + private Command _startAnimationCommand; + public Command StartAnimationCommand + { + get => _startAnimationCommand; + set => Set(ref _startAnimationCommand, value); + } + + public ShimmerTestPageViewModel() + { + StartAnimationCommand = new Command(async () => + { + IsBusy = true; + + await Task.Delay(5000); + + IsBusy = false; + }); + } + } +} diff --git a/src/Sample/XFShimmerLayoutSample/XFShimmerLayoutPCLSample/Views/ShimmerTestPage.xaml b/src/Sample/XFShimmerLayoutSample/XFShimmerLayoutPCLSample/Views/ShimmerTestPage.xaml new file mode 100644 index 0000000..8033ed6 --- /dev/null +++ b/src/Sample/XFShimmerLayoutSample/XFShimmerLayoutPCLSample/Views/ShimmerTestPage.xaml @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +