diff --git a/MAUI/Accordion/SampleBrowser.Maui.Accordion/AccordionSamplesList.xml b/MAUI/Accordion/SampleBrowser.Maui.Accordion/AccordionSamplesList.xml index 2dc2218e..f4958b0f 100644 --- a/MAUI/Accordion/SampleBrowser.Maui.Accordion/AccordionSamplesList.xml +++ b/MAUI/Accordion/SampleBrowser.Maui.Accordion/AccordionSamplesList.xml @@ -1,7 +1,7 @@ - + diff --git a/MAUI/Accordion/SampleBrowser.Maui.Accordion/SampleBrowser.Maui.Accordion.csproj b/MAUI/Accordion/SampleBrowser.Maui.Accordion/SampleBrowser.Maui.Accordion.csproj index 878f16a6..487bc873 100644 --- a/MAUI/Accordion/SampleBrowser.Maui.Accordion/SampleBrowser.Maui.Accordion.csproj +++ b/MAUI/Accordion/SampleBrowser.Maui.Accordion/SampleBrowser.Maui.Accordion.csproj @@ -4,7 +4,7 @@ net6.0-android;net6.0-ios;net6.0-maccatalyst $(TargetFrameworks);net6.0-windows10.0.19041.0 - + Exe SampleBrowser.Maui.Accordion true @@ -85,10 +85,10 @@ - - - - + + + + diff --git a/MAUI/Accordion/SampleBrowser.Maui.Accordion/SampleBrowser.Maui.Accordion.nuspec b/MAUI/Accordion/SampleBrowser.Maui.Accordion/SampleBrowser.Maui.Accordion.nuspec index ffd5d983..06cf6f08 100644 --- a/MAUI/Accordion/SampleBrowser.Maui.Accordion/SampleBrowser.Maui.Accordion.nuspec +++ b/MAUI/Accordion/SampleBrowser.Maui.Accordion/SampleBrowser.Maui.Accordion.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png Accordion component for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MAUI/AvatarView/SampleBrowser.Maui.AvatarView/SampleBrowser.Maui.AvatarView.csproj b/MAUI/AvatarView/SampleBrowser.Maui.AvatarView/SampleBrowser.Maui.AvatarView.csproj index f4279b93..6df12ca2 100644 --- a/MAUI/AvatarView/SampleBrowser.Maui.AvatarView/SampleBrowser.Maui.AvatarView.csproj +++ b/MAUI/AvatarView/SampleBrowser.Maui.AvatarView/SampleBrowser.Maui.AvatarView.csproj @@ -1,4 +1,4 @@ - + net6.0-android;net6.0-ios;net6.0-maccatalyst @@ -79,9 +79,9 @@ - - - + + + diff --git a/MAUI/AvatarView/SampleBrowser.Maui.AvatarView/SampleBrowser.Maui.AvatarView.nuspec b/MAUI/AvatarView/SampleBrowser.Maui.AvatarView/SampleBrowser.Maui.AvatarView.nuspec index e85f06e3..654b1321 100644 --- a/MAUI/AvatarView/SampleBrowser.Maui.AvatarView/SampleBrowser.Maui.AvatarView.nuspec +++ b/MAUI/AvatarView/SampleBrowser.Maui.AvatarView/SampleBrowser.Maui.AvatarView.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png AvatarView component for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MAUI/AvatarView/SampleBrowser.Maui.AvatarView/Samples/AvatarView/AvatarViewGettingStarted/AvatarViewGettingStarted.xaml b/MAUI/AvatarView/SampleBrowser.Maui.AvatarView/Samples/AvatarView/AvatarViewGettingStarted/AvatarViewGettingStarted.xaml index 0871d8c4..5ead510d 100644 --- a/MAUI/AvatarView/SampleBrowser.Maui.AvatarView/Samples/AvatarView/AvatarViewGettingStarted/AvatarViewGettingStarted.xaml +++ b/MAUI/AvatarView/SampleBrowser.Maui.AvatarView/Samples/AvatarView/AvatarViewGettingStarted/AvatarViewGettingStarted.xaml @@ -102,10 +102,10 @@ - + - + diff --git a/MAUI/Backdrop/SampleBrowser.Maui.Backdrop/SampleBrowser.Maui.Backdrop.csproj b/MAUI/Backdrop/SampleBrowser.Maui.Backdrop/SampleBrowser.Maui.Backdrop.csproj index 362daf9c..73436ea0 100644 --- a/MAUI/Backdrop/SampleBrowser.Maui.Backdrop/SampleBrowser.Maui.Backdrop.csproj +++ b/MAUI/Backdrop/SampleBrowser.Maui.Backdrop/SampleBrowser.Maui.Backdrop.csproj @@ -74,10 +74,10 @@ - - - - - + + + + + diff --git a/MAUI/Backdrop/SampleBrowser.Maui.Backdrop/SampleBrowser.Maui.Backdrop.nuspec b/MAUI/Backdrop/SampleBrowser.Maui.Backdrop/SampleBrowser.Maui.Backdrop.nuspec index 700b4e37..802da20d 100644 --- a/MAUI/Backdrop/SampleBrowser.Maui.Backdrop/SampleBrowser.Maui.Backdrop.nuspec +++ b/MAUI/Backdrop/SampleBrowser.Maui.Backdrop/SampleBrowser.Maui.Backdrop.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png Backdrop page for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MAUI/BadgeView/SampleBrowser.Maui.BadgeView/SampleBrowser.Maui.BadgeView.csproj b/MAUI/BadgeView/SampleBrowser.Maui.BadgeView/SampleBrowser.Maui.BadgeView.csproj index e4085293..bfff1ddd 100644 --- a/MAUI/BadgeView/SampleBrowser.Maui.BadgeView/SampleBrowser.Maui.BadgeView.csproj +++ b/MAUI/BadgeView/SampleBrowser.Maui.BadgeView/SampleBrowser.Maui.BadgeView.csproj @@ -1,4 +1,4 @@ - + net6.0-android;net6.0-ios;net6.0-maccatalyst @@ -75,9 +75,9 @@ - - - + + + diff --git a/MAUI/BadgeView/SampleBrowser.Maui.BadgeView/SampleBrowser.Maui.BadgeView.nuspec b/MAUI/BadgeView/SampleBrowser.Maui.BadgeView/SampleBrowser.Maui.BadgeView.nuspec index 5faf64d6..397f9fe4 100644 --- a/MAUI/BadgeView/SampleBrowser.Maui.BadgeView/SampleBrowser.Maui.BadgeView.nuspec +++ b/MAUI/BadgeView/SampleBrowser.Maui.BadgeView/SampleBrowser.Maui.BadgeView.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png BadgeView component for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MAUI/BadgeView/SampleBrowser.Maui.BadgeView/Samples/BadgeView/Customization/Font.xaml b/MAUI/BadgeView/SampleBrowser.Maui.BadgeView/Samples/BadgeView/Customization/Font.xaml index 50c6af63..f6cbdfe8 100644 --- a/MAUI/BadgeView/SampleBrowser.Maui.BadgeView/Samples/BadgeView/Customization/Font.xaml +++ b/MAUI/BadgeView/SampleBrowser.Maui.BadgeView/Samples/BadgeView/Customization/Font.xaml @@ -16,7 +16,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/Customizations/View/CustomizationsDesktop.xaml.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/Customizations/View/CustomizationsDesktop.xaml.cs new file mode 100644 index 00000000..8177578b --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/Customizations/View/CustomizationsDesktop.xaml.cs @@ -0,0 +1,96 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; +using SampleBrowser.Maui.Buttons.Button; + +namespace SampleBrowser.Maui.Buttons.Button; + +public partial class CustomizationsDesktop : SampleView +{ + ViewModel viewModel; + public CustomizationsDesktop() + { + InitializeComponent(); + viewModel = new ViewModel(); + this.BindingContext = viewModel; + } + private void TextColorSegment_Clicked(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#E5E4E2"); + } + + private void TextColorSegment_Clicked_1(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#c6c6c6"); + } + + private void TextColorSegment_Clicked_2(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#538eed"); + } + + private void TextColorSegment_Clicked_3(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#af2463"); + } + + private void TextColorSegment_Clicked_4(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#000000"); + + } + private void BackgroundColorSegment_Clicked(object sender, EventArgs e) + { + cartButton.Background = Color.FromArgb("#E5E4E2"); + } + + private void BackgroundColorSegment_Clicked_1(object sender, EventArgs e) + { + cartButton.Background = Color.FromArgb("#c6c6c6"); + } + + private void BackgroundColorSegment_Clicked_2(object sender, EventArgs e) + { + cartButton.Background = Color.FromArgb("#538eed"); + } + + private void BackgroundColorSegment_Clicked_3(object sender, EventArgs e) + { + cartButton.Background = Color.FromArgb("#af2463"); + } + + private void BackgroundColorSegment_Clicked_4(object sender, EventArgs e) + { + cartButton.Background = Color.FromArgb("#000000"); + } + + private void BorderColorSegment_Clicked(object sender, EventArgs e) + { + + cartButton.Stroke = Color.FromArgb("#E5E4E2"); + } + private void BorderColorSegment_Clicked_1(object sender, EventArgs e) + { + cartButton.Stroke = Color.FromArgb("#c6c6c6"); + } + + private void BorderColorSegment_Clicked_2(object sender, EventArgs e) + { + cartButton.Stroke = Color.FromArgb("#538eed"); + } + + private void BorderColorSegment_Clicked_3(object sender, EventArgs e) + { + cartButton.Stroke = Color.FromArgb("#af2463"); + } + + private void BorderColorSegment_Clicked_4(object sender, EventArgs e) + { + cartButton.Stroke = Color.FromArgb("#000000"); + } +} \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/Customizations/View/CustomizationsMobile.xaml b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/Customizations/View/CustomizationsMobile.xaml new file mode 100644 index 00000000..2f89f6d6 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/Customizations/View/CustomizationsMobile.xaml @@ -0,0 +1,330 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/Customizations/View/CustomizationsMobile.xaml.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/Customizations/View/CustomizationsMobile.xaml.cs new file mode 100644 index 00000000..2ee93dbc --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/Customizations/View/CustomizationsMobile.xaml.cs @@ -0,0 +1,97 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; +using SampleBrowser.Maui.Buttons.Button; + +namespace SampleBrowser.Maui.Buttons.Button; + +public partial class CustomizationsMobile : SampleView +{ + ViewModel viewModel; + + public CustomizationsMobile() + { + InitializeComponent(); + viewModel = new ViewModel(); + this.BindingContext = viewModel; + } + private void TextColorSegment_Clicked(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#E5E4E2"); + } + + private void TextColorSegment_Clicked_1(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#c6c6c6"); + } + + private void TextColorSegment_Clicked_2(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#538eed"); + } + + private void TextColorSegment_Clicked_3(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#af2463"); + } + + private void TextColorSegment_Clicked_4(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#000000"); + + } + private void BackgroundColorSegment_Clicked(object sender, EventArgs e) + { + cartButton.Background = Color.FromArgb("#E5E4E2"); + } + + private void BackgroundColorSegment_Clicked_1(object sender, EventArgs e) + { + cartButton.Background = Color.FromArgb("#c6c6c6"); + } + + private void BackgroundColorSegment_Clicked_2(object sender, EventArgs e) + { + cartButton.Background = Color.FromArgb("#538eed"); + } + + private void BackgroundColorSegment_Clicked_3(object sender, EventArgs e) + { + cartButton.Background = Color.FromArgb("#af2463"); + } + + private void BackgroundColorSegment_Clicked_4(object sender, EventArgs e) + { + cartButton.Background = Color.FromArgb("#000000"); + } + + private void BorderColorSegment_Clicked(object sender, EventArgs e) + { + + cartButton.Stroke = Color.FromArgb("#E5E4E2"); + } + private void BorderColorSegment_Clicked_1(object sender, EventArgs e) + { + cartButton.Stroke = Color.FromArgb("#c6c6c6"); + } + + private void BorderColorSegment_Clicked_2(object sender, EventArgs e) + { + cartButton.Stroke = Color.FromArgb("#538eed"); + } + + private void BorderColorSegment_Clicked_3(object sender, EventArgs e) + { + cartButton.Stroke = Color.FromArgb("#af2463"); + } + + private void BorderColorSegment_Clicked_4(object sender, EventArgs e) + { + cartButton.Stroke = Color.FromArgb("#000000"); + } +} \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/Customizations/ViewModel/ViewModel.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/Customizations/ViewModel/ViewModel.cs new file mode 100644 index 00000000..540f459c --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/Customizations/ViewModel/ViewModel.cs @@ -0,0 +1,383 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Syncfusion.Maui.Buttons; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; +using SampleBrowser.Maui.Base.Converters; +using System.Reflection; + +namespace SampleBrowser.Maui.Buttons.Button; + +public class ViewModel : INotifyPropertyChanged +{ + + #region Fields + /// + /// The background image of button + /// + public ImageSource? backgroundImage; + + /// + /// The border color of button. + /// + private Color borderColor = Colors.Black; + + /// + /// The background color of button. + /// + + private Color backgroundColor = Colors.DarkRed; + /// + /// Represents the text color + /// + private Color textColor = Colors.White; + + /// + /// Represents the visibility of image + /// + private bool showImage = true; + + /// + /// The corner radius slider. + /// +#if ANDROID || IOS + private int rightSlider = 8; +#elif WINDOWS || MACCATALYST + private int rightSlider = 8; +#endif + + /// + /// The corner radius of button. + /// +#if ANDROID || IOS + private CornerRadius cornerRadius = 8; +#elif WINDOWS || MACCATALYST + private CornerRadius cornerRadius = 8; +#endif + + /// + /// The default corner radius. + /// +#if ANDROID || IOS + private int leftSlider = 8; +#elif WINDOWS || MACCATALYST + private int leftSlider = 8; +#endif + + /// + /// Represents the border width + /// + private int borderWidth = 1; + + /// + /// The text of button. + /// + private string text = "ADD TO CART"; + + /// + /// The can show background image + /// + private bool canShowBackgroundImage = false; + + /// + /// Represents the enable or disable the shadow + /// + private bool enableShadow; + #endregion + + #region Property + + + /// + /// Gets or sets the color of the border of button. + /// + /// The color of the border of button. + public Color BorderColor + { + get + { + return borderColor; + } + + set + { + borderColor = value; + OnPropertyChanged("BorderColor"); + } + } + + /// + /// Gets or Sets the text color + /// + public Color TextColor + { + get + { + return textColor; + } + + set + { + textColor = value; + OnPropertyChanged("TextColor"); + } + } + + /// + /// Gets or sets the background color of button. + /// + /// The background color of button + [Obsolete] + public Color BackgroundColor + { + get + { + return backgroundColor; + } + set + { + backgroundColor = value; + OnPropertyChanged("BackgroundColor"); + } + } + + /// + /// Gets or sets the slider value. + /// + /// The slider value. +#if ANDROID || IOS + public int RightCornerRadius + { + get + { + return rightSlider; + } + set + { + rightSlider = value; + CornerRadius = new CornerRadius(cornerRadius.TopLeft, value, value, cornerRadius.BottomRight); + OnPropertyChanged("RightCornerRadius"); + } + } +#elif WINDOWS || MACCATALYST + public int RightCornerRadius + { + get + { + return rightSlider; + } + set + { + rightSlider = value; + CornerRadius = new CornerRadius(cornerRadius.TopLeft, value, value, cornerRadius.BottomRight); + OnPropertyChanged("RightCornerRadius"); + } + } +#endif + /// + /// Gets or sets the slider value. + /// + /// The slider value. +#if ANDROID || IOS + public int LeftCornerRadius + { + get + { + return leftSlider; + } + set + { + leftSlider = value; + CornerRadius = new CornerRadius(value, cornerRadius.TopRight, cornerRadius.BottomLeft, value); + OnPropertyChanged("LeftCornerRadius"); + } + } +#elif MACCATALYST || WINDOWS + public int LeftCornerRadius + { + get + { + return leftSlider; + } + set + { + leftSlider = value; + CornerRadius = new CornerRadius(value, cornerRadius.TopRight, cornerRadius.BottomLeft, value); + OnPropertyChanged("LeftCornerRadius"); + } + } +#endif + + /// + /// Gets or sets the border width. + /// + public int BorderWidth + { + get + { + return borderWidth; + } + set + { + borderWidth = value; + OnPropertyChanged("BorderWidth"); + } + } + + + /// + /// Gets or sets the corner radius. + /// + /// The corner radius. +#if ANDROID || IOS + public CornerRadius CornerRadius + { + get + { + return cornerRadius; + } + set + { + + cornerRadius = value; + OnPropertyChanged("CornerRadius"); + } + } +#elif WINDOWS || MACCATALYST + public CornerRadius CornerRadius + { + get + { + return cornerRadius; + } + set + { + + cornerRadius = value; + OnPropertyChanged("CornerRadius"); + } + } +#endif + + + /// + /// Gets or Sets the image visibility + /// + public bool ShowImage + { + get + { + return showImage; + } + set + { + showImage = value; + + OnPropertyChanged("ShowImage"); + } + } + + + /// + /// Gets or sets the text. + /// + /// The text. + public string Text + { + get + { + return text; + } + set + { + text = value; + OnPropertyChanged("Text"); + } + } + + /// + /// Gets or sets a value indicating whether this is enable stack. + /// + /// true if is enable stack; otherwise, false. + public bool CanShowBackgroundImage + { + get + { + return canShowBackgroundImage; + } + set + { + canShowBackgroundImage = value; + if (value) + { + var ResourceAssembly = typeof(SfImageResourceExtension).GetTypeInfo().Assembly; + BackgroundImage = ImageSource.FromResource("SampleBrowser.Maui.Base.Resources.Images.april.png", ResourceAssembly); + } + else + { + BackgroundImage = null; + } + OnPropertyChanged("CanShowBackgroundImage"); + OnPropertyChanged("BackgroundImage"); + } + } + + /// + /// Source for transparent background + /// + public ImageSource? BackgroundImage + { + get + { + + return backgroundImage; + } + set + { + backgroundImage=value; + OnPropertyChanged("BackgroundImage"); + } + } + + /// + /// Gets or sets whether shadow enable or disable + /// + public bool EnableShadow + { + get + { + return enableShadow; + } + set + { + enableShadow = value; + OnPropertyChanged("EnableShadow"); + } + } + + #endregion + + #region Property changed method + + /// + /// Occurs when property changed. + /// + public event PropertyChangedEventHandler? PropertyChanged; + + + public void OnPropertyChanged([CallerMemberName] string? name = null) => + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + + #endregion +} diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/GettingStarted/GettingStarted.xaml b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/GettingStarted/GettingStarted.xaml new file mode 100644 index 00000000..8c342582 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/GettingStarted/GettingStarted.xaml @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/GettingStarted/GettingStarted.xaml.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/GettingStarted/GettingStarted.xaml.cs new file mode 100644 index 00000000..aeb4b2cb --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/GettingStarted/GettingStarted.xaml.cs @@ -0,0 +1,25 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; + +namespace SampleBrowser.Maui.Buttons.Button +{ + public partial class GettingStarted : SampleView + { + public GettingStarted() + { + InitializeComponent(); +#if ANDROID || IOS + this.Content = new GettingStartedMobile(); +#elif WINDOWS || MACCATALYST + this.Content = new GettingStartedDesktop(); +#endif + } + + } +} diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/GettingStarted/GettingStartedDesktop.xaml b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/GettingStarted/GettingStartedDesktop.xaml new file mode 100644 index 00000000..0f613ad2 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/GettingStarted/GettingStartedDesktop.xaml @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/GettingStarted/GettingStartedDesktop.xaml.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/GettingStarted/GettingStartedDesktop.xaml.cs new file mode 100644 index 00000000..d7b0a4f4 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/GettingStarted/GettingStartedDesktop.xaml.cs @@ -0,0 +1,17 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; + +namespace SampleBrowser.Maui.Buttons.Button; +public partial class GettingStartedDesktop : SampleView +{ + public GettingStartedDesktop() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/GettingStarted/GettingStartedMobile.xaml b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/GettingStarted/GettingStartedMobile.xaml new file mode 100644 index 00000000..12f006e9 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/GettingStarted/GettingStartedMobile.xaml @@ -0,0 +1,240 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/GettingStarted/GettingStartedMobile.xaml.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/GettingStarted/GettingStartedMobile.xaml.cs new file mode 100644 index 00000000..24e826cb --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/Button/GettingStarted/GettingStartedMobile.xaml.cs @@ -0,0 +1,19 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; + +namespace SampleBrowser.Maui.Buttons.Button; + +public partial class GettingStartedMobile : SampleView +{ + public GettingStartedMobile() + { + InitializeComponent(); + + } +} \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/Customizations/View/Customizations.xaml b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/Customizations/View/Customizations.xaml new file mode 100644 index 00000000..322c50c3 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/Customizations/View/Customizations.xaml @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/Customizations/View/Customizations.xaml.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/Customizations/View/Customizations.xaml.cs new file mode 100644 index 00000000..9bdc7772 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/Customizations/View/Customizations.xaml.cs @@ -0,0 +1,23 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; + +namespace SampleBrowser.Maui.Buttons.CheckBox; + +public partial class Customizations : SampleView +{ + public Customizations() + { + InitializeComponent(); +#if ANDROID || IOS + this.Content = new CustomizationsMobile(); +#else + this.Content = new CustomizationsDesktop(); +#endif + } +} \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/Customizations/View/CustomizationsDesktop.xaml b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/Customizations/View/CustomizationsDesktop.xaml new file mode 100644 index 00000000..aaa343bc --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/Customizations/View/CustomizationsDesktop.xaml @@ -0,0 +1,257 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/Customizations/View/CustomizationsDesktop.xaml.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/Customizations/View/CustomizationsDesktop.xaml.cs new file mode 100644 index 00000000..10686969 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/Customizations/View/CustomizationsDesktop.xaml.cs @@ -0,0 +1,96 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; +using SampleBrowser.Maui.Buttons.CheckBox; + +namespace SampleBrowser.Maui.Buttons.CheckBox; + +public partial class CustomizationsDesktop : SampleView +{ + ViewModel viewModel; + public CustomizationsDesktop() + { + InitializeComponent(); + viewModel = new ViewModel(); + this.BindingContext = viewModel; + } + private void TextColorSegment_Clicked(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#E5E4E2"); + } + + private void TextColorSegment_Clicked_1(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#c6c6c6"); + } + + private void TextColorSegment_Clicked_2(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#538eed"); + } + + private void TextColorSegment_Clicked_3(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#af2463"); + } + + private void TextColorSegment_Clicked_4(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#000000"); + + } + private void CheckedColorSegment_Clicked(object sender, EventArgs e) + { + checkBox.CheckedColor = Color.FromArgb("#E5E4E2"); + } + + private void CheckedColorSegment_Clicked_1(object sender, EventArgs e) + { + checkBox.CheckedColor = Color.FromArgb("#c6c6c6"); + } + + private void CheckedColorSegment_Clicked_2(object sender, EventArgs e) + { + checkBox.CheckedColor = Color.FromArgb("#538eed"); + } + + private void CheckedColorSegment_Clicked_3(object sender, EventArgs e) + { + checkBox.CheckedColor = Color.FromArgb("#af2463"); + } + + private void CheckedColorSegment_Clicked_4(object sender, EventArgs e) + { + checkBox.CheckedColor = Color.FromArgb("#000000"); + } + + private void UncheckedColorSegment_Clicked(object sender, EventArgs e) + { + + checkBox.UncheckedColor = Color.FromArgb("#E5E4E2"); + } + private void UncheckedColorSegment_Clicked_1(object sender, EventArgs e) + { + checkBox.UncheckedColor = Color.FromArgb("#c6c6c6"); + } + + private void UncheckedColorSegment_Clicked_2(object sender, EventArgs e) + { + checkBox.UncheckedColor = Color.FromArgb("#538eed"); + } + + private void UncheckedColorSegment_Clicked_3(object sender, EventArgs e) + { + checkBox.UncheckedColor = Color.FromArgb("#af2463"); + } + + private void UncheckedColorSegment_Clicked_4(object sender, EventArgs e) + { + checkBox.UncheckedColor = Color.FromArgb("#000000"); + } +} \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/Customizations/View/CustomizationsMobile.xaml b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/Customizations/View/CustomizationsMobile.xaml new file mode 100644 index 00000000..5a9bec14 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/Customizations/View/CustomizationsMobile.xaml @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/Customizations/View/CustomizationsMobile.xaml.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/Customizations/View/CustomizationsMobile.xaml.cs new file mode 100644 index 00000000..18b3816a --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/Customizations/View/CustomizationsMobile.xaml.cs @@ -0,0 +1,97 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; +using SampleBrowser.Maui.Buttons.RadioButton; + +namespace SampleBrowser.Maui.Buttons.CheckBox; + +public partial class CustomizationsMobile : SampleView +{ + ViewModel viewModel; + + public CustomizationsMobile() + { + InitializeComponent(); + viewModel = new ViewModel(); + this.BindingContext = viewModel; + } + private void TextColorSegment_Clicked(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#E5E4E2"); + } + + private void TextColorSegment_Clicked_1(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#c6c6c6"); + } + + private void TextColorSegment_Clicked_2(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#538eed"); + } + + private void TextColorSegment_Clicked_3(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#af2463"); + } + + private void TextColorSegment_Clicked_4(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#000000"); + + } + private void CheckedColorSegment_Clicked(object sender, EventArgs e) + { + checkBox.CheckedColor = Color.FromArgb("#E5E4E2"); + } + + private void CheckedColorSegment_Clicked_1(object sender, EventArgs e) + { + checkBox.CheckedColor = Color.FromArgb("#c6c6c6"); + } + + private void CheckedColorSegment_Clicked_2(object sender, EventArgs e) + { + checkBox.CheckedColor = Color.FromArgb("#538eed"); + } + + private void CheckedColorSegment_Clicked_3(object sender, EventArgs e) + { + checkBox.CheckedColor = Color.FromArgb("#af2463"); + } + + private void CheckedColorSegment_Clicked_4(object sender, EventArgs e) + { + checkBox.CheckedColor = Color.FromArgb("#000000"); + } + + private void UnCheckedColorSegment_Clicked(object sender, EventArgs e) + { + + checkBox.UncheckedColor = Color.FromArgb("#E5E4E2"); + } + private void UnCheckedColorSegment_Clicked_1(object sender, EventArgs e) + { + checkBox.UncheckedColor = Color.FromArgb("#c6c6c6"); + } + + private void UnCheckedColorSegment_Clicked_2(object sender, EventArgs e) + { + checkBox.UncheckedColor = Color.FromArgb("#538eed"); + } + + private void UnCheckedColorSegment_Clicked_3(object sender, EventArgs e) + { + checkBox.UncheckedColor = Color.FromArgb("#af2463"); + } + + private void UnCheckedColorSegment_Clicked_4(object sender, EventArgs e) + { + checkBox.UncheckedColor = Color.FromArgb("#000000"); + } +} \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/Customizations/ViewModel/ViewModel.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/Customizations/ViewModel/ViewModel.cs new file mode 100644 index 00000000..876c0263 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/Customizations/ViewModel/ViewModel.cs @@ -0,0 +1,178 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Syncfusion.Maui.Buttons; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; +using SampleBrowser.Maui.Base.Converters; +using System.Reflection; + +namespace SampleBrowser.Maui.Buttons.CheckBox; + +public class ViewModel : INotifyPropertyChanged +{ + + #region Fields + + /// + /// Represents the text color + /// + private Color textColor = Colors.Black; + + /// + /// The corner radius of button. + /// + private CornerRadius cornerRadius = 50; + + /// + /// Represents the border width + /// + private int radius = 1; + + /// + /// The text of button. + /// + private string text = "CheckBox"; + + /// + /// The can show background image + /// + private bool ischecked = false; + + /// + /// Represents the enable or disable the shadow + /// + private bool isThreestate; + #endregion + + #region Property + + /// + /// Gets or Sets the text color + /// + public Color TextColor + { + get + { + return textColor; + } + + set + { + textColor = value; + OnPropertyChanged("TextColor"); + } + } + + /// + /// Gets or sets the border width. + /// + public int Radius + { + get + { + return radius; + } + set + { + radius = value; + CornerRadius = new CornerRadius(value, value, value, value); + OnPropertyChanged("Radius"); + } + } + + + /// + /// Gets or sets the corner radius. + /// + /// The corner radius. + public CornerRadius CornerRadius + { + get + { + return cornerRadius; + } + set + { + + cornerRadius = value; + OnPropertyChanged("CornerRadius"); + } + } + + + /// + /// Gets or sets the text. + /// + /// The text. + public string Text + { + get + { + return text; + } + set + { + text = value; + OnPropertyChanged("Text"); + } + } + + /// + /// Gets or sets a value indicating whether this is enable stack. + /// + /// true if is enable stack; otherwise, false. + public bool IsChecked + { + get + { + return ischecked; + } + set + { + ischecked = value; + OnPropertyChanged("IsChecked"); + } + } + + /// + /// Gets or sets whether shadow enable or disable + /// + public bool IsThreeState + { + get + { + return isThreestate; + } + set + { + isThreestate = value; + OnPropertyChanged("IsThreeState"); + } + } + + #endregion + + #region Property changed method + + /// + /// Occurs when property changed. + /// + public event PropertyChangedEventHandler? PropertyChanged; + + + public void OnPropertyChanged([CallerMemberName] string? name = null) => + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + + #endregion +} diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/GettingStarted/GettingStarted.xaml b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/GettingStarted/GettingStarted.xaml new file mode 100644 index 00000000..b6376e7c --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/GettingStarted/GettingStarted.xaml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/GettingStarted/GettingStarted.xaml.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/GettingStarted/GettingStarted.xaml.cs new file mode 100644 index 00000000..de1d808e --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/GettingStarted/GettingStarted.xaml.cs @@ -0,0 +1,33 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; + +namespace SampleBrowser.Maui.Buttons.CheckBox; + +public partial class GettingStarted : SampleView +{ +#if ANDROID || IOS + GettingStartedMobile gettingStartedMobile; +#else + GettingStartedDesktop gettingStartedDesktop; +#endif + public GettingStarted() + { + InitializeComponent(); +#if ANDROID || IOS + gettingStartedMobile = new GettingStartedMobile(); + this.Content = gettingStartedMobile.Content; + this.OptionView = gettingStartedMobile.OptionView; +#else + gettingStartedDesktop = new GettingStartedDesktop(); + this.Content = gettingStartedDesktop.Content; + this.OptionView = gettingStartedDesktop.OptionView; + this.WidthRequest = gettingStartedDesktop.WidthRequest; +#endif + } +} \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/GettingStarted/GettingStartedDesktop.xaml b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/GettingStarted/GettingStartedDesktop.xaml new file mode 100644 index 00000000..449791bd --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/GettingStarted/GettingStartedDesktop.xaml @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/GettingStarted/GettingStartedDesktop.xaml.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/GettingStarted/GettingStartedDesktop.xaml.cs new file mode 100644 index 00000000..de337a78 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/GettingStarted/GettingStartedDesktop.xaml.cs @@ -0,0 +1,63 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; +using SampleBrowser.Maui.Buttons.CheckBox; +using SampleBrowser.Maui.Buttons.Samples.CheckBox; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Runtime.CompilerServices; + +namespace SampleBrowser.Maui.Buttons.CheckBox; + +public partial class GettingStartedDesktop : SampleView +{ + public GettingStartedDesktop() + { + InitializeComponent(); + } + + private void TapGestureRecognizer_Tapped(object sender, EventArgs e) + { + if (brown.IsChecked == true) + brown.IsChecked = false; + else + brown.IsChecked = true; + } + + private void TapGestureRecognizer_Tapped_1(object sender, EventArgs e) + { + if (green.IsChecked == true) + green.IsChecked = false; + else + green.IsChecked = true; + } + + private void TapGestureRecognizer_Tapped_2(object sender, EventArgs e) + { + if (red.IsChecked == true) + red.IsChecked = false; + else + red.IsChecked = true; + } + + private void TapGestureRecognizer_Tapped_3(object sender, EventArgs e) + { + if (sandal.IsChecked == true) + sandal.IsChecked = false; + else + sandal.IsChecked = true; + } + + private void TapGestureRecognizer_Tapped_4(object sender, EventArgs e) + { + if (violet.IsChecked == true) + violet.IsChecked = false; + else + violet.IsChecked = true; + } +} diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/GettingStarted/GettingStartedMobile.xaml b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/GettingStarted/GettingStartedMobile.xaml new file mode 100644 index 00000000..54872086 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/GettingStarted/GettingStartedMobile.xaml @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/GettingStarted/GettingStartedMobile.xaml.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/GettingStarted/GettingStartedMobile.xaml.cs new file mode 100644 index 00000000..9d1f2c88 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/GettingStarted/GettingStartedMobile.xaml.cs @@ -0,0 +1,50 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; + +namespace SampleBrowser.Maui.Buttons.CheckBox; + +public partial class GettingStartedMobile : SampleView +{ + public GettingStartedMobile() + { + InitializeComponent(); + } + + private void TapGestureRecognizer_Tapped(object sender, EventArgs e) + { + if (brown.IsChecked == true) + brown.IsChecked = false; + else + brown.IsChecked = true; + } + + private void TapGestureRecognizer_Tapped_1(object sender, EventArgs e) + { + if(green.IsChecked == true) + green.IsChecked = false; + else + green.IsChecked = true; + } + + private void TapGestureRecognizer_Tapped_2(object sender, EventArgs e) + { + if(red.IsChecked == true) + red.IsChecked = false; + else + red.IsChecked = true; + } + + private void TapGestureRecognizer_Tapped_3(object sender, EventArgs e) + { + if(sandal.IsChecked == true) + sandal.IsChecked = false; + else + sandal.IsChecked = true; + } +} \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/GettingStarted/ViewModel/GettingStartedViewModel.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/GettingStarted/ViewModel/GettingStartedViewModel.cs new file mode 100644 index 00000000..6c96ec59 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/CheckBox/GettingStarted/ViewModel/GettingStartedViewModel.cs @@ -0,0 +1,438 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Syncfusion.Maui.DataSource.Extensions; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace SampleBrowser.Maui.Buttons.Samples.CheckBox; + +public class GettingStartedViewModel : INotifyPropertyChanged +{ + public event PropertyChangedEventHandler? PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + #region Properties + + private bool brandFilterChecked1; + public bool BrandFilterChecked1 + { + get { return brandFilterChecked1; } + set + { + if (brandFilterChecked1 != value) + { + brandFilterChecked1 = value; + OnPropertyChanged(nameof(BrandFilterChecked1)); + UpdateFilteredProducts(); + } + } + } + + private bool brandFilterChecked2 = true; + public bool BrandFilterChecked2 + { + get { return brandFilterChecked2; } + set + { + if (brandFilterChecked2 != value) + { + brandFilterChecked2 = value; + OnPropertyChanged(nameof(BrandFilterChecked2)); + UpdateFilteredProducts(); + } + } + } + + private bool brandFilterChecked3 = true; + public bool BrandFilterChecked3 + { + get { return brandFilterChecked3; } + set + { + if (brandFilterChecked3 != value) + { + brandFilterChecked3 = value; + OnPropertyChanged(nameof(BrandFilterChecked3)); + UpdateFilteredProducts(); + } + } + } + + private bool brandFilterChecked4; + public bool BrandFilterChecked4 + { + get { return brandFilterChecked4; } + set + { + if (brandFilterChecked4 != value) + { + brandFilterChecked4 = value; + OnPropertyChanged(nameof(BrandFilterChecked4)); + UpdateFilteredProducts(); + } + } + } + + private bool sizeFilterChecked2 = true; + public bool SizeFilterChecked2 + { + get { return sizeFilterChecked2; } + set + { + if (sizeFilterChecked2 != value) + { + sizeFilterChecked2 = value; + OnPropertyChanged(nameof(SizeFilterChecked2)); + UpdateFilteredProducts(); + } + } + } + + private bool sizeFilterChecked3 = true; + public bool SizeFilterChecked3 + { + get { return sizeFilterChecked3; } + set + { + if (sizeFilterChecked3 != value) + { + sizeFilterChecked3 = value; + OnPropertyChanged(nameof(SizeFilterChecked3)); + UpdateFilteredProducts(); + } + } + } + + private bool sizeFilterChecked4; + public bool SizeFilterChecked4 + { + get { return sizeFilterChecked4; } + set + { + if (sizeFilterChecked4 != value) + { + sizeFilterChecked4 = value; + OnPropertyChanged(nameof(SizeFilterChecked4)); + UpdateFilteredProducts(); + } + } + } + + private bool sizeFilterChecked5; + public bool SizeFilterChecked5 + { + get { return sizeFilterChecked5; } + set + { + if (sizeFilterChecked5 != value) + { + sizeFilterChecked5 = value; + OnPropertyChanged(nameof(SizeFilterChecked5)); + UpdateFilteredProducts(); + } + } + } + + private bool colorFilterChecked1; + public bool ColorFilterChecked1 + { + get { return colorFilterChecked1; } + set + { + if (colorFilterChecked1 != value) + { + colorFilterChecked1 = value; + OnPropertyChanged(nameof(colorFilterChecked1)); + UpdateFilteredProducts(); + } + } + } + + private bool colorFilterChecked2 = true; + public bool ColorFilterChecked2 + { + get { return colorFilterChecked2; } + set + { + if (colorFilterChecked2 != value) + { + colorFilterChecked2 = value; + OnPropertyChanged(nameof(colorFilterChecked2)); + UpdateFilteredProducts(); + } + } + } + + private bool colorFilterChecked3 = true; + public bool ColorFilterChecked3 + { + get { return colorFilterChecked3; } + set + { + if (colorFilterChecked3 != value) + { + colorFilterChecked3 = value; + OnPropertyChanged(nameof(colorFilterChecked3)); + UpdateFilteredProducts(); + } + } + } + + private bool colorFilterChecked4; + public bool ColorFilterChecked4 + { + get { return colorFilterChecked4; } + set + { + if (colorFilterChecked4 != value) + { + colorFilterChecked4 = value; + OnPropertyChanged(nameof(colorFilterChecked4)); + UpdateFilteredProducts(); + } + } + } + + private bool colorFilterChecked5; + public bool ColorFilterChecked5 + { + get { return colorFilterChecked5; } + set + { + if (colorFilterChecked5 != value) + { + colorFilterChecked5 = value; + OnPropertyChanged(nameof(colorFilterChecked5)); + UpdateFilteredProducts(); + } + } + } + + public ObservableCollection Products1 { get; set; } + + public ObservableCollection Products2 { get; set; } + public ObservableCollection Products3 { get; set; } + public ObservableCollection Products4 { get; set; } + + private ObservableCollection? filtered; + public ObservableCollection? Filtered + { + get { return filtered; } + set + { + if (filtered != value) + { + filtered = value; + OnPropertyChanged(nameof(Filtered)); + } + } + } + + #endregion + + #region Constructor + + public GettingStartedViewModel() + { + Products1 = new ObservableCollection(); + Products2 = new ObservableCollection(); + Products3 = new ObservableCollection(); + Products4 = new ObservableCollection(); + +#if ANDROID || IOS + string description1 = "Lightweight Sneakers"; + string description2 = "Stylish Smart Sneakers"; +#else + string description1 = "Lightweight Sneakers for Men"; + string description2 = "Stylish Smart Sneakers for Men"; +#endif + + Products1.Add(new Product("CAMPUS", "brownshoe-01.png", "6 7 8", Colors.Brown, description1)); + Products1.Add(new Product("CAMPUS", "greenshoe-02.png", "6 7 8 9 10", Colors.Green, description2)); + Products1.Add(new Product("CAMPUS", "redshoe-03.png", "7 8 9 10 ", Colors.Red, description2)); + Products1.Add(new Product("CAMPUS", "sandalshoe-04.png", "9 10", Colors.Tan, description2)); + Products1.Add(new Product("CAMPUS", "violetshoe-05.png", "6 7", Colors.Violet, description1)); + Products1.Add(new Product("CAMPUS", "brownshoe-02.png", "7 8 9", Colors.Brown, description2)); + Products1.Add(new Product("CAMPUS", "greenshoe-03.png", "6 7 8 9", Colors.Green, description2)); + Products1.Add(new Product("CAMPUS", "redshoe-04.png", "7 8 9 10", Colors.Red, description2)); + Products1.Add(new Product("CAMPUS", "sandalshoe-05.png", "6 7 8 9 10", Colors.Tan, description1)); + Products1.Add(new Product("CAMPUS", "violetshoe-01.png", "6 9 10", Colors.Violet, description1)); + + Products2.Add(new Product("Skechers", "brownshoe-03.png", "6 7 8 9 10", Colors.Brown, description2)); + Products2.Add(new Product("Skechers", "greenshoe-04.png", "8 9 10", Colors.Green, description2)); + Products2.Add(new Product("Skechers", "redshoe-05.png", "6 7 9 10", Colors.Red, description1)); + Products2.Add(new Product("Skechers", "sandalshoe-01.png", "6 7 8 9 10", Colors.Tan, description1)); + Products2.Add(new Product("Skechers", "violetshoe-02.png", "6 7 10", Colors.Violet, description2)); + Products2.Add(new Product("Skechers", "brownshoe-04.png", "6 7 8 9 10", Colors.Brown, description2)); + Products2.Add(new Product("Skechers", "greenshoe-05.png", "6 7 8", Colors.Green, description1)); + Products2.Add(new Product("Skechers", "redshoe-01.png", "6 7 8 9 10", Colors.Red, description1)); + Products2.Add(new Product("Skechers", "sandalshoe-02.png", "8 9 10", Colors.Tan, description2)); + Products2.Add(new Product("Skechers", "violetshoe-03.png", "6 7 8 9 10", Colors.Violet, description2)); + + Products3.Add(new Product("RED TAPE", "brownshoe-05.png", "6 7 8 9 10", Colors.Brown, description1)); + Products3.Add(new Product("RED TAPE", "greenshoe-01.png", "8 9 10", Colors.Green, description1)); + Products3.Add(new Product("RED TAPE", "redshoe-02.png", "6 7 8 9 10", Colors.Red, description2)); + Products3.Add(new Product("RED TAPE", "sandalshoe-03.png", "6 8 9 10", Colors.Tan, description2)); + Products3.Add(new Product("RED TAPE", "violetshoe-04.png", "6 7 8 9 10", Colors.Violet, description2)); + Products3.Add(new Product("RED TAPE", "brownshoe-01.png", "6 9 10", Colors.Brown, description1)); + Products3.Add(new Product("RED TAPE", "greenshoe-02.png", "6 7 8 9 10", Colors.Green, description2)); + Products3.Add(new Product("RED TAPE", "redshoe-03.png", "6 7 8", Colors.Red, description2)); + Products3.Add(new Product("RED TAPE", "sandalshoe-04.png", "6 7 8 9 10", Colors.Tan, description2)); + Products3.Add(new Product("RED TAPE", "violetshoe-05.png", "6 7 8 10", Colors.Violet, description1)); + + Products4.Add(new Product("Roadster", "brownshoe-02.png", "6 7 8", Colors.Brown, description2)); + Products4.Add(new Product("Roadster", "greenshoe-03.png", "6 7 8 9 10", Colors.Green, description2)); + Products4.Add(new Product("Roadster", "redshoe-04.png", "6 9 10", Colors.Red, description2)); + Products4.Add(new Product("Roadster", "sandalshoe-05.png", "6 7 8 9 10", Colors.Tan, description1)); + Products4.Add(new Product("Roadster", "violetshoe-01.png", "6 9 10", Colors.Violet, description1)); + Products4.Add(new Product("Roadster", "brownshoe-03.png", "6 7 8 9 10", Colors.Brown, description2)); + Products4.Add(new Product("Roadster", "greenshoe-04.png", "8 9 10", Colors.Green, description2)); + Products4.Add(new Product("Roadster", "redshoe-05.png", "6 7 8 9 10", Colors.Red, description1)); + Products4.Add(new Product("Roadster", "sandalshoe-01.png", "6 7 10", Colors.Tan, description1)); + Products4.Add(new Product("Roadster", "violetshoe-02.png", "6 7 9 10", Colors.Violet, description2)); + + UpdateFilteredProducts(); + } + + #endregion + + #region Methods + + private void UpdateFilteredProducts() + { + Filtered = GetFilteredProducts(); + OnPropertyChanged(nameof(Filtered)); + } + + private ObservableCollection GetFilteredProducts() + { + var filteredList = new ObservableCollection(); + + if (brandFilterChecked1) + { + foreach (var product in Products1) + { + if (IsColorChecked(product) || IsColorUnfiltered()) + filteredList.Add(product); + } + } + if (brandFilterChecked2) + { + foreach (var product in Products2) + { + if (IsColorChecked(product) || IsColorUnfiltered()) + filteredList.Add(product); + } + } + if (brandFilterChecked3) + { + foreach (var product in Products3) + { + if (IsColorChecked(product) || IsColorUnfiltered()) + filteredList.Add(product); + } + } + if (brandFilterChecked4) + { + foreach (var product in Products4) + { + if (IsColorChecked(product) || IsColorUnfiltered()) + filteredList.Add(product); + } + } + if (!brandFilterChecked1 && !brandFilterChecked2 && !brandFilterChecked3 && !brandFilterChecked4) + { + filteredList = GetProducts(); + } + + List products = new List(); + products = filteredList.OrderBy(x => Random.Shared.Next()).ToList(); + filteredList = this.GetCollection(products); + + return filteredList; + } + + private ObservableCollection GetCollection(List list) + { + var filteredList = new ObservableCollection(); + foreach (var product in list) + { + filteredList.Add(product); + } + return filteredList; + } + + private ObservableCollection GetProducts() + { + var filteredList = new ObservableCollection(); + foreach (var product in Products1) + { + if (IsColorChecked(product) || IsColorUnfiltered()) + filteredList.Add(product); + } + foreach (var product in Products2) + { + if (IsColorChecked(product) || IsColorUnfiltered()) + filteredList.Add(product); + } + foreach (var product in Products3) + { + if (IsColorChecked(product) || IsColorUnfiltered()) + filteredList.Add(product); + } + foreach (var product in Products4) + { + if (IsColorChecked(product) || IsColorUnfiltered()) + filteredList.Add(product); + } + return filteredList; + } + + private bool IsColorChecked(Product product) + { + return ((colorFilterChecked1 && product.Color == Colors.Brown) || (colorFilterChecked2 && product.Color == Colors.Green) || (colorFilterChecked3 && product.Color == Colors.Red) || (colorFilterChecked4 && product.Color == Colors.Tan) || (colorFilterChecked5 && product.Color == Colors.Violet)); + } + + private bool IsColorUnfiltered() + { + return (!colorFilterChecked1 && !colorFilterChecked2 && !colorFilterChecked3 && !colorFilterChecked4 && !colorFilterChecked5); + } + + #endregion + + #region Model + + public class Product + { + public string Brand { get; set; } + public string Description { get; set; } + public string Size { get; set; } + public Color Color { get; set; } + public string Image { get; set; } + + public Product(string brand, string image, string size, Color color, string description) + { + Brand = brand; + Description = description; + Size = size; + Color = color; + Image = image; + } + } + #endregion +} diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/Customizations/View/Customizations.xaml b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/Customizations/View/Customizations.xaml new file mode 100644 index 00000000..49656fcc --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/Customizations/View/Customizations.xaml @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/Customizations/View/Customizations.xaml.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/Customizations/View/Customizations.xaml.cs new file mode 100644 index 00000000..8f551db3 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/Customizations/View/Customizations.xaml.cs @@ -0,0 +1,23 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; + +namespace SampleBrowser.Maui.Buttons.RadioButton; + +public partial class Customizations : SampleView +{ + public Customizations() + { + InitializeComponent(); +#if ANDROID || IOS + this.Content = new CustomizationsMobile(); +#else + this.Content = new CustomizationsDesktop(); +#endif + } +} \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/Customizations/View/CustomizationsDesktop.xaml b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/Customizations/View/CustomizationsDesktop.xaml new file mode 100644 index 00000000..1ea3abb8 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/Customizations/View/CustomizationsDesktop.xaml @@ -0,0 +1,250 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/Customizations/View/CustomizationsDesktop.xaml.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/Customizations/View/CustomizationsDesktop.xaml.cs new file mode 100644 index 00000000..7e262b94 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/Customizations/View/CustomizationsDesktop.xaml.cs @@ -0,0 +1,96 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; +using SampleBrowser.Maui.Buttons.RadioButton; + +namespace SampleBrowser.Maui.Buttons.RadioButton; + +public partial class CustomizationsDesktop : SampleView +{ + ViewModel viewModel; + public CustomizationsDesktop() + { + InitializeComponent(); + viewModel = new ViewModel(); + this.BindingContext = viewModel; + } + private void TextColorSegment_Clicked(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#E5E4E2"); + } + + private void TextColorSegment_Clicked_1(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#c6c6c6"); + } + + private void TextColorSegment_Clicked_2(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#538eed"); + } + + private void TextColorSegment_Clicked_3(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#af2463"); + } + + private void TextColorSegment_Clicked_4(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#000000"); + + } + private void CheckedColorSegment_Clicked(object sender, EventArgs e) + { + radiobutton.CheckedColor = Color.FromArgb("#E5E4E2"); + } + + private void CheckedColorSegment_Clicked_1(object sender, EventArgs e) + { + radiobutton.CheckedColor = Color.FromArgb("#c6c6c6"); + } + + private void CheckedColorSegment_Clicked_2(object sender, EventArgs e) + { + radiobutton.CheckedColor = Color.FromArgb("#538eed"); + } + + private void CheckedColorSegment_Clicked_3(object sender, EventArgs e) + { + radiobutton.CheckedColor = Color.FromArgb("#af2463"); + } + + private void CheckedColorSegment_Clicked_4(object sender, EventArgs e) + { + radiobutton.CheckedColor = Color.FromArgb("#000000"); + } + + private void UncheckedColorSegment_Clicked(object sender, EventArgs e) + { + + radiobutton.UncheckedColor = Color.FromArgb("#E5E4E2"); + } + private void UncheckedColorSegment_Clicked_1(object sender, EventArgs e) + { + radiobutton.UncheckedColor = Color.FromArgb("#c6c6c6"); + } + + private void UncheckedColorSegment_Clicked_2(object sender, EventArgs e) + { + radiobutton.UncheckedColor = Color.FromArgb("#538eed"); + } + + private void UncheckedColorSegment_Clicked_3(object sender, EventArgs e) + { + radiobutton.UncheckedColor = Color.FromArgb("#af2463"); + } + + private void UncheckedColorSegment_Clicked_4(object sender, EventArgs e) + { + radiobutton.UncheckedColor = Color.FromArgb("#000000"); + } +} \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/Customizations/View/CustomizationsMobile.xaml b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/Customizations/View/CustomizationsMobile.xaml new file mode 100644 index 00000000..df0ae5d8 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/Customizations/View/CustomizationsMobile.xaml @@ -0,0 +1,239 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/Customizations/View/CustomizationsMobile.xaml.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/Customizations/View/CustomizationsMobile.xaml.cs new file mode 100644 index 00000000..0c63f90b --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/Customizations/View/CustomizationsMobile.xaml.cs @@ -0,0 +1,98 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Microsoft.Maui.Controls; +using SampleBrowser.Maui.Base; +using SampleBrowser.Maui.Buttons.RadioButton; + +namespace SampleBrowser.Maui.Buttons.RadioButton; + +public partial class CustomizationsMobile : SampleView +{ + ViewModel viewModel; + + public CustomizationsMobile() + { + InitializeComponent(); + viewModel = new ViewModel(); + this.BindingContext = viewModel; + } + private void TextColorSegment_Clicked(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#E5E4E2"); + } + + private void TextColorSegment_Clicked_1(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#c6c6c6"); + } + + private void TextColorSegment_Clicked_2(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#538eed"); + } + + private void TextColorSegment_Clicked_3(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#af2463"); + } + + private void TextColorSegment_Clicked_4(object sender, EventArgs e) + { + viewModel.TextColor = Color.FromArgb("#000000"); + + } + private void CheckedColorSegment_Clicked(object sender, EventArgs e) + { + radiobutton.CheckedColor = Color.FromArgb("#E5E4E2"); + } + + private void CheckedColorSegment_Clicked_1(object sender, EventArgs e) + { + radiobutton.CheckedColor = Color.FromArgb("#c6c6c6"); + } + + private void CheckedColorSegment_Clicked_2(object sender, EventArgs e) + { + radiobutton.CheckedColor = Color.FromArgb("#538eed"); + } + + private void CheckedColorSegment_Clicked_3(object sender, EventArgs e) + { + radiobutton.CheckedColor = Color.FromArgb("#af2463"); + } + + private void CheckedColorSegment_Clicked_4(object sender, EventArgs e) + { + radiobutton.CheckedColor = Color.FromArgb("#000000"); + } + + private void UnCheckedColorSegment_Clicked(object sender, EventArgs e) + { + + radiobutton.UncheckedColor = Color.FromArgb("#E5E4E2"); + } + private void UnCheckedColorSegment_Clicked_1(object sender, EventArgs e) + { + radiobutton.UncheckedColor = Color.FromArgb("#c6c6c6"); + } + + private void UnCheckedColorSegment_Clicked_2(object sender, EventArgs e) + { + radiobutton.UncheckedColor = Color.FromArgb("#538eed"); + } + + private void UnCheckedColorSegment_Clicked_3(object sender, EventArgs e) + { + radiobutton.UncheckedColor = Color.FromArgb("#af2463"); + } + + private void UnCheckedColorSegment_Clicked_4(object sender, EventArgs e) + { + radiobutton.UncheckedColor = Color.FromArgb("#000000"); + } +} \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/Customizations/ViewModel/ViewModel.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/Customizations/ViewModel/ViewModel.cs new file mode 100644 index 00000000..0a4cf51a --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/Customizations/ViewModel/ViewModel.cs @@ -0,0 +1,132 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Syncfusion.Maui.Buttons; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; +using SampleBrowser.Maui.Base.Converters; +using System.Reflection; + +namespace SampleBrowser.Maui.Buttons.RadioButton; + +public class ViewModel : INotifyPropertyChanged +{ + + #region Fields + + /// + /// Represents the text color + /// + private Color textColor = Colors.Black; + + /// + /// Represents the border width + /// + private int radius = 2; + + /// + /// The text of button. + /// + private string text = "RadioButton"; + + /// + /// The can show background image + /// + private bool ischecked = false; + + #endregion + + #region Property + + /// + /// Gets or Sets the text color + /// + public Color TextColor + { + get + { + return textColor; + } + + set + { + textColor = value; + OnPropertyChanged("TextColor"); + } + } + + /// + /// Gets or sets the border width. + /// + public int Radius + { + get + { + return radius; + } + set + { + radius = value; + OnPropertyChanged("Radius"); + } + } + + /// + /// Gets or sets the text. + /// + /// The text. + public string Text + { + get + { + return text; + } + set + { + text = value; + OnPropertyChanged("Text"); + } + } + + /// + /// Gets or sets a value indicating whether this is enable stack. + /// + /// true if is enable stack; otherwise, false. + public bool IsChecked + { + get + { + return ischecked; + } + set + { + ischecked = value; + OnPropertyChanged("IsChecked"); + } + } + + #endregion + + #region Property changed method + + /// + /// Occurs when property changed. + /// + public event PropertyChangedEventHandler? PropertyChanged; + + + public void OnPropertyChanged([CallerMemberName] string? name = null) => + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + + #endregion +} diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/GettingStarted/GettingStarted.xaml b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/GettingStarted/GettingStarted.xaml new file mode 100644 index 00000000..cd082096 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/GettingStarted/GettingStarted.xaml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/GettingStarted/GettingStarted.xaml.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/GettingStarted/GettingStarted.xaml.cs new file mode 100644 index 00000000..029faffd --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/GettingStarted/GettingStarted.xaml.cs @@ -0,0 +1,33 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; + +namespace SampleBrowser.Maui.Buttons.RadioButton; + +public partial class GettingStarted : SampleView +{ +#if ANDROID || IOS + GettingStartedMobile gettingStartedMobile; +#else + GettingStartedDesktop gettingStartedDesktop; +#endif + public GettingStarted() + { + InitializeComponent(); +#if ANDROID || IOS + gettingStartedMobile = new GettingStartedMobile(); + this.Content = gettingStartedMobile.Content; + this.OptionView = gettingStartedMobile.OptionView; +#else + gettingStartedDesktop = new GettingStartedDesktop(); + this.Content = gettingStartedDesktop.Content; + this.OptionView = gettingStartedDesktop.OptionView; + this.WidthRequest = gettingStartedDesktop.WidthRequest; +#endif + } +} \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/GettingStarted/GettingStartedDesktop.xaml b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/GettingStarted/GettingStartedDesktop.xaml new file mode 100644 index 00000000..d8403ee2 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/GettingStarted/GettingStartedDesktop.xaml @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/GettingStarted/GettingStartedDesktop.xaml.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/GettingStarted/GettingStartedDesktop.xaml.cs new file mode 100644 index 00000000..0b928ff1 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/GettingStarted/GettingStartedDesktop.xaml.cs @@ -0,0 +1,83 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; +using System.Diagnostics; + +namespace SampleBrowser.Maui.Buttons.RadioButton; + +public partial class GettingStartedDesktop:SampleView +{ + public GettingStartedDesktop() + { + InitializeComponent(); + } + + private void SfRadioGroupKey_CheckedChanged(object sender, Syncfusion.Maui.Buttons.CheckedChangedEventArgs e) + { + button.IsEnabled = true; + } + + private void Button_Clicked(object sender, EventArgs e) + { + masterCard.IsChecked = false; + visa.IsChecked = false; + payDirect.IsChecked = false; + noCost.IsChecked = false; + nineMonths.IsChecked = false; + twelveMonths.IsChecked = false; + button.IsEnabled = false; + } + + private void PayDirect_StateChanged(object sender, Syncfusion.Maui.Buttons.StateChangedEventArgs e) + { + if (e.IsChecked == true) + { + noCost.IsEnabled = false; + nineMonths.IsEnabled = false; + twelveMonths.IsEnabled = false; + noCost.IsChecked = false; + nineMonths.IsChecked = false; + twelveMonths.IsChecked = false; + } + } + + private void Visa_StateChanged(object sender, Syncfusion.Maui.Buttons.StateChangedEventArgs e) + { + if (e.IsChecked == true) + { + noCost.IsEnabled = true; + nineMonths.IsEnabled = true; + twelveMonths.IsEnabled = true; + } + } + + private void MasterCard_StateChanged(object sender, Syncfusion.Maui.Buttons.StateChangedEventArgs e) + { + if (e.IsChecked == true) + { + noCost.IsEnabled = true; + nineMonths.IsEnabled = true; + twelveMonths.IsEnabled = true; + } + } + + private void TapGestureRecognizer_Tapped(object sender, EventArgs e) + { + masterCard.IsChecked = true; + } + + private void TapGestureRecognizer_Tapped_1(object sender, EventArgs e) + { + visa.IsChecked = true; + } + + private void TapGestureRecognizer_Tapped_2(object sender, EventArgs e) + { + payDirect.IsChecked = true; + } +} \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/GettingStarted/GettingStartedMobile.xaml b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/GettingStarted/GettingStartedMobile.xaml new file mode 100644 index 00000000..19611957 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/GettingStarted/GettingStartedMobile.xaml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/GettingStarted/GettingStartedMobile.xaml.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/GettingStarted/GettingStartedMobile.xaml.cs new file mode 100644 index 00000000..2051815a --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/RadioButton/GettingStarted/GettingStartedMobile.xaml.cs @@ -0,0 +1,55 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; + +namespace SampleBrowser.Maui.Buttons.RadioButton; + +public partial class GettingStartedMobile : SampleView +{ + public GettingStartedMobile() + { + InitializeComponent(); + } + + private void SfRadioGroupKey_CheckedChanged(object sender, Syncfusion.Maui.Buttons.CheckedChangedEventArgs e) + { + button.IsEnabled = true; + + } + + private void Button_Clicked(object sender, EventArgs e) + { + bankCreditCard.IsChecked = false; + bankDebitCard.IsChecked = false; + creditCard.IsChecked = false; + debitOrCreditCard.IsChecked = false; + netBanking.IsChecked = false; + cashButton.IsChecked = false; + button.IsEnabled = false; + } + + private void TapGestureRecognizer_Tapped(object sender, EventArgs e) + { + cashButton.IsChecked = true; + } + + private void TapGestureRecognizer_Tapped_1(object sender, EventArgs e) + { + bankCreditCard.IsChecked = true; + } + + private void TapGestureRecognizer_Tapped_2(object sender, EventArgs e) + { + creditCard.IsChecked = true; + } + + private void TapGestureRecognizer_Tapped_3(object sender, EventArgs e) + { + bankDebitCard.IsChecked = true; + } +} \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/SegmentedControl/GettingStarted/View/GettingStarted.xaml b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/SegmentedControl/GettingStarted/View/GettingStarted.xaml new file mode 100644 index 00000000..70741afc --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/SegmentedControl/GettingStarted/View/GettingStarted.xaml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/SegmentedControl/GettingStarted/View/GettingStarted.xaml.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/SegmentedControl/GettingStarted/View/GettingStarted.xaml.cs new file mode 100644 index 00000000..e82f7961 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/SegmentedControl/GettingStarted/View/GettingStarted.xaml.cs @@ -0,0 +1,30 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.Buttons.SfSegmentedControl +{ + using SampleBrowser.Maui.Base; + + /// + /// Provides the view for the Getting Started sample. + /// + public partial class GettingStarted : SampleView + { + /// + /// Initializes a new instance of the class. + /// + public GettingStarted() + { + InitializeComponent(); +#if WINDOWS || MACCATALYST + this.Content = new GettingStartedDesktopUI(); +#elif ANDROID || IOS + this.Content = new GettingStartedMobileUI(); +#endif + } + } +} \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/SegmentedControl/GettingStarted/View/GettingStartedDesktopUI.xaml b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/SegmentedControl/GettingStarted/View/GettingStartedDesktopUI.xaml new file mode 100644 index 00000000..14816646 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/SegmentedControl/GettingStarted/View/GettingStartedDesktopUI.xaml @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/SegmentedControl/GettingStarted/View/GettingStartedDesktopUI.xaml.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/SegmentedControl/GettingStarted/View/GettingStartedDesktopUI.xaml.cs new file mode 100644 index 00000000..1c4c3f77 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/SegmentedControl/GettingStarted/View/GettingStartedDesktopUI.xaml.cs @@ -0,0 +1,37 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.Buttons.SfSegmentedControl +{ + using SampleBrowser.Maui.Base; + + /// + /// Provides the view for the Getting Started sample for the desktop. + /// + public partial class GettingStartedDesktopUI : SampleView + { + /// + /// Initializes a new instance of the class. + /// + public GettingStartedDesktopUI() + { + InitializeComponent(); +#if WINDOWS + double density = DeviceDisplay.MainDisplayInfo.Density; + if (density == 1.0) + { + this.SegmentsContainerGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }); + this.SegmentsContainerGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(0.15, GridUnitType.Star) }); + return; + } + + this.SegmentsContainerGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(0.85, GridUnitType.Star) }); + this.SegmentsContainerGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(0.15, GridUnitType.Star) }); +#endif + } + } +} \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/SegmentedControl/GettingStarted/View/GettingStartedMobileUI.xaml b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/SegmentedControl/GettingStarted/View/GettingStartedMobileUI.xaml new file mode 100644 index 00000000..a048283c --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/SegmentedControl/GettingStarted/View/GettingStartedMobileUI.xaml @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/SegmentedControl/GettingStarted/View/GettingStartedMobileUI.xaml.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/SegmentedControl/GettingStarted/View/GettingStartedMobileUI.xaml.cs new file mode 100644 index 00000000..21e9b2e3 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/SegmentedControl/GettingStarted/View/GettingStartedMobileUI.xaml.cs @@ -0,0 +1,25 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.Buttons.SfSegmentedControl +{ + using SampleBrowser.Maui.Base; + + /// + /// Provides the view for the Getting Started sample for the mobile. + /// + public partial class GettingStartedMobileUI : SampleView + { + /// + /// Initializes a new instance of the class. + /// + public GettingStartedMobileUI() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/SegmentedControl/GettingStarted/ViewModel/GettingStartedViewModel.cs b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/SegmentedControl/GettingStarted/ViewModel/GettingStartedViewModel.cs new file mode 100644 index 00000000..ebaffec2 --- /dev/null +++ b/MAUI/Buttons/SampleBrowser.Maui.Buttons/Samples/SegmentedControl/GettingStarted/ViewModel/GettingStartedViewModel.cs @@ -0,0 +1,417 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.Buttons.SfSegmentedControl +{ + using System.Collections.ObjectModel; + using System.ComponentModel; + using Syncfusion.Maui.Buttons; + + /// + /// Providing data to support getting started with the application. + /// + public class GettingStartedViewModel : INotifyPropertyChanged + { + #region Fields + + /// + /// The index of the selected item. + /// + private int selectedColoredIndex = -1; + + /// + /// The list of speaker fill colors information. + /// + private List? speakerColorOptionsInfo; + + /// + /// The selected delivery options. + /// + private int selectedDeliveryOptions = -1; + + /// + /// The delivery date. + /// + private DateTime? deliveryDate = DateTime.Now; + + /// + /// The total price. + /// + private string? totalPrice; + + /// + /// The total amount. + /// + private int totalAmount; + + /// + /// The date + /// + private string? date; + + /// + /// The selected item size index. + /// + private int selectedWarrantyOption; + + /// + /// The file path or URL of an image associated with this object. + /// + private string image = string.Empty; + + #endregion + + #region Constructor + + /// + /// Initializes a new instance of the class. + /// + public GettingStartedViewModel() + { + this.InitializeSegmentItemsColorsInfo(); + this.InitializeAddOnItemsInfo(); + this.InitializeSpeakerDeliveryOptionInfo(); + this.InitializeSpeakerResultsInfo(); + } + + #endregion + + #region Properties + + /// + /// Gets or sets the collection of speaker results option information. + /// + public ObservableCollection? SpeakerResultsOptionInfo { get; private set; } + + /// + /// Gets or sets the collection of speaker delivery options information. + /// + public ObservableCollection? SpeakerDeliveryOptionsInfo { get; private set; } + + /// + /// Gets or sets the collection of speaker add on items options information. + /// + public ObservableCollection? SpeakerWarrantyOptionsInfo { get; private set; } + + /// + /// Represents the final price of the speaker. + /// + public int FinalPrice { get; private set; } + + /// + /// Gets or sets the list of segment items colors information. + /// + public List? SpeakerColorOptionsInfo + { + get + { + return this.speakerColorOptionsInfo; + } + set + { + if (this.speakerColorOptionsInfo != value) + { + this.speakerColorOptionsInfo = value; + this.OnPropertyChanged(nameof(SpeakerColorOptionsInfo)); + } + } + } + + /// + /// Gets or sets the date associated with the speaker. + /// + public string? Date + { + get { return this.date; } + set + { + this.date = value; + this.OnPropertyChanged(nameof(Date)); + } + } + + /// + /// Gets or sets the total price of the speaker. + /// + public string? TotalPrice + { + get { return this.totalPrice; } + set + { + this.totalPrice = value; + this.OnPropertyChanged(nameof(TotalPrice)); + } + } + + /// + /// Gets or sets the delivery date of the speaker. + /// + public DateTime? DeliveryDate + { + get + { + return this.deliveryDate; + } + set + { + this.deliveryDate = value; + this.OnPropertyChanged(nameof(DeliveryDate)); + } + } + + /// + /// Gets or sets the index of the selected delivery option. + /// + public int SelectedDeliveryOption + { + get + { + return this.selectedDeliveryOptions; + } + set + { + this.selectedDeliveryOptions = value; + this.UpdateTotalPriceAndDeliveryDate(); + this.UpdateTotalPriceBasedOnSize(); + this.OnPropertyChanged(nameof(SelectedDeliveryOption)); + } + } + + /// + /// Gets or sets the selected add-on item index. + /// + public int SelectedWarrantyOption + { + get + { + return this.selectedWarrantyOption; + } + set + { + if (this.selectedWarrantyOption != value) + { + this.selectedWarrantyOption = value; + this.UpdateSelectedSegmentItemsValue(); + this.OnPropertyChanged(nameof(SelectedWarrantyOption)); + } + } + } + + /// + /// Gets or sets the selected colored item index. + /// + public int SelectedColoredIndex + { + get + { + return this.selectedColoredIndex; + } + set + { + if (this.selectedColoredIndex != value) + { + this.selectedColoredIndex = value; + this.OnPropertyChanged(nameof(selectedColoredIndex)); + this.UpdateSelectedSegmentItemsValue(); + } + } + } + + /// + /// Gets or sets the image path or URL. + /// + public string Image + { + get + { + return image; + } + set + { + image = value; + OnPropertyChanged(nameof(Image)); + } + } + + #endregion + + #region Events + + /// + /// Occurs when a property value changes. + /// + public event PropertyChangedEventHandler? PropertyChanged; + + #endregion + + #region Private Methods + + /// + /// Method used to raise the property changed event. + /// + /// Represents the property name. + private void OnPropertyChanged(string parameter) + { + this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(parameter)); + } + + /// + /// Initializes the collection of add on segment items info. + /// + private void InitializeAddOnItemsInfo() + { + this.SpeakerWarrantyOptionsInfo = new ObservableCollection() + { + new SfSegmentItem() { Text = "1 Year" }, + new SfSegmentItem() { Text = "2 Years" }, + new SfSegmentItem() { Text = "3 Years" } + }; + } + + /// + /// Initializes the collection of segments items colors info. + /// + private void InitializeSegmentItemsColorsInfo() + { + this.SpeakerColorOptionsInfo = new List() + { + new SfSegmentItem() { Text = "\uE91F", SelectedSegmentBackground = Color.FromArgb("#8EAEDC"), TextStyle = new SegmentTextStyle() { TextColor = Color.FromArgb("#8EAEDC"), FontSize = 25, FontFamily = "SegmentIcon" } }, + new SfSegmentItem() { Text = "\uE91F", SelectedSegmentBackground = Color.FromArgb("#A4AAB4"), TextStyle = new SegmentTextStyle() { TextColor = Color.FromArgb("#A4AAB4"), FontSize = 25, FontFamily = "SegmentIcon" } }, + new SfSegmentItem() { Text = "\uE91F", SelectedSegmentBackground = Color.FromArgb("#7DC59D"), TextStyle = new SegmentTextStyle() { TextColor = Color.FromArgb("#7DC59D"), FontSize = 25, FontFamily = "SegmentIcon" } }, + new SfSegmentItem() { Text = "\uE91F", SelectedSegmentBackground = Color.FromArgb("#F5878F"), TextStyle = new SegmentTextStyle() { TextColor = Color.FromArgb("#F5878F"), FontSize = 25, FontFamily = "SegmentIcon" } }, + new SfSegmentItem() { Text = "\uE91F", SelectedSegmentBackground = Color.FromArgb("#C7B690"), TextStyle = new SegmentTextStyle() { TextColor = Color.FromArgb("#C7B690"), FontSize = 25, FontFamily = "SegmentIcon" } }, + }; + + this.SelectedColoredIndex = 0; + } + + /// + /// Initializes the collection of speaker delivery option segment items. + /// + private void InitializeSpeakerDeliveryOptionInfo() + { + this.SpeakerDeliveryOptionsInfo = new ObservableCollection() + { + new SfSegmentItem() { Text = "Free Delivery" , Width = 120 }, + new SfSegmentItem() { Text = "+$6 for 1 Day Delivery" , Width = 180}, + }; + + this.selectedDeliveryOptions = 0; + } + + /// + /// Initializes the collection of speaker results option segment items. + /// + private void InitializeSpeakerResultsInfo() + { + this.SpeakerResultsOptionInfo = new ObservableCollection() + { + new SfSegmentItem() { Text = "Add to Cart"}, + }; + } + + /// + /// Updates the total price and delivery date based on the selected delivery option. + /// + private void UpdateTotalPriceAndDeliveryDate() + { + if (this.selectedDeliveryOptions == 0) + { + this.totalAmount = this.FinalPrice; +#if WINDOWS || MACCATALYST + this.Date = " (Delivery by " + this.DeliveryDate!.Value.AddDays(5).ToLongDateString() + ")"; +#else + this.Date = " (Delivery by " + this.DeliveryDate!.Value.AddDays(5).ToString("ddd, MMM dd, yyyy") + ")"; +#endif + this.TotalPrice = "$" + this.totalAmount; + } + else + { + this.totalAmount += 6; +#if WINDOWS || MACCATALYST + this.Date = " (Delivery by " + this.DeliveryDate!.Value.AddDays(1).ToLongDateString() + ")"; +#else + this.Date = " (Delivery by " + this.DeliveryDate!.Value.AddDays(1).ToString("ddd, MMM dd, yyyy") + ")"; +#endif + this.TotalPrice = "$" + this.totalAmount; + } + } + + /// + /// Updates the total price based on the selected warranty year. + /// + private void UpdateTotalPriceBasedOnSize() + { + if (this.SpeakerWarrantyOptionsInfo == null || this.SpeakerWarrantyOptionsInfo.Count == 0 || this.SpeakerWarrantyOptionsInfo.Count < this.selectedWarrantyOption) + { + return; + } + + SfSegmentItem? selectedYear = this.SpeakerWarrantyOptionsInfo[this.selectedWarrantyOption]; + string sizeText = selectedYear.Text; + int warrantyPriceIncrement = 0; + switch (sizeText) + { + case "1 Year": + warrantyPriceIncrement = 0; + break; + case "2 Years": + warrantyPriceIncrement = 60; + break; + default: + warrantyPriceIncrement = 120; + break; + } + + this.TotalPrice = "$ " + (this.totalAmount + warrantyPriceIncrement); + } + + /// + /// Updates the segment items value based on the selected speaker style. + /// + private void UpdateSelectedSegmentItemsValue() + { + if (this.SpeakerColorOptionsInfo == null || this.SpeakerColorOptionsInfo.Count == 0 || this.SpeakerColorOptionsInfo.Count < this.selectedColoredIndex) + { + return; + } + + if (this.SelectedColoredIndex == 0) + { + this.Image = "BlueSpeaker.png"; + } + else if (this.SelectedColoredIndex == 1) + { + this.Image = "GreySpeaker.png"; + } + else if (this.SelectedColoredIndex == 2) + { + this.Image = "GreenSpeaker.png"; + } + else if (this.SelectedColoredIndex == 3) + { + this.Image = "PinkSpeaker.png"; + } + else if (this.SelectedColoredIndex == 4) + { + this.Image = "SandalsSpeaker.png"; + } + + this.totalAmount = 399; + this.TotalPrice = "$ " + this.totalAmount; + this.FinalPrice = this.totalAmount; + + // Update the total price and delivery date information. + this.UpdateTotalPriceAndDeliveryDate(); + + // Update the total price based on size. + this.UpdateTotalPriceBasedOnSize(); + } + + #endregion + } +} \ No newline at end of file diff --git a/MAUI/Buttons/SampleBrowser.Maui.Buttons/SyncfusionLicense.txt b/MAUI/Buttons/SampleBrowser.Maui.Buttons/SyncfusionLicense.txt new file mode 100644 index 00000000..e69de29b diff --git a/MAUI/Calendar/SampleBrowser.Maui.Calendar/CalendarSamplesList.xml b/MAUI/Calendar/SampleBrowser.Maui.Calendar/CalendarSamplesList.xml index cae21a4a..c7aaeded 100644 --- a/MAUI/Calendar/SampleBrowser.Maui.Calendar/CalendarSamplesList.xml +++ b/MAUI/Calendar/SampleBrowser.Maui.Calendar/CalendarSamplesList.xml @@ -6,25 +6,25 @@ StatusTag="Updated" ControlName="SfCalendar" Description="It is a lightweight control used to select a single, multiple, and a range of dates."> - - - - - + + + + - + CodeViewerPath="Calendar/DateSelection/" VideoLink="https://www.youtube.com/watch?v=kfQjKiD9Xas&t=352s"/> + + CodeViewerPath="Calendar/AppointmentBooking/"/> - + CodeViewerPath="Calendar/HighlightedDates/" /> + \ No newline at end of file diff --git a/MAUI/Calendar/SampleBrowser.Maui.Calendar/SampleBrowser.Maui.Calendar.csproj b/MAUI/Calendar/SampleBrowser.Maui.Calendar/SampleBrowser.Maui.Calendar.csproj index 25478d3c..fb92531d 100644 --- a/MAUI/Calendar/SampleBrowser.Maui.Calendar/SampleBrowser.Maui.Calendar.csproj +++ b/MAUI/Calendar/SampleBrowser.Maui.Calendar/SampleBrowser.Maui.Calendar.csproj @@ -78,13 +78,13 @@ - - - - - - - - + + + + + + + + diff --git a/MAUI/Calendar/SampleBrowser.Maui.Calendar/SampleBrowser.Maui.Calendar.nuspec b/MAUI/Calendar/SampleBrowser.Maui.Calendar/SampleBrowser.Maui.Calendar.nuspec index adbb0710..65a8a306 100644 --- a/MAUI/Calendar/SampleBrowser.Maui.Calendar/SampleBrowser.Maui.Calendar.nuspec +++ b/MAUI/Calendar/SampleBrowser.Maui.Calendar/SampleBrowser.Maui.Calendar.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png Calendar component for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MAUI/Calendar/SampleBrowser.Maui.Calendar/Samples/Calendar/AppearanceCustomization/Behavior/AppearanceCustomizationBehavior.cs b/MAUI/Calendar/SampleBrowser.Maui.Calendar/Samples/Calendar/AppearanceCustomization/Behavior/AppearanceCustomizationBehavior.cs index 7ad1bf4c..c6b4ed84 100644 --- a/MAUI/Calendar/SampleBrowser.Maui.Calendar/Samples/Calendar/AppearanceCustomization/Behavior/AppearanceCustomizationBehavior.cs +++ b/MAUI/Calendar/SampleBrowser.Maui.Calendar/Samples/Calendar/AppearanceCustomization/Behavior/AppearanceCustomizationBehavior.cs @@ -12,7 +12,7 @@ namespace SampleBrowser.Maui.Calendar.SfCalendar using Syncfusion.Maui.Calendar; /// - /// + /// Represents a class which contains appearance customization. /// internal class AppearanceCustomizationBehavior : Behavior { diff --git a/MAUI/Calendar/SampleBrowser.Maui.Calendar/Samples/Calendar/GettingStarted/Behavior/GettingStartedBehavior.cs b/MAUI/Calendar/SampleBrowser.Maui.Calendar/Samples/Calendar/GettingStarted/Behavior/GettingStartedBehavior.cs index d341a7f6..94318b36 100644 --- a/MAUI/Calendar/SampleBrowser.Maui.Calendar/Samples/Calendar/GettingStarted/Behavior/GettingStartedBehavior.cs +++ b/MAUI/Calendar/SampleBrowser.Maui.Calendar/Samples/Calendar/GettingStarted/Behavior/GettingStartedBehavior.cs @@ -171,6 +171,7 @@ namespace SampleBrowser.Maui.Calendar.SfCalendar this.calendar.SelectedDates = selectedDates; this.calendar.SelectedDateRange = new CalendarDateRange(DateTime.Now.AddDays(2), DateTime.Now.AddDays(6)); + this.calendar.SelectedDateRanges = new ObservableCollection { new CalendarDateRange(DateTime.Now.AddDays(2), DateTime.Now.AddDays(6)), new CalendarDateRange(DateTime.Now.AddDays(8), DateTime.Now.AddDays(12)) }; if (this.enableDatesSwitch != null) { @@ -314,6 +315,18 @@ namespace SampleBrowser.Maui.Calendar.SfCalendar this.enableSwipeSelectionGrid.IsVisible = true; } } + else if (calendar.SelectionMode == CalendarSelectionMode.MultiRange) + { + if (this.selectionDirectionGrid != null) + { + this.selectionDirectionGrid.IsVisible = false; + } + + if (this.enableSwipeSelectionGrid != null) + { + this.enableSwipeSelectionGrid.IsVisible = true; + } + } else { if (this.selectionDirectionGrid != null) diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/CartesianChartSamplesList.xml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/CartesianChartSamplesList.xml index 9842b4e6..26b18f3e 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/CartesianChartSamplesList.xml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/CartesianChartSamplesList.xml @@ -69,7 +69,7 @@ - + @@ -99,7 +99,7 @@ - + @@ -108,17 +108,17 @@ - + - + - + @@ -141,7 +141,7 @@ - + @@ -159,14 +159,14 @@ - - + + - + - - + + + + + + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/SampleBrowser.Maui.CartesianChart.csproj b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/SampleBrowser.Maui.CartesianChart.csproj index 8869a93b..67a213ae 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/SampleBrowser.Maui.CartesianChart.csproj +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/SampleBrowser.Maui.CartesianChart.csproj @@ -85,10 +85,10 @@ - - - - + + + + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/SampleBrowser.Maui.CartesianChart.nuspec b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/SampleBrowser.Maui.CartesianChart.nuspec index a040a6d2..e45948c1 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/SampleBrowser.Maui.CartesianChart.nuspec +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/SampleBrowser.Maui.CartesianChart.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png Cartesian chart component for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/SampleBrowser.Maui.CartesianChart.props b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/SampleBrowser.Maui.CartesianChart.props index 4bba301e..13297a14 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/SampleBrowser.Maui.CartesianChart.props +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/SampleBrowser.Maui.CartesianChart.props @@ -244,11 +244,23 @@ Samples\CartesianChart\Trackball\CartesianTrackball.xaml.cs CartesianTrackball.xaml + + + Samples\CartesianChart\Interactions\TapToAdd.xaml.cs + TapToAdd.xaml + + + Samples\CartesianChart\Interactions\AutoScrolling.xaml.cs + AutoScrolling.xaml Samples\CartesianChart\Zoom\ChartZooming.xaml.cs ChartZooming.xaml + + Samples\CartesianChart\Zoom\SelectionZooming.xaml.cs + SelectionZooming.xaml + Samples\CartesianChart\Legend\CartesianLegend.xaml.cs CartesianLegend.xaml @@ -348,10 +360,19 @@ Samples\CartesianChart\Trackball\CartesianTrackballViewModel.cs + + + Samples\CartesianChart\Interactions\TapToAddViewModel.cs + + + Samples\CartesianChart\Interactions\AutoScrollingViewModel.cs Samples\CartesianChart\Zoom\ZoomViewModel.cs + + Samples\CartesianChart\Zoom\SelectionZoomingViewModel.cs + Samples\CartesianChart\ViewModel\DynamicAnimationViewModel.cs @@ -721,6 +742,18 @@ Samples\CartesianChart\Trackball\CartesianTrackball.xaml + + + + + Samples\CartesianChart\Interactions\TapToAdd.xaml + + + + + + Samples\CartesianChart\Interactions\AutoScrolling.xaml + @@ -729,6 +762,12 @@ + + + Samples\CartesianChart\Zoom\SelectionZooming.xaml + + + Samples\CartesianChart\Legend\CartesianLegend.xaml diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Axis/NumericalAxis.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Axis/NumericalAxis.xaml index 5c7afa05..50fd6727 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Axis/NumericalAxis.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Axis/NumericalAxis.xaml @@ -9,7 +9,7 @@ - + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Bar/BarChart.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Bar/BarChart.xaml index fa80873a..9d655b4c 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Bar/BarChart.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Bar/BarChart.xaml @@ -9,7 +9,7 @@ - + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Bar/Bar_WidthCustomization.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Bar/Bar_WidthCustomization.xaml index d598b3ca..d2d35db5 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Bar/Bar_WidthCustomization.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Bar/Bar_WidthCustomization.xaml @@ -9,7 +9,7 @@ - + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/BoxAndWhisker/BoxAndWhisker.xaml.cs b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/BoxAndWhisker/BoxAndWhisker.xaml.cs index d25da810..1d21e580 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/BoxAndWhisker/BoxAndWhisker.xaml.cs +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/BoxAndWhisker/BoxAndWhisker.xaml.cs @@ -10,8 +10,10 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.Maui.Platform; using SampleBrowser.Maui.Base; using Syncfusion.Maui.Charts; +using MAUIPicker = Microsoft.Maui.Controls.Picker; namespace SampleBrowser.Maui.CartesianChart.SfCartesianChart { @@ -38,7 +40,7 @@ namespace SampleBrowser.Maui.CartesianChart.SfCartesianChart private void ModePicker_SelectedIndexChanged(object sender, EventArgs e) { - var picker = (Picker)sender; + var picker = (MAUIPicker)sender; int selectedIndex = picker.SelectedIndex; if (selectedIndex == 0) diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/BubbleChart/DefaultBubbleChart.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/BubbleChart/DefaultBubbleChart.xaml index 0944f465..69d98df3 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/BubbleChart/DefaultBubbleChart.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/BubbleChart/DefaultBubbleChart.xaml @@ -7,7 +7,7 @@ xmlns:chart="http://schemas.syncfusion.com/maui"> - + - diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Column/Column_Customization.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Column/Column_Customization.xaml index 50edb54e..8192105e 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Column/Column_Customization.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Column/Column_Customization.xaml @@ -9,7 +9,7 @@ - + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Column/Column_WidthCustomization.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Column/Column_WidthCustomization.xaml index 1611bca4..ec576593 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Column/Column_WidthCustomization.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Column/Column_WidthCustomization.xaml @@ -5,11 +5,11 @@ xmlns:localCore="clr-namespace:SampleBrowser.Maui.Base;assembly=SampleBrowser.Maui.Base" xmlns:chart="http://schemas.syncfusion.com/maui"> - + - + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/ErrorBar/ErrorBarChart.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/ErrorBar/ErrorBarChart.xaml index 194d86ed..7477b341 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/ErrorBar/ErrorBarChart.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/ErrorBar/ErrorBarChart.xaml @@ -13,7 +13,7 @@ LineBreakMode="WordWrap" Padding="0,0,0,5"/> - diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/ErrorBar/ErrorBarChart.xaml.cs b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/ErrorBar/ErrorBarChart.xaml.cs index f5027aeb..a2655cd6 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/ErrorBar/ErrorBarChart.xaml.cs +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/ErrorBar/ErrorBarChart.xaml.cs @@ -8,7 +8,7 @@ using SampleBrowser.Maui.Base; using Syncfusion.Maui.Charts; using System.Collections.ObjectModel; - +using MAUIPicker = Microsoft.Maui.Controls.Picker; namespace SampleBrowser.Maui.CartesianChart.SfCartesianChart { public partial class ErrorBarChart : SampleView @@ -44,7 +44,7 @@ namespace SampleBrowser.Maui.CartesianChart.SfCartesianChart private void typePicker_SelectedIndexChanged(object sender, EventArgs e) { - var picker = (Picker)sender; + var picker = (MAUIPicker)sender; int selectedIndex = picker.SelectedIndex; if (selectedIndex == 0) { @@ -66,7 +66,7 @@ namespace SampleBrowser.Maui.CartesianChart.SfCartesianChart private void modePicker_SelectedIndexChanged(object sender, EventArgs e) { - var picker = (Picker)sender; + var picker = (MAUIPicker)sender; int selectedIndex = picker.SelectedIndex; if (selectedIndex == 0) { @@ -92,7 +92,7 @@ namespace SampleBrowser.Maui.CartesianChart.SfCartesianChart private void directionPicker_SelectedIndexChanged(object sender, EventArgs e) { - var picker = (Picker)sender; + var picker = (MAUIPicker)sender; int selectedIndex = picker.SelectedIndex; if (selectedIndex == 0) { diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/ErrorBar/ErrorBarDefault.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/ErrorBar/ErrorBarDefault.xaml index 70487238..cf92ce96 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/ErrorBar/ErrorBarDefault.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/ErrorBar/ErrorBarDefault.xaml @@ -16,7 +16,7 @@ - diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/FinancialChart/CandleChart.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/FinancialChart/CandleChart.xaml index 8adbfa9e..f804412e 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/FinancialChart/CandleChart.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/FinancialChart/CandleChart.xaml @@ -13,7 +13,7 @@ - + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/FinancialChart/OHLC.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/FinancialChart/OHLC.xaml index 990b8a8a..c79727a4 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/FinancialChart/OHLC.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/FinancialChart/OHLC.xaml @@ -14,7 +14,7 @@ - + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Interactions/AutoScrolling.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Interactions/AutoScrolling.xaml new file mode 100644 index 00000000..ccbfceb8 --- /dev/null +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Interactions/AutoScrolling.xaml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Interactions/AutoScrolling.xaml.cs b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Interactions/AutoScrolling.xaml.cs new file mode 100644 index 00000000..03509b14 --- /dev/null +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Interactions/AutoScrolling.xaml.cs @@ -0,0 +1,38 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; +using Syncfusion.Maui.Charts; + +namespace SampleBrowser.Maui.CartesianChart.SfCartesianChart +{ + public partial class AutoScrolling : SampleView + { + public AutoScrolling() + { + InitializeComponent(); + } + + public override void OnAppearing() + { + base.OnAppearing(); + realTimeViewModel.StopTimer(); + realTimeViewModel.StartTimer(); + } + + public override void OnDisappearing() + { + base.OnDisappearing(); + if (realTimeViewModel != null) + { + realTimeViewModel.StopTimer(); + } + + categoryChart.Handler?.DisconnectHandler(); + } + } +} diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Interactions/AutoScrollingViewModel.cs b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Interactions/AutoScrollingViewModel.cs new file mode 100644 index 00000000..0e26a26b --- /dev/null +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Interactions/AutoScrollingViewModel.cs @@ -0,0 +1,62 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SampleBrowser.Maui.CartesianChart.SfCartesianChart +{ + public class AutoScrollingViewModel : BaseViewModel + { + private DateTime Date; + private int count; + readonly Random random = new(); + private bool canStopTimer; + + public ObservableCollection LiveChartData { get; set; } + + public AutoScrollingViewModel() + { + LiveChartData = new ObservableCollection(); + + } + + private bool UpdateVerticalData() + { + if (canStopTimer) return false; + + Date = Date.Add(TimeSpan.FromSeconds(1)); + LiveChartData.Add(new ChartDataModel(Date, random.Next(5, 48))); + count = count + 1; + return true; + } + + public void StopTimer() + { + canStopTimer = true; + count = 1; + } + + public void StartTimer() + { + LiveChartData.Clear(); + Date = new DateTime(2019, 1, 1, 01, 00, 00); + LiveChartData.Add(new ChartDataModel(Date, random.Next(5, 48))); + LiveChartData.Add(new ChartDataModel(Date.Add(TimeSpan.FromSeconds(1)), random.Next(5, 48))); + LiveChartData.Add(new ChartDataModel(Date.Add(TimeSpan.FromSeconds(2)), random.Next(5, 48))); + Date = Date.Add(TimeSpan.FromSeconds(2)); + canStopTimer = false; + count = 1; + if (Application.Current != null) + Application.Current.Dispatcher.StartTimer(new TimeSpan(0, 0, 0, 0,500), UpdateVerticalData); + } + } +} diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Interactions/TapToAdd.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Interactions/TapToAdd.xaml new file mode 100644 index 00000000..52b1d6de --- /dev/null +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Interactions/TapToAdd.xaml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Interactions/TapToAdd.xaml.cs b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Interactions/TapToAdd.xaml.cs new file mode 100644 index 00000000..20d3615c --- /dev/null +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Interactions/TapToAdd.xaml.cs @@ -0,0 +1,58 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; +using Syncfusion.Maui.Charts; +using System.Collections.ObjectModel; + +namespace SampleBrowser.Maui.CartesianChart.SfCartesianChart +{ + public partial class TapToAdd : SampleView + { + + public TapToAdd() + { + InitializeComponent(); + } + + public override void OnAppearing() + { + base.OnAppearing(); + } + + public override void OnDisappearing() + { + base.OnDisappearing(); + categoryChart.Handler?.DisconnectHandler(); + } + + private void TapGestureRecognizer_Tapped(object sender, EventArgs e) + { + realTimeViewModel?.ResetChartData(); + } + } + + public class ChartInteractionExt : ChartInteractiveBehavior + { + protected override void OnTouchUp(ChartBase chart, float pointX, float pointY) + { + base.OnTouchUp(chart, pointX, pointY); + + if(chart is Syncfusion.Maui.Charts.SfCartesianChart cartesianChart) + { + var x = cartesianChart.PointToValue(cartesianChart.XAxes[0], pointX, pointY); + var y = cartesianChart.PointToValue(cartesianChart.YAxes[0], pointX, pointY); + + if (cartesianChart.BindingContext is TapToAddViewModel viewModel) + { + viewModel.LiveChartData.Add(new ChartDataModel(x, y)); + } + } + } + } + +} diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Interactions/TapToAddViewModel.cs b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Interactions/TapToAddViewModel.cs new file mode 100644 index 00000000..0558ac2b --- /dev/null +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Interactions/TapToAddViewModel.cs @@ -0,0 +1,47 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SampleBrowser.Maui.CartesianChart.SfCartesianChart +{ + public class TapToAddViewModel : BaseViewModel + { + private ObservableCollection _items = new ObservableCollection(); + public ObservableCollection LiveChartData + { + get { return _items; } + set + { + _items = value; + + OnPropertyChanged("LiveChartData"); + } + } + + public TapToAddViewModel() + { + ResetChartData(); + } + + public void ResetChartData() + { + LiveChartData = new ObservableCollection() { + new ChartDataModel(1, 5), + new ChartDataModel(2, 8), + new ChartDataModel(3, 6), + new ChartDataModel(4, 8), + new ChartDataModel(5, 7.5) + }; + } + } +} diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Selection/Selection.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Selection/Selection.xaml index aafb2e75..22bdcc7a 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Selection/Selection.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Selection/Selection.xaml @@ -6,7 +6,7 @@ xmlns:chart="http://schemas.syncfusion.com/maui"> - + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Selection/SeriesSelection.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Selection/SeriesSelection.xaml index af0c8743..f2fa145d 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Selection/SeriesSelection.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Selection/SeriesSelection.xaml @@ -6,13 +6,13 @@ xmlns:chart="http://schemas.syncfusion.com/maui"> - + - + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/SplineChart/DashedSplineChart.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/SplineChart/DashedSplineChart.xaml index cb978690..f8ef32e2 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/SplineChart/DashedSplineChart.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/SplineChart/DashedSplineChart.xaml @@ -9,7 +9,7 @@ - + 6 diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/SplineChart/SplineChart.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/SplineChart/SplineChart.xaml index b08ff4dd..45649584 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/SplineChart/SplineChart.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/SplineChart/SplineChart.xaml @@ -10,7 +10,7 @@ - + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StackedColumn/StackedBar.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StackedColumn/StackedBar.xaml index 5bff622f..bc2740b9 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StackedColumn/StackedBar.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StackedColumn/StackedBar.xaml @@ -16,7 +16,7 @@ - + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StackedColumn/StackedColumnChart.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StackedColumn/StackedColumnChart.xaml index 78097a60..9169fc0a 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StackedColumn/StackedColumnChart.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StackedColumn/StackedColumnChart.xaml @@ -27,7 +27,7 @@ - + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StackedColumn100/GroupingStackedColumn100.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StackedColumn100/GroupingStackedColumn100.xaml index 9a5e4870..e0bdff6f 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StackedColumn100/GroupingStackedColumn100.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StackedColumn100/GroupingStackedColumn100.xaml @@ -12,7 +12,7 @@ - + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StackedColumn100/StackedBar100Chart.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StackedColumn100/StackedBar100Chart.xaml index 5fbe3f64..99d29aec 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StackedColumn100/StackedBar100Chart.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StackedColumn100/StackedBar100Chart.xaml @@ -11,7 +11,7 @@ - + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StackedColumn100/StackedColumn100Chart.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StackedColumn100/StackedColumn100Chart.xaml index 8278e323..82d33cfe 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StackedColumn100/StackedColumn100Chart.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StackedColumn100/StackedColumn100Chart.xaml @@ -11,7 +11,7 @@ - + - + @@ -17,7 +17,7 @@ LineBreakMode="WordWrap" Padding="0,0,0,5"/> - diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StepLineChart/DashedStepLineChart.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StepLineChart/DashedStepLineChart.xaml index 0ac1871e..9be46d22 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StepLineChart/DashedStepLineChart.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StepLineChart/DashedStepLineChart.xaml @@ -10,7 +10,7 @@ - + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StepLineChart/StepLineChart.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StepLineChart/StepLineChart.xaml index 71d4c8f9..45a87a14 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StepLineChart/StepLineChart.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StepLineChart/StepLineChart.xaml @@ -10,7 +10,7 @@ - + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StepLineChart/VerticalStepLineChart.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StepLineChart/VerticalStepLineChart.xaml index d7e8d114..d69e7466 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StepLineChart/VerticalStepLineChart.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/StepLineChart/VerticalStepLineChart.xaml @@ -9,7 +9,7 @@ - + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Tooltip/CartesianTooltip.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Tooltip/CartesianTooltip.xaml index ba6f5009..0f11e679 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Tooltip/CartesianTooltip.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Tooltip/CartesianTooltip.xaml @@ -9,7 +9,7 @@ - + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Trackball/CartesianTrackball.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Trackball/CartesianTrackball.xaml index a99a4b53..7736ac96 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Trackball/CartesianTrackball.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Trackball/CartesianTrackball.xaml @@ -7,7 +7,7 @@ - + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Trackball/CartesianTrackball.xaml.cs b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Trackball/CartesianTrackball.xaml.cs index 46ed37c5..4597d84a 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Trackball/CartesianTrackball.xaml.cs +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Trackball/CartesianTrackball.xaml.cs @@ -7,6 +7,7 @@ #endregion using SampleBrowser.Maui.Base; using Syncfusion.Maui.Charts; +using MAUIPicker = Microsoft.Maui.Controls.Picker; namespace SampleBrowser.Maui.CartesianChart.SfCartesianChart { @@ -25,7 +26,7 @@ namespace SampleBrowser.Maui.CartesianChart.SfCartesianChart private void picker_SelectedIndexChanged(object sender, EventArgs e) { - var picker = (Picker)sender; + var picker = (MAUIPicker)sender; int selectedIndex = picker.SelectedIndex; if (selectedIndex == 0) { diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Zoom/ChartZooming.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Zoom/ChartZooming.xaml index afff7d69..08f0c4a4 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Zoom/ChartZooming.xaml +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Zoom/ChartZooming.xaml @@ -7,7 +7,7 @@ - + @@ -30,8 +30,8 @@ + EdgeLabelsDrawingMode="Fit" + Maximum="100" Minimum="0" PlotOffsetStart="3" PlotOffsetEnd="3"> @@ -48,8 +48,37 @@ - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Zoom/ChartZooming.xaml.cs b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Zoom/ChartZooming.xaml.cs index c8ae3376..4a0585ba 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Zoom/ChartZooming.xaml.cs +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Zoom/ChartZooming.xaml.cs @@ -7,6 +7,7 @@ #endregion using SampleBrowser.Maui.Base; using Syncfusion.Maui.Charts; +using MAUIPicker = Microsoft.Maui.Controls.Picker; namespace SampleBrowser.Maui.CartesianChart.SfCartesianChart { @@ -22,5 +23,23 @@ namespace SampleBrowser.Maui.CartesianChart.SfCartesianChart base.OnDisappearing(); chart.Handler?.DisconnectHandler(); } + + private void ZoomModeChanged(object sender, EventArgs e) + { + var picker = (MAUIPicker)sender; + int selectedIndex = picker.SelectedIndex; + if (selectedIndex == 0) + { + zoomingBehavior.ZoomMode = ZoomMode.X; + } + else if (selectedIndex == 1) + { + zoomingBehavior.ZoomMode = ZoomMode.Y; + } + else if (selectedIndex == 2) + { + zoomingBehavior.ZoomMode = ZoomMode.XY; + } + } } } diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Zoom/SelectionZooming.xaml b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Zoom/SelectionZooming.xaml new file mode 100644 index 00000000..08b433f3 --- /dev/null +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Zoom/SelectionZooming.xaml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Zoom/SelectionZooming.xaml.cs b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Zoom/SelectionZooming.xaml.cs new file mode 100644 index 00000000..d89c4325 --- /dev/null +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Zoom/SelectionZooming.xaml.cs @@ -0,0 +1,26 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; +using Syncfusion.Maui.Charts; + +namespace SampleBrowser.Maui.CartesianChart.SfCartesianChart +{ + public partial class SelectionZooming : SampleView + { + public SelectionZooming() + { + InitializeComponent(); + } + + public override void OnDisappearing() + { + base.OnDisappearing(); + Chart.Handler?.DisconnectHandler(); + } + } +} \ No newline at end of file diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Zoom/SelectionZoomingViewModel.cs b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Zoom/SelectionZoomingViewModel.cs new file mode 100644 index 00000000..c79960f7 --- /dev/null +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Zoom/SelectionZoomingViewModel.cs @@ -0,0 +1,104 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.CartesianChart.SfCartesianChart; +using System.Collections.ObjectModel; + +namespace SampleBrowser.Maui.CartesianChart.SfCartesianChart +{ + class SelectionZoomingViewModel : BaseViewModel + { + public ObservableCollection MaleData { get; set; } + public ObservableCollection FemaleData { get; set; } + + public SelectionZoomingViewModel() + { + MaleData = new ObservableCollection() + { + new ChartDataModel( 161, 65 ), new ChartDataModel( 150, 65 ), new ChartDataModel(155, 65 ), new ChartDataModel(160, 65 ), + new ChartDataModel( 148, 66 ), new ChartDataModel( 145, 66 ), new ChartDataModel(137, 66 ), new ChartDataModel(138, 66 ), + new ChartDataModel( 162, 66 ), new ChartDataModel( 166, 66 ), new ChartDataModel(159, 66 ), new ChartDataModel(151, 66 ), + new ChartDataModel( 180, 66 ), new ChartDataModel( 181, 66 ), new ChartDataModel(174, 66 ), new ChartDataModel(159, 66 ), + new ChartDataModel( 151, 67 ), new ChartDataModel( 148, 67 ), new ChartDataModel(141, 67 ), new ChartDataModel(145, 67 ), + new ChartDataModel( 165, 67 ), new ChartDataModel( 168, 67 ), new ChartDataModel(159, 67 ), new ChartDataModel(183, 67 ), + new ChartDataModel( 188, 67 ), new ChartDataModel( 187, 67 ), new ChartDataModel(172, 67 ), new ChartDataModel(193, 67 ), + new ChartDataModel( 153, 68 ), new ChartDataModel( 153, 68 ), new ChartDataModel(147, 68 ), new ChartDataModel(163, 68 ), + new ChartDataModel( 174, 68 ), new ChartDataModel( 173, 68 ), new ChartDataModel(160, 68 ), new ChartDataModel(191, 68 ), + new ChartDataModel( 131, 62 ), new ChartDataModel( 140, 62 ), new ChartDataModel(149, 62 ), new ChartDataModel(115, 62 ), + new ChartDataModel( 164, 63 ), new ChartDataModel( 162, 63 ), new ChartDataModel(167, 63 ), new ChartDataModel(146, 63 ), + new ChartDataModel( 150, 64 ), new ChartDataModel( 141, 64 ), new ChartDataModel(142, 64 ), new ChartDataModel(129, 64 ), + new ChartDataModel( 159, 64 ), new ChartDataModel( 158, 64 ), new ChartDataModel(162, 64 ), new ChartDataModel(136, 64 ), + new ChartDataModel( 176, 64 ), new ChartDataModel( 170, 64 ), new ChartDataModel(167, 64 ), new ChartDataModel(144, 64 ), + new ChartDataModel( 143, 65 ), new ChartDataModel( 137, 65 ), new ChartDataModel(137, 65 ), new ChartDataModel(140, 65 ), + new ChartDataModel( 182, 65 ), new ChartDataModel( 168, 65 ), new ChartDataModel(181, 65 ), new ChartDataModel(165, 65 ), + new ChartDataModel( 214, 74 ), new ChartDataModel( 211, 74 ), new ChartDataModel(166, 74 ), new ChartDataModel(185, 74 ), + new ChartDataModel( 189, 68 ), new ChartDataModel( 182, 68 ), new ChartDataModel(181, 68 ), new ChartDataModel(196, 68 ), + new ChartDataModel( 152, 69 ), new ChartDataModel( 173, 69 ), new ChartDataModel(190, 69 ), new ChartDataModel(161, 69 ), + new ChartDataModel( 173, 69 ), new ChartDataModel( 185, 69 ), new ChartDataModel(141, 69 ), new ChartDataModel(149, 69 ), + new ChartDataModel( 134, 62 ), new ChartDataModel( 183, 62 ), new ChartDataModel(155, 62 ), new ChartDataModel(164, 62 ), + new ChartDataModel( 169, 62 ), new ChartDataModel( 122, 62 ), new ChartDataModel(161, 62 ), new ChartDataModel(166, 62 ), + new ChartDataModel( 137, 63 ), new ChartDataModel( 140, 63 ), new ChartDataModel(140, 63 ), new ChartDataModel(126, 63 ), + new ChartDataModel( 150, 63 ), new ChartDataModel( 153, 63 ), new ChartDataModel(154, 63 ), new ChartDataModel(139, 63 ), + new ChartDataModel( 186, 69 ), new ChartDataModel( 188, 69 ), new ChartDataModel(148, 69 ), new ChartDataModel(174, 69 ), + new ChartDataModel( 164, 70 ), new ChartDataModel( 182, 70 ), new ChartDataModel(200, 70 ), new ChartDataModel(151, 70 ), + new ChartDataModel( 204, 74 ), new ChartDataModel( 177, 74 ), new ChartDataModel(194, 74 ), new ChartDataModel(212, 74 ), + new ChartDataModel( 162, 70 ), new ChartDataModel( 200, 70 ), new ChartDataModel(166, 70 ), new ChartDataModel(177, 70 ), + new ChartDataModel( 188, 70 ), new ChartDataModel( 156, 70 ), new ChartDataModel(175, 70 ), new ChartDataModel(191, 70 ), + new ChartDataModel( 174, 71 ), new ChartDataModel( 187, 71 ), new ChartDataModel(208, 71 ), new ChartDataModel(166, 71 ), + new ChartDataModel( 150, 71 ), new ChartDataModel( 194, 71 ), new ChartDataModel(157, 71 ), new ChartDataModel(183, 71 ), + new ChartDataModel( 204, 71 ), new ChartDataModel( 162, 71 ), new ChartDataModel(179, 71 ), new ChartDataModel(196, 71 ), + new ChartDataModel( 170, 72 ), new ChartDataModel( 184, 72 ), new ChartDataModel(197, 72 ), new ChartDataModel(162, 72 ), + new ChartDataModel( 177, 72 ), new ChartDataModel( 203, 72 ), new ChartDataModel(159, 72 ), new ChartDataModel(178, 72 ), + new ChartDataModel( 198, 72 ), new ChartDataModel( 167, 72 ), new ChartDataModel(184, 72 ), new ChartDataModel(201, 72 ), + new ChartDataModel( 167, 73 ), new ChartDataModel( 178, 73 ), new ChartDataModel(215, 73 ), new ChartDataModel(207, 73 ), + new ChartDataModel( 172, 73 ), new ChartDataModel( 204, 73 ), new ChartDataModel(162, 73 ), new ChartDataModel(182, 73 ), + new ChartDataModel( 201, 73 ), new ChartDataModel( 172, 73 ), new ChartDataModel(189, 73 ), new ChartDataModel(206, 73 ), + new ChartDataModel( 150, 74 ), new ChartDataModel( 187, 74 ), new ChartDataModel(153, 74 ), new ChartDataModel(171, 74 ), + }; + + FemaleData = new ObservableCollection() + { + new ChartDataModel(115, 57 ), new ChartDataModel(138, 57 ), new ChartDataModel(166, 57 ), new ChartDataModel(122, 57 ), + new ChartDataModel(126, 57 ), new ChartDataModel(130, 57 ), new ChartDataModel(125, 57 ), new ChartDataModel(144, 57 ), + new ChartDataModel(150, 57 ), new ChartDataModel(120, 57 ), new ChartDataModel(125, 57 ), new ChartDataModel(130, 57 ), + new ChartDataModel(103, 58 ), new ChartDataModel(116, 58 ), new ChartDataModel(130, 58 ), new ChartDataModel(126, 58 ), + new ChartDataModel(136, 58 ), new ChartDataModel(148, 58 ), new ChartDataModel(119, 58 ), new ChartDataModel(141, 58 ), + new ChartDataModel(159, 58 ), new ChartDataModel(120, 58 ), new ChartDataModel(135, 58 ), new ChartDataModel(163, 58 ), + new ChartDataModel(119, 59 ), new ChartDataModel(131, 59 ), new ChartDataModel(148, 59 ), new ChartDataModel(123, 59 ), + new ChartDataModel(137, 59 ), new ChartDataModel(149, 59 ), new ChartDataModel(121, 59 ), new ChartDataModel(142, 59 ), + new ChartDataModel(160, 59 ), new ChartDataModel(118, 59 ), new ChartDataModel(130, 59 ), new ChartDataModel(146, 59 ), + new ChartDataModel(119, 60 ), new ChartDataModel(133, 60 ), new ChartDataModel(150, 60 ), new ChartDataModel(133, 60 ), + new ChartDataModel(149, 60 ), new ChartDataModel(165, 60 ), new ChartDataModel(130, 60 ), new ChartDataModel(139, 60 ), + new ChartDataModel(154, 60 ), new ChartDataModel(118, 60 ), new ChartDataModel(152, 60 ), new ChartDataModel(154, 60 ), + new ChartDataModel(130, 61 ), new ChartDataModel(145, 61 ), new ChartDataModel(166, 61 ), new ChartDataModel(131, 61 ), + new ChartDataModel(143, 61 ), new ChartDataModel(162, 61 ), new ChartDataModel(131, 61 ), new ChartDataModel(145, 61 ), + new ChartDataModel(162, 61 ), new ChartDataModel(115, 61 ), new ChartDataModel(149, 61 ), new ChartDataModel(183, 61 ), + new ChartDataModel(121, 62 ), new ChartDataModel(139, 62 ), new ChartDataModel(159, 62 ), new ChartDataModel(135, 62 ), + new ChartDataModel(152, 62 ), new ChartDataModel(178, 62 ), new ChartDataModel(130, 62 ), new ChartDataModel(153, 62 ), + new ChartDataModel(172, 62 ), new ChartDataModel(114, 62 ), new ChartDataModel(135, 62 ), new ChartDataModel(154, 62 ), + new ChartDataModel(126, 63 ), new ChartDataModel(141, 63 ), new ChartDataModel(160, 63 ), new ChartDataModel(135, 63 ), + new ChartDataModel(149, 63 ), new ChartDataModel(180, 63 ), new ChartDataModel(132, 63 ), new ChartDataModel(144, 63 ), + new ChartDataModel(163, 63 ), new ChartDataModel(122, 63 ), new ChartDataModel(146, 63 ), new ChartDataModel(156, 63 ), + new ChartDataModel(133, 64 ), new ChartDataModel(150, 64 ), new ChartDataModel(176, 64 ), new ChartDataModel(133, 64 ), + new ChartDataModel(149, 64 ), new ChartDataModel(176, 64 ), new ChartDataModel(136, 64 ), new ChartDataModel(157, 64 ), + new ChartDataModel(174, 64 ), new ChartDataModel(131, 64 ), new ChartDataModel(155, 64 ), new ChartDataModel(191, 64 ), + new ChartDataModel(136, 65 ), new ChartDataModel(149, 65 ), new ChartDataModel(177, 65 ), new ChartDataModel(143, 65 ), + new ChartDataModel(149, 65 ), new ChartDataModel(184, 65 ), new ChartDataModel(128, 65 ), new ChartDataModel(146, 65 ), + new ChartDataModel(157, 65 ), new ChartDataModel(133, 65 ), new ChartDataModel(153, 65 ), new ChartDataModel(173, 65 ), + new ChartDataModel(141, 66 ), new ChartDataModel(156, 66 ), new ChartDataModel(175, 66 ), new ChartDataModel(125, 66 ), + new ChartDataModel(138, 66 ), new ChartDataModel(165, 66 ), new ChartDataModel(122, 66 ), new ChartDataModel(164, 66 ), + new ChartDataModel(182, 66 ), new ChartDataModel(137, 66 ), new ChartDataModel(157, 66 ), new ChartDataModel(176, 66 ), + new ChartDataModel(149, 67 ), new ChartDataModel(159, 67 ), new ChartDataModel(179, 67 ), new ChartDataModel(156, 67 ), + new ChartDataModel(179, 67 ), new ChartDataModel(186, 67 ), new ChartDataModel(147, 67 ), new ChartDataModel(166, 67 ), + new ChartDataModel(185, 67 ), new ChartDataModel(140, 67 ), new ChartDataModel(160, 67 ), new ChartDataModel(180, 67 ), + new ChartDataModel(145, 68 ), new ChartDataModel(155, 68 ), new ChartDataModel(170, 68 ), new ChartDataModel(129, 68 ), + new ChartDataModel(164, 68 ), new ChartDataModel(189, 68 ), new ChartDataModel(150, 68 ), new ChartDataModel(157, 68 ), + new ChartDataModel(183, 68 ), new ChartDataModel(144, 68 ), new ChartDataModel(170, 68 ), new ChartDataModel(180, 68 ) + }; + } + } +} diff --git a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Zoom/ZoomViewModel.cs b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Zoom/ZoomViewModel.cs index fac5665e..2275e436 100644 --- a/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Zoom/ZoomViewModel.cs +++ b/MAUI/CartesianChart/SampleBrowser.Maui.CartesianChart/Samples/CartesianChart/Zoom/ZoomViewModel.cs @@ -14,6 +14,8 @@ namespace SampleBrowser.Maui.CartesianChart.SfCartesianChart { public ObservableCollection ZoomData { get; set; } + public string[] ZoomModeType => new string[] { "X", "Y", "XY" }; + public ZoomViewModel() { DateTime date = new(1950, 3, 01); diff --git a/MAUI/Chips/SampleBrowser.Maui.Chips/ChipsSamplesList.xml b/MAUI/Chips/SampleBrowser.Maui.Chips/ChipsSamplesList.xml index 4e94b722..82b4e4a2 100644 --- a/MAUI/Chips/SampleBrowser.Maui.Chips/ChipsSamplesList.xml +++ b/MAUI/Chips/SampleBrowser.Maui.Chips/ChipsSamplesList.xml @@ -1,7 +1,7 @@ - + diff --git a/MAUI/Chips/SampleBrowser.Maui.Chips/SampleBrowser.Maui.Chips.csproj b/MAUI/Chips/SampleBrowser.Maui.Chips/SampleBrowser.Maui.Chips.csproj index 90d0e746..32a79b5a 100644 --- a/MAUI/Chips/SampleBrowser.Maui.Chips/SampleBrowser.Maui.Chips.csproj +++ b/MAUI/Chips/SampleBrowser.Maui.Chips/SampleBrowser.Maui.Chips.csproj @@ -51,6 +51,7 @@ true 5 + @@ -80,9 +81,9 @@ - - - + + + diff --git a/MAUI/Chips/SampleBrowser.Maui.Chips/SampleBrowser.Maui.Chips.nuspec b/MAUI/Chips/SampleBrowser.Maui.Chips/SampleBrowser.Maui.Chips.nuspec index 73206f74..8f225c89 100644 --- a/MAUI/Chips/SampleBrowser.Maui.Chips/SampleBrowser.Maui.Chips.nuspec +++ b/MAUI/Chips/SampleBrowser.Maui.Chips/SampleBrowser.Maui.Chips.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png Chip component for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MAUI/Chips/SampleBrowser.Maui.Chips/Samples/Chips/ChipCustomization/ChipCustomizationDesktop.xaml b/MAUI/Chips/SampleBrowser.Maui.Chips/Samples/Chips/ChipCustomization/ChipCustomizationDesktop.xaml index e1b1e7ec..e97675c4 100644 --- a/MAUI/Chips/SampleBrowser.Maui.Chips/Samples/Chips/ChipCustomization/ChipCustomizationDesktop.xaml +++ b/MAUI/Chips/SampleBrowser.Maui.Chips/Samples/Chips/ChipCustomization/ChipCustomizationDesktop.xaml @@ -316,4 +316,4 @@ - \ No newline at end of file + diff --git a/MAUI/Chips/SampleBrowser.Maui.Chips/Samples/Chips/ChipCustomization/ChipCustomizationMobile.xaml b/MAUI/Chips/SampleBrowser.Maui.Chips/Samples/Chips/ChipCustomization/ChipCustomizationMobile.xaml index 9fbdd3c3..075fae7e 100644 --- a/MAUI/Chips/SampleBrowser.Maui.Chips/Samples/Chips/ChipCustomization/ChipCustomizationMobile.xaml +++ b/MAUI/Chips/SampleBrowser.Maui.Chips/Samples/Chips/ChipCustomization/ChipCustomizationMobile.xaml @@ -39,7 +39,7 @@ TextColor="{Binding TextColor}" CloseButtonColor="{Binding TextColor}" SelectionIndicatorColor="{Binding TextColor}" - BackgroundColor="{Binding BackgroundColor,Mode=TwoWay}" + Background="{Binding BackgroundColor,Mode=TwoWay}" Text="{Binding Text,Mode=TwoWay}" ShowIcon="{Binding IsShownIcon}" ShowCloseButton="{Binding IsShownCloseButton}" diff --git a/MAUI/Chips/SampleBrowser.Maui.Chips/Samples/Chips/ChipCustomization/ChipCustomizationMobile.xaml.cs b/MAUI/Chips/SampleBrowser.Maui.Chips/Samples/Chips/ChipCustomization/ChipCustomizationMobile.xaml.cs index a7bfc356..d411455a 100644 --- a/MAUI/Chips/SampleBrowser.Maui.Chips/Samples/Chips/ChipCustomization/ChipCustomizationMobile.xaml.cs +++ b/MAUI/Chips/SampleBrowser.Maui.Chips/Samples/Chips/ChipCustomization/ChipCustomizationMobile.xaml.cs @@ -53,27 +53,28 @@ public partial class ChipCustomizationMobile : SampleView } private void BackgroundColorSegment_Clicked(object sender, EventArgs e) { - chip.BackgroundColor = Color.FromArgb("#f2f3f4"); + chip.Background = new SolidColorBrush(Color.FromArgb("#f2f3f4")); } private void BackgroundColorSegment_Clicked_1(object sender, EventArgs e) { - chip.BackgroundColor = Color.FromArgb("#c6c6c6"); + chip.Background = new SolidColorBrush(Color.FromArgb("#c6c6c6")); + } private void BackgroundColorSegment_Clicked_2(object sender, EventArgs e) { - chip.BackgroundColor = Color.FromArgb("#538eed"); + chip.Background = new SolidColorBrush(Color.FromArgb("#538eed")); } private void BackgroundColorSegment_Clicked_3(object sender, EventArgs e) { - chip.BackgroundColor = Color.FromArgb("#af2463"); + chip.Background = new SolidColorBrush(Color.FromArgb("#af2463")); } private void BackgroundColorSegment_Clicked_4(object sender, EventArgs e) { - chip.BackgroundColor = Color.FromArgb("#000000"); + chip.Background = new SolidColorBrush(Color.FromArgb("#000000")); } private void BorderColorSegment_Clicked(object sender, EventArgs e) diff --git a/MAUI/Chips/SampleBrowser.Maui.Chips/Samples/Chips/ChipTypes/ChipTypesDesktop.xaml b/MAUI/Chips/SampleBrowser.Maui.Chips/Samples/Chips/ChipTypes/ChipTypesDesktop.xaml index 87fc7e27..d7975245 100644 --- a/MAUI/Chips/SampleBrowser.Maui.Chips/Samples/Chips/ChipTypes/ChipTypesDesktop.xaml +++ b/MAUI/Chips/SampleBrowser.Maui.Chips/Samples/Chips/ChipTypes/ChipTypesDesktop.xaml @@ -164,4 +164,4 @@ - \ No newline at end of file + diff --git a/MAUI/CircularChart/SampleBrowser.Maui.CircularChart/CircularChartSamplesList.xml b/MAUI/CircularChart/SampleBrowser.Maui.CircularChart/CircularChartSamplesList.xml index 365794b3..707b87b1 100644 --- a/MAUI/CircularChart/SampleBrowser.Maui.CircularChart/CircularChartSamplesList.xml +++ b/MAUI/CircularChart/SampleBrowser.Maui.CircularChart/CircularChartSamplesList.xml @@ -1,21 +1,21 @@ - + - + - + diff --git a/MAUI/CircularChart/SampleBrowser.Maui.CircularChart/SampleBrowser.Maui.CircularChart.csproj b/MAUI/CircularChart/SampleBrowser.Maui.CircularChart/SampleBrowser.Maui.CircularChart.csproj index c41d7a01..6fb2c9eb 100644 --- a/MAUI/CircularChart/SampleBrowser.Maui.CircularChart/SampleBrowser.Maui.CircularChart.csproj +++ b/MAUI/CircularChart/SampleBrowser.Maui.CircularChart/SampleBrowser.Maui.CircularChart.csproj @@ -85,10 +85,10 @@ - - - - + + + + diff --git a/MAUI/CircularChart/SampleBrowser.Maui.CircularChart/SampleBrowser.Maui.CircularChart.nuspec b/MAUI/CircularChart/SampleBrowser.Maui.CircularChart/SampleBrowser.Maui.CircularChart.nuspec index 6f8f988b..c177194b 100644 --- a/MAUI/CircularChart/SampleBrowser.Maui.CircularChart/SampleBrowser.Maui.CircularChart.nuspec +++ b/MAUI/CircularChart/SampleBrowser.Maui.CircularChart/SampleBrowser.Maui.CircularChart.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png Circular chart component for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/MAUI/CircularChart/SampleBrowser.Maui.CircularChart/Samples/CircularChart/Doughnut/GroupToDoughnutChart.xaml b/MAUI/CircularChart/SampleBrowser.Maui.CircularChart/Samples/CircularChart/Doughnut/GroupToDoughnutChart.xaml index 4b511361..3649ed57 100644 --- a/MAUI/CircularChart/SampleBrowser.Maui.CircularChart/Samples/CircularChart/Doughnut/GroupToDoughnutChart.xaml +++ b/MAUI/CircularChart/SampleBrowser.Maui.CircularChart/Samples/CircularChart/Doughnut/GroupToDoughnutChart.xaml @@ -17,7 +17,7 @@ - + - + - + diff --git a/MAUI/CircularChart/SampleBrowser.Maui.CircularChart/Samples/CircularChart/RadialBar/RadialBarChart.xaml.cs b/MAUI/CircularChart/SampleBrowser.Maui.CircularChart/Samples/CircularChart/RadialBar/RadialBarChart.xaml.cs index 02a7f0e7..5e2c61a4 100644 --- a/MAUI/CircularChart/SampleBrowser.Maui.CircularChart/Samples/CircularChart/RadialBar/RadialBarChart.xaml.cs +++ b/MAUI/CircularChart/SampleBrowser.Maui.CircularChart/Samples/CircularChart/RadialBar/RadialBarChart.xaml.cs @@ -6,6 +6,7 @@ // applicable laws. #endregion using SampleBrowser.Maui.Base; +using MAUIPicker = Microsoft.Maui.Controls.Picker; namespace SampleBrowser.Maui.CircularChart.SfCircularChart { @@ -47,7 +48,7 @@ namespace SampleBrowser.Maui.CircularChart.SfCircularChart private void trackStroke_SelectedIndexChanged(object sender, EventArgs e) { - var value = (Picker)sender; + var value = (MAUIPicker)sender; switch (value.SelectedIndex) { case 0: @@ -79,7 +80,7 @@ namespace SampleBrowser.Maui.CircularChart.SfCircularChart private void trackFill_SelectedIndexChanged(object sender, EventArgs e) { - var value = (Picker)sender; + var value = (MAUIPicker)sender; switch (value.SelectedIndex) { case 0: diff --git a/MAUI/DataForm/SampleBrowser.Maui.DataForm/DataFormSamplesList.xml b/MAUI/DataForm/SampleBrowser.Maui.DataForm/DataFormSamplesList.xml index 9ca7726a..a43060a1 100644 --- a/MAUI/DataForm/SampleBrowser.Maui.DataForm/DataFormSamplesList.xml +++ b/MAUI/DataForm/SampleBrowser.Maui.DataForm/DataFormSamplesList.xml @@ -2,12 +2,11 @@ - - + + diff --git a/MAUI/DataForm/SampleBrowser.Maui.DataForm/SampleBrowser.Maui.DataForm.csproj b/MAUI/DataForm/SampleBrowser.Maui.DataForm/SampleBrowser.Maui.DataForm.csproj index f3d61899..da7a5809 100644 --- a/MAUI/DataForm/SampleBrowser.Maui.DataForm/SampleBrowser.Maui.DataForm.csproj +++ b/MAUI/DataForm/SampleBrowser.Maui.DataForm/SampleBrowser.Maui.DataForm.csproj @@ -79,14 +79,14 @@ - - - - - - - - - + + + + + + + + + diff --git a/MAUI/DataForm/SampleBrowser.Maui.DataForm/SampleBrowser.Maui.DataForm.nuspec b/MAUI/DataForm/SampleBrowser.Maui.DataForm/SampleBrowser.Maui.DataForm.nuspec index 57497eb8..aa0501de 100644 --- a/MAUI/DataForm/SampleBrowser.Maui.DataForm/SampleBrowser.Maui.DataForm.nuspec +++ b/MAUI/DataForm/SampleBrowser.Maui.DataForm/SampleBrowser.Maui.DataForm.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png DataForm component for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MAUI/DataForm/SampleBrowser.Maui.DataForm/Samples/DataForm/ContactForm/View/ContactForm.xaml b/MAUI/DataForm/SampleBrowser.Maui.DataForm/Samples/DataForm/ContactForm/View/ContactForm.xaml index 3a2948a4..706d3b2f 100644 --- a/MAUI/DataForm/SampleBrowser.Maui.DataForm/Samples/DataForm/ContactForm/View/ContactForm.xaml +++ b/MAUI/DataForm/SampleBrowser.Maui.DataForm/Samples/DataForm/ContactForm/View/ContactForm.xaml @@ -5,7 +5,7 @@ xmlns:converters="clr-namespace:SampleBrowser.Maui.Base.Converters;assembly=SampleBrowser.Maui.Base" xmlns:dataForm="clr-namespace:Syncfusion.Maui.DataForm;assembly=Syncfusion.Maui.DataForm" xmlns:sys="clr-namespace:System;assembly=System.Runtime" - Background="{OnIdiom Default=White, Desktop=WhiteSmoke}" + Background="{OnPlatform Default=White, WinUI=WhiteSmoke, MacCatalyst=WhiteSmoke}" xmlns:thickness ="clr-namespace:Microsoft.Maui;assembly=Microsoft.Maui" xmlns:localCore="clr-namespace:SampleBrowser.Maui.Base;assembly=SampleBrowser.Maui.Base"> @@ -23,13 +23,13 @@ + IsVisible="{OnPlatform WinUI=True, MacCatalyst=True, Default=False}"/> - + HorizontalOptions="{OnPlatform WinUI=Center, MacCatalyst=Center, Default=Fill}" Padding="0"> diff --git a/MAUI/DataForm/SampleBrowser.Maui.DataForm/Samples/DataForm/EventRegistration/View/EventRegistration.xaml b/MAUI/DataForm/SampleBrowser.Maui.DataForm/Samples/DataForm/EventRegistration/View/EventRegistration.xaml index 564c15af..42ee5858 100644 --- a/MAUI/DataForm/SampleBrowser.Maui.DataForm/Samples/DataForm/EventRegistration/View/EventRegistration.xaml +++ b/MAUI/DataForm/SampleBrowser.Maui.DataForm/Samples/DataForm/EventRegistration/View/EventRegistration.xaml @@ -3,7 +3,7 @@ x:Class="SampleBrowser.Maui.DataForm.SfDataForm.EventRegistration" xmlns:dataForm="clr-namespace:Syncfusion.Maui.DataForm;assembly=Syncfusion.Maui.DataForm" xmlns:local="clr-namespace:SampleBrowser.Maui.DataForm.SfDataForm" - Background="{OnIdiom Default=White, Desktop=WhiteSmoke}" + Background="{OnPlatform Default=White, WinUI=WhiteSmoke, MacCatalyst=WhiteSmoke}" xmlns:thickness ="clr-namespace:Microsoft.Maui;assembly=Microsoft.Maui" xmlns:converters="clr-namespace:SampleBrowser.Maui.Base.Converters;assembly=SampleBrowser.Maui.Base" xmlns:imageExtension="clr-namespace:SampleBrowser.Maui.Base.Converters;assembly=SampleBrowser.Maui.Base" @@ -18,7 +18,7 @@ - - @@ -41,7 +41,7 @@ - + @@ -51,7 +51,7 @@ diff --git a/MAUI/DataForm/SampleBrowser.Maui.DataForm/Samples/DataForm/FeedbackForm/View/FeedbackForm.xaml b/MAUI/DataForm/SampleBrowser.Maui.DataForm/Samples/DataForm/FeedbackForm/View/FeedbackForm.xaml index f4d993e2..ae8f266f 100644 --- a/MAUI/DataForm/SampleBrowser.Maui.DataForm/Samples/DataForm/FeedbackForm/View/FeedbackForm.xaml +++ b/MAUI/DataForm/SampleBrowser.Maui.DataForm/Samples/DataForm/FeedbackForm/View/FeedbackForm.xaml @@ -3,7 +3,7 @@ x:Class="SampleBrowser.Maui.DataForm.SfDataForm.FeedbackForm" xmlns:dataForm="clr-namespace:Syncfusion.Maui.DataForm;assembly=Syncfusion.Maui.DataForm" xmlns:local="clr-namespace:SampleBrowser.Maui.DataForm.SfDataForm" - Background="{OnIdiom Default=White, Desktop=WhiteSmoke}" + Background="{OnPlatform Default=White, WinUI=WhiteSmoke, MacCatalyst=WhiteSmoke}" xmlns:converters="clr-namespace:SampleBrowser.Maui.Base.Converters;assembly=SampleBrowser.Maui.Base" xmlns:thickness ="clr-namespace:Microsoft.Maui;assembly=Microsoft.Maui" xmlns:localCore="clr-namespace:SampleBrowser.Maui.Base;assembly=SampleBrowser.Maui.Base"> @@ -17,13 +17,13 @@ - + - @@ -39,21 +39,21 @@ - - + + - + - + IsVisible="{OnPlatform WinUI=True, MacCatalyst=True, Default=False}"/> + HorizontalOptions="{OnPlatform WinUI=Center, MacCatalyst=Center, Default=Fill}" > @@ -62,7 +62,7 @@ FocusedStroke="{StaticResource Primary}"/> - + @@ -17,7 +17,7 @@ - + @@ -27,11 +27,11 @@ + HorizontalOptions="{OnPlatform WinUI=Start, MacCatalyst=Start, Default=Fill}" Margin="0"> @@ -63,9 +63,9 @@ - - - + + + - + - @@ -48,12 +48,12 @@ + HorizontalOptions="{OnPlatform WinUI=Center, MacCatalyst=Center, Default=Fill}" > @@ -77,7 +77,7 @@ ContainerType="Filled"/> - + - - + + + CodeViewerPath="DataGrid/ColumnTypes/" VideoLink="https://www.youtube.com/watch?v=tLNua3iGnGE"/> + CodeViewerPath="DataGrid/ColumnSizing/" VideoLink="https://www.youtube.com/watch?v=vtMmQIWyipU"/> + CodeViewerPath="DataGrid/Sorting/" VideoLink="https://www.youtube.com/watch?v=5PhyEYLbGT4"/> - + Description = "This sample illustrates custom sorting in a DataGrid. The name column is sorted according to the length of a cell value." CodeViewerPath="DataGrid/CustomSorting/" VideoLink="https://www.youtube.com/watch?v=5PhyEYLbGT4" /> + - + - - + + - - + CodeViewerPath="DataGrid/Selection/" VideoLink="https://www.youtube.com/watch?v=mN95SPfVcHo"/> + + + CodeViewerPath="DataGrid/RowHeight/" VideoLink="https://www.youtube.com/watch?v=vtMmQIWyipU" /> + CodeViewerPath="DataGrid/Styling/" VideoLink="https://www.youtube.com/watch?v=1HHHz5isIM4"/> + CodeViewerPath="DataGrid/ConditionalStyling/" VideoLink="https://www.youtube.com/watch?v=1HHHz5isIM4"/> - diff --git a/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/MauiProgram.cs b/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/MauiProgram.cs index 506059c1..ad46feb8 100644 --- a/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/MauiProgram.cs +++ b/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/MauiProgram.cs @@ -6,6 +6,7 @@ // applicable laws. #endregion using Syncfusion.Maui.Core.Hosting; +using SampleBrowser.Maui.Base.Hosting; namespace SampleBrowser.Maui.DataGrid; public static class MauiProgram @@ -21,7 +22,7 @@ public static class MauiProgram fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); }); - + builder.ConfigureSampleBrowserBase(); return builder.Build(); } } diff --git a/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/SampleBrowser.Maui.DataGrid.csproj b/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/SampleBrowser.Maui.DataGrid.csproj index 5b4864c3..3dd83b56 100644 --- a/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/SampleBrowser.Maui.DataGrid.csproj +++ b/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/SampleBrowser.Maui.DataGrid.csproj @@ -76,17 +76,17 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/SampleBrowser.Maui.DataGrid.nuspec b/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/SampleBrowser.Maui.DataGrid.nuspec index 61a83552..4824c4c5 100644 --- a/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/SampleBrowser.Maui.DataGrid.nuspec +++ b/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/SampleBrowser.Maui.DataGrid.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png ListView component for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Filtering/Filtering.xaml b/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Filtering/Filtering.xaml index 57335afc..253a8d13 100644 --- a/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Filtering/Filtering.xaml +++ b/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Filtering/Filtering.xaml @@ -45,10 +45,10 @@ > - + HorizontalOptions="FillAndExpand" BackgroundColor="Transparent"> - + diff --git a/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Helpers/Behaviors/ColumnSizingBehavior.cs b/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Helpers/Behaviors/ColumnSizingBehavior.cs index 9b579979..d4a0fa7c 100644 --- a/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Helpers/Behaviors/ColumnSizingBehavior.cs +++ b/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Helpers/Behaviors/ColumnSizingBehavior.cs @@ -17,12 +17,12 @@ namespace SampleBrowser.Maui.DataGrid public class ColumnSizingBehavior : Behavior { private Syncfusion.Maui.DataGrid.SfDataGrid? datagrid; - private Picker? columnSizingPicker; + private Microsoft.Maui.Controls.Picker? columnSizingPicker; protected override void OnAttachedTo(SampleView bindable) { datagrid = bindable.FindByName("dataGrid"); - columnSizingPicker = bindable.FindByName("ColumnSizingPicker"); + columnSizingPicker = bindable.FindByName("ColumnSizingPicker"); columnSizingPicker.SelectedIndexChanged += ColumnSizingPicker_SelectedIndexChanged; base.OnAttachedTo(bindable); diff --git a/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Helpers/Behaviors/DataBindingBehavior.cs b/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Helpers/Behaviors/DataBindingBehavior.cs index fc2a5dc6..ceda2c9f 100644 --- a/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Helpers/Behaviors/DataBindingBehavior.cs +++ b/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Helpers/Behaviors/DataBindingBehavior.cs @@ -20,7 +20,7 @@ namespace SampleBrowser.Maui.DataGrid { private Syncfusion.Maui.DataGrid.SfDataGrid? datagrid; - private Picker? collectionTypePicker; + private Microsoft.Maui.Controls.Picker? collectionTypePicker; private OrderInfoViewModel? orderInfoViewModel; @@ -32,7 +32,7 @@ namespace SampleBrowser.Maui.DataGrid { this.datagrid = bindable.FindByName("dataGrid"); this.orderInfoViewModel = new OrderInfoViewModel(); - this.collectionTypePicker = bindable.FindByName("CollectionTypePicker"); + this.collectionTypePicker = bindable.FindByName("CollectionTypePicker"); this.collectionTypePicker.SelectedIndexChanged += this.SelectionPicker_SelectedIndexChanged!; base.OnAttachedTo(bindable); diff --git a/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Helpers/Behaviors/FilteringBehavior.cs b/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Helpers/Behaviors/FilteringBehavior.cs index 9aa09a85..845a0b2b 100644 --- a/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Helpers/Behaviors/FilteringBehavior.cs +++ b/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Helpers/Behaviors/FilteringBehavior.cs @@ -20,8 +20,8 @@ namespace SampleBrowser.Maui.DataGrid private Syncfusion.Maui.DataGrid.SfDataGrid? dataGrid; private OrderInfoViewModel? viewModel; - private Picker? optionsList; - private Picker? columnsList; + private Microsoft.Maui.Controls.Picker? optionsList; + private Microsoft.Maui.Controls.Picker? columnsList; private SearchBar? filterText; /// @@ -31,7 +31,7 @@ namespace SampleBrowser.Maui.DataGrid /// OnColumnsSelectionChanged event args public void OnColumnsSelectionChanged(object sender, EventArgs e) { - Picker newPicker = (Picker)sender; + Microsoft.Maui.Controls.Picker newPicker = (Microsoft.Maui.Controls.Picker)sender; this.viewModel!.SelectedColumn = GetColumnMappingName((string)newPicker.SelectedItem); if (this.viewModel.SelectedColumn == "All Columns") { @@ -91,7 +91,7 @@ namespace SampleBrowser.Maui.DataGrid /// OnFilterOptionsChanged event args e public void OnFilterOptionsChanged(object sender, EventArgs e) { - Picker newPicker = (Picker)sender; + Microsoft.Maui.Controls.Picker newPicker = (Microsoft.Maui.Controls.Picker)sender; if (newPicker.SelectedIndex >= 0) { this.viewModel!.SelectedCondition = GetSelectedCondition(newPicker.Items[newPicker.SelectedIndex]); @@ -140,8 +140,8 @@ namespace SampleBrowser.Maui.DataGrid this.viewModel = new OrderInfoViewModel(); this.dataGrid = bindAble.FindByName("dataGrid"); bindAble.BindingContext = this.viewModel; - this.optionsList = bindAble.FindByName("OptionsList"); - this.columnsList = bindAble.FindByName("ColumnsList"); + this.optionsList = bindAble.FindByName("OptionsList"); + this.columnsList = bindAble.FindByName("ColumnsList"); this.filterText = bindAble.FindByName("filterText"); this.columnsList.SelectedIndex = 0; diff --git a/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Helpers/Behaviors/SelectionBehavior.cs b/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Helpers/Behaviors/SelectionBehavior.cs index 33720b17..390dde05 100644 --- a/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Helpers/Behaviors/SelectionBehavior.cs +++ b/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Helpers/Behaviors/SelectionBehavior.cs @@ -16,13 +16,13 @@ namespace SampleBrowser.Maui.DataGrid { public class SelectionBehavior : Behavior { - private Picker? selectionPicker; + private Microsoft.Maui.Controls.Picker? selectionPicker; private Syncfusion.Maui.DataGrid.SfDataGrid? datagrid; protected override void OnAttachedTo(SampleView bindable) { this.datagrid = bindable.FindByName("dataGrid"); - this.selectionPicker = bindable.FindByName("SelectionPicker"); + this.selectionPicker = bindable.FindByName("SelectionPicker"); selectionPicker.SelectedIndexChanged += SelectionPicker_SelectedIndexChanged; base.OnAttachedTo(bindable); diff --git a/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Helpers/Behaviors/StylingBehavior.cs b/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Helpers/Behaviors/StylingBehavior.cs index 84b57286..9afd1b85 100644 --- a/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Helpers/Behaviors/StylingBehavior.cs +++ b/MAUI/DataGrid/SampleBrowser.Maui.DataGrid/Samples/DataGrid/Helpers/Behaviors/StylingBehavior.cs @@ -16,15 +16,15 @@ namespace SampleBrowser.Maui.DataGrid { public class StylingBehavior : Behavior { - private Picker? visibilityPicker; - private Picker? headerVisibilityPicker; + private Microsoft.Maui.Controls.Picker? visibilityPicker; + private Microsoft.Maui.Controls.Picker? headerVisibilityPicker; private Syncfusion.Maui.DataGrid.SfDataGrid? datagrid; protected override void OnAttachedTo(SampleView bindable) { this.datagrid = bindable.FindByName("dataGrid"); - this.visibilityPicker = bindable.FindByName("VisibilityPicker"); - this.headerVisibilityPicker = bindable.FindByName("HeaderVisibilityPicker"); + this.visibilityPicker = bindable.FindByName("VisibilityPicker"); + this.headerVisibilityPicker = bindable.FindByName("HeaderVisibilityPicker"); this.visibilityPicker.SelectedIndexChanged += StylingPicker_SelectedIndexChanged; this.headerVisibilityPicker.SelectedIndexChanged += HeaderVisibilityPicker_SelectedIndexChanged; ; diff --git a/MAUI/DocIO/SampleBrowser.Maui.DocIO/DocIOSamplesList.xml b/MAUI/DocIO/SampleBrowser.Maui.DocIO/DocIOSamplesList.xml index 6b378297..64737a57 100644 --- a/MAUI/DocIO/SampleBrowser.Maui.DocIO/DocIOSamplesList.xml +++ b/MAUI/DocIO/SampleBrowser.Maui.DocIO/DocIOSamplesList.xml @@ -1,7 +1,7 @@ - + @@ -19,6 +19,7 @@ + \ No newline at end of file diff --git a/MAUI/DocIO/SampleBrowser.Maui.DocIO/Platforms/iOS/SaveIOS.cs b/MAUI/DocIO/SampleBrowser.Maui.DocIO/Platforms/iOS/SaveIOS.cs index 4558a7b0..10d8a171 100644 --- a/MAUI/DocIO/SampleBrowser.Maui.DocIO/Platforms/iOS/SaveIOS.cs +++ b/MAUI/DocIO/SampleBrowser.Maui.DocIO/Platforms/iOS/SaveIOS.cs @@ -35,7 +35,9 @@ namespace SampleBrowser.Maui.DocIO.Services if (contentType != "application/html" || exception == string.Empty) { #pragma warning disable CA1416 //This call site is reachable on: 'iOS' 14.2 and later, 'maccatalyst' 14.2 and later. 'UIApplication.KeyWindow.get' is unsupported on: 'ios' 13.0 and later, 'maccatalyst' 13.0 and later. +#pragma warning disable CA1422 // Validate platform compatibility UIViewController? currentController = UIApplication.SharedApplication!.KeyWindow!.RootViewController; +#pragma warning disable CA1422 // Validate platform compatibility #pragma warning restore CA1416 //This call site is reachable on: 'iOS' 14.2 and later, 'maccatalyst' 14.2 and later. 'UIApplication.KeyWindow.get' is unsupported on: 'ios' 13.0 and later, 'maccatalyst' 13.0 and later. while (currentController!.PresentedViewController != null) currentController = currentController.PresentedViewController; diff --git a/MAUI/DocIO/SampleBrowser.Maui.DocIO/Resources/DocIO/OriginalDocument.docx b/MAUI/DocIO/SampleBrowser.Maui.DocIO/Resources/DocIO/OriginalDocument.docx new file mode 100644 index 00000000..91273ecd Binary files /dev/null and b/MAUI/DocIO/SampleBrowser.Maui.DocIO/Resources/DocIO/OriginalDocument.docx differ diff --git a/MAUI/DocIO/SampleBrowser.Maui.DocIO/Resources/DocIO/RevisedDocument.docx b/MAUI/DocIO/SampleBrowser.Maui.DocIO/Resources/DocIO/RevisedDocument.docx new file mode 100644 index 00000000..868d0938 Binary files /dev/null and b/MAUI/DocIO/SampleBrowser.Maui.DocIO/Resources/DocIO/RevisedDocument.docx differ diff --git a/MAUI/DocIO/SampleBrowser.Maui.DocIO/SampleBrowser.Maui.DocIO.csproj b/MAUI/DocIO/SampleBrowser.Maui.DocIO/SampleBrowser.Maui.DocIO.csproj index e26136d7..2531d879 100644 --- a/MAUI/DocIO/SampleBrowser.Maui.DocIO/SampleBrowser.Maui.DocIO.csproj +++ b/MAUI/DocIO/SampleBrowser.Maui.DocIO/SampleBrowser.Maui.DocIO.csproj @@ -76,10 +76,10 @@ - - - - + + + + @@ -104,6 +104,8 @@ + + diff --git a/MAUI/DocIO/SampleBrowser.Maui.DocIO/SampleBrowser.Maui.DocIO.props b/MAUI/DocIO/SampleBrowser.Maui.DocIO/SampleBrowser.Maui.DocIO.props index e504584c..58851258 100644 --- a/MAUI/DocIO/SampleBrowser.Maui.DocIO/SampleBrowser.Maui.DocIO.props +++ b/MAUI/DocIO/SampleBrowser.Maui.DocIO/SampleBrowser.Maui.DocIO.props @@ -54,6 +54,11 @@ Samples\DocIO\MarkdownToWord\MarkdownToWord.xaml.cs MarkdownToWord.xaml + + + Samples\DocIO\MarkdownToWord\CompareDocuments.xaml.cs + CompareDocuments.xaml + @@ -118,6 +123,11 @@ Samples\DocIO\MarkdownToWord\MarkdownToWord.xaml + + + Samples\DocIO\CompareDocuments\CompareDocuments.xaml + + Resources\DocIO\RTFtoWord.rtf @@ -170,5 +180,11 @@ Resources\DocIO\MarkdownToWord.md + + Resources\DocIO\OriginalDocument.docx + + + Resources\DocIO\RevisedDocument.docx + \ No newline at end of file diff --git a/MAUI/DocIO/SampleBrowser.Maui.DocIO/Samples/DocIO/CompareDocuments/CompareDocuments.xaml b/MAUI/DocIO/SampleBrowser.Maui.DocIO/Samples/DocIO/CompareDocuments/CompareDocuments.xaml new file mode 100644 index 00000000..e52b744b --- /dev/null +++ b/MAUI/DocIO/SampleBrowser.Maui.DocIO/Samples/DocIO/CompareDocuments/CompareDocuments.xaml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/DocIO/SampleBrowser.Maui.DocIO/Samples/DocIO/CompareDocuments/CompareDocuments.xaml.cs b/MAUI/DocIO/SampleBrowser.Maui.DocIO/Samples/DocIO/CompareDocuments/CompareDocuments.xaml.cs new file mode 100644 index 00000000..281733e7 --- /dev/null +++ b/MAUI/DocIO/SampleBrowser.Maui.DocIO/Samples/DocIO/CompareDocuments/CompareDocuments.xaml.cs @@ -0,0 +1,99 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Microsoft.Maui.Controls; +using SampleBrowser.Maui.Base; +#if DOCIOSB +using SampleBrowser.Maui.DocIO.Services; +#else +using SampleBrowser.Maui.Services; +#endif +using Syncfusion.DocIO; +using Syncfusion.DocIO.DLS; +using Syncfusion.Drawing; +using System; +using System.IO; +using System.Reflection; +using SizeF = Syncfusion.Drawing.SizeF; + +namespace SampleBrowser.Maui.DocIO.DocIO +{ + /// + /// Integration logic for xaml. + /// + public partial class CompareDocuments : SampleView + { + #region Fields + private readonly Assembly assembly; + #endregion + + #region Constructor + /// + /// Initializes component. + /// + public CompareDocuments() + { + InitializeComponent(); + assembly = typeof(CompareDocuments).GetTypeInfo().Assembly; +#if ANDROID || IOS + btnCompareDocuments.HorizontalOptions = LayoutOptions.Center; +#endif + } + #endregion + + #region Events + /// + /// Compare two Word documents. + /// + private void Button_Click(object sender, EventArgs e) + { + //Gets the original input word document. + string documentPath = "SampleBrowser.Maui.Resources.DocIO.OriginalDocument.docx"; + if (BaseConfig.IsIndividualSB) + documentPath = "SampleBrowser.Maui.DocIO.Resources.DocIO.OriginalDocument.docx"; + using Stream? originalfileStream = assembly.GetManifestResourceStream(documentPath); + //Creates a new Word document instance. + using WordDocument originalDocument = new(); + //Opens an existing original input word document. + originalDocument.Open(originalfileStream, FormatType.Markdown); + + //Gets the revised input word document. + documentPath = "SampleBrowser.Maui.Resources.DocIO.RevisedDocument.docx"; + if (BaseConfig.IsIndividualSB) + documentPath = "SampleBrowser.Maui.DocIO.Resources.DocIO.RevisedDocument.docx"; + using Stream? revisedfileStream = assembly.GetManifestResourceStream(documentPath); + //Creates a new Word document instance. + using WordDocument revisedDocument = new(); + //Opens an existing revised input word document. + revisedDocument.Open(revisedfileStream, FormatType.Markdown); + + if (detectFormatChanges.IsChecked) + { + //Compares the original document with revised document + originalDocument.Compare(revisedDocument, "Nancy Davolio", DateTime.Now.AddDays(-1)); + } + else + { + //Disable the flag to ignore the formatting changes while comparing the documents + ComparisonOptions comparisonOptions = new ComparisonOptions(); + comparisonOptions.DetectFormatChanges = false; + originalDocument.Compare(revisedDocument, "Nancy Davolio", DateTime.Now.AddDays(-1), comparisonOptions); + } + + #region Document SaveOption + using MemoryStream ms = new(); + //Saves the Word document to the memory stream. + originalDocument.Save(ms, FormatType.Docx); + ms.Position = 0; + //Saves the memory stream as file. + SaveService saveService = new(); + saveService.SaveAndView("Compare Documents.docx", "application/msword", ms); + #endregion Document SaveOption + } + #endregion + } +} \ No newline at end of file diff --git a/MAUI/EffectsView/SampleBrowser.Maui.EffectsView/SampleBrowser.Maui.EffectsView.csproj b/MAUI/EffectsView/SampleBrowser.Maui.EffectsView/SampleBrowser.Maui.EffectsView.csproj index cc6c2983..d2d0da62 100644 --- a/MAUI/EffectsView/SampleBrowser.Maui.EffectsView/SampleBrowser.Maui.EffectsView.csproj +++ b/MAUI/EffectsView/SampleBrowser.Maui.EffectsView/SampleBrowser.Maui.EffectsView.csproj @@ -1,4 +1,4 @@ - + net6.0-android;net6.0-ios;net6.0-maccatalyst @@ -80,9 +80,9 @@ - - - + + + diff --git a/MAUI/EffectsView/SampleBrowser.Maui.EffectsView/SampleBrowser.Maui.EffectsView.nuspec b/MAUI/EffectsView/SampleBrowser.Maui.EffectsView/SampleBrowser.Maui.EffectsView.nuspec index 0634530c..5fe64688 100644 --- a/MAUI/EffectsView/SampleBrowser.Maui.EffectsView/SampleBrowser.Maui.EffectsView.nuspec +++ b/MAUI/EffectsView/SampleBrowser.Maui.EffectsView/SampleBrowser.Maui.EffectsView.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png EffectsView component for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MAUI/Expander/SampleBrowser.Maui.Expander/ExpanderSamplesList.xml b/MAUI/Expander/SampleBrowser.Maui.Expander/ExpanderSamplesList.xml index b3cbf043..2c9dac5a 100644 --- a/MAUI/Expander/SampleBrowser.Maui.Expander/ExpanderSamplesList.xml +++ b/MAUI/Expander/SampleBrowser.Maui.Expander/ExpanderSamplesList.xml @@ -1,7 +1,7 @@ - + diff --git a/MAUI/Expander/SampleBrowser.Maui.Expander/SampleBrowser.Maui.Expander.csproj b/MAUI/Expander/SampleBrowser.Maui.Expander/SampleBrowser.Maui.Expander.csproj index 81d008fc..2bb716ca 100644 --- a/MAUI/Expander/SampleBrowser.Maui.Expander/SampleBrowser.Maui.Expander.csproj +++ b/MAUI/Expander/SampleBrowser.Maui.Expander/SampleBrowser.Maui.Expander.csproj @@ -4,7 +4,7 @@ net6.0-android;net6.0-ios;net6.0-maccatalyst $(TargetFrameworks);net6.0-windows10.0.19041.0 - + Exe SampleBrowser.Maui.Expander true @@ -85,10 +85,10 @@ - - - - + + + + diff --git a/MAUI/Expander/SampleBrowser.Maui.Expander/SampleBrowser.Maui.Expander.nuspec b/MAUI/Expander/SampleBrowser.Maui.Expander/SampleBrowser.Maui.Expander.nuspec index 56a12e1d..f5f65978 100644 --- a/MAUI/Expander/SampleBrowser.Maui.Expander/SampleBrowser.Maui.Expander.nuspec +++ b/MAUI/Expander/SampleBrowser.Maui.Expander/SampleBrowser.Maui.Expander.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png Expander component for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MAUI/Expander/SampleBrowser.Maui.Expander/Samples/Expander/GettingStarted/View/GettingStarted.xaml b/MAUI/Expander/SampleBrowser.Maui.Expander/Samples/Expander/GettingStarted/View/GettingStarted.xaml index 6a5298f6..89685ce1 100644 --- a/MAUI/Expander/SampleBrowser.Maui.Expander/Samples/Expander/GettingStarted/View/GettingStarted.xaml +++ b/MAUI/Expander/SampleBrowser.Maui.Expander/Samples/Expander/GettingStarted/View/GettingStarted.xaml @@ -42,11 +42,11 @@ - + - + @@ -70,7 +70,7 @@ - + @@ -130,7 +130,7 @@ - + @@ -173,7 +173,7 @@ - + diff --git a/MAUI/FunnelChart/SampleBrowser.Maui.FunnelChart/SampleBrowser.Maui.FunnelChart.csproj b/MAUI/FunnelChart/SampleBrowser.Maui.FunnelChart/SampleBrowser.Maui.FunnelChart.csproj index 76f4924c..f0f8378e 100644 --- a/MAUI/FunnelChart/SampleBrowser.Maui.FunnelChart/SampleBrowser.Maui.FunnelChart.csproj +++ b/MAUI/FunnelChart/SampleBrowser.Maui.FunnelChart/SampleBrowser.Maui.FunnelChart.csproj @@ -85,10 +85,10 @@ - - - - + + + + diff --git a/MAUI/FunnelChart/SampleBrowser.Maui.FunnelChart/SampleBrowser.Maui.FunnelChart.nuspec b/MAUI/FunnelChart/SampleBrowser.Maui.FunnelChart/SampleBrowser.Maui.FunnelChart.nuspec index bf51b11b..809db3c9 100644 --- a/MAUI/FunnelChart/SampleBrowser.Maui.FunnelChart/SampleBrowser.Maui.FunnelChart.nuspec +++ b/MAUI/FunnelChart/SampleBrowser.Maui.FunnelChart/SampleBrowser.Maui.FunnelChart.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png Funnel chart component for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/MAUI/FunnelChart/SampleBrowser.Maui.FunnelChart/Samples/FunnelChart/FunnelChartDemo/Legend.xaml b/MAUI/FunnelChart/SampleBrowser.Maui.FunnelChart/Samples/FunnelChart/FunnelChartDemo/Legend.xaml index a6a4214d..0837f0f9 100644 --- a/MAUI/FunnelChart/SampleBrowser.Maui.FunnelChart/Samples/FunnelChart/FunnelChartDemo/Legend.xaml +++ b/MAUI/FunnelChart/SampleBrowser.Maui.FunnelChart/Samples/FunnelChart/FunnelChartDemo/Legend.xaml @@ -11,8 +11,8 @@ - - diff --git a/MAUI/Gauges/SampleBrowser.Maui.Gauges/GaugesSamplesList.xml b/MAUI/Gauges/SampleBrowser.Maui.Gauges/GaugesSamplesList.xml index 1814aea2..e2e1c94a 100644 --- a/MAUI/Gauges/SampleBrowser.Maui.Gauges/GaugesSamplesList.xml +++ b/MAUI/Gauges/SampleBrowser.Maui.Gauges/GaugesSamplesList.xml @@ -5,63 +5,63 @@ - - - - + + + + - - - - - - - - + + + + + + + + - - - + + + - - - + + + - - + + - - + + - - - - - + + + + + @@ -70,34 +70,34 @@ - - - - - - - - - - + + + + + + + + + + - - - + + + - + - - - - + + + + - \ No newline at end of file + diff --git a/MAUI/Gauges/SampleBrowser.Maui.Gauges/SampleBrowser.Maui.Gauges.csproj b/MAUI/Gauges/SampleBrowser.Maui.Gauges/SampleBrowser.Maui.Gauges.csproj index bca361ab..842f06c5 100644 --- a/MAUI/Gauges/SampleBrowser.Maui.Gauges/SampleBrowser.Maui.Gauges.csproj +++ b/MAUI/Gauges/SampleBrowser.Maui.Gauges/SampleBrowser.Maui.Gauges.csproj @@ -74,10 +74,10 @@ - - - - + + + + diff --git a/MAUI/Gauges/SampleBrowser.Maui.Gauges/SampleBrowser.Maui.Gauges.nuspec b/MAUI/Gauges/SampleBrowser.Maui.Gauges/SampleBrowser.Maui.Gauges.nuspec index d6bcc688..7a530aea 100644 --- a/MAUI/Gauges/SampleBrowser.Maui.Gauges/SampleBrowser.Maui.Gauges.nuspec +++ b/MAUI/Gauges/SampleBrowser.Maui.Gauges/SampleBrowser.Maui.Gauges.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png RadialGauge and LinearGauge components for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Axis/LinearGaugeLabelsHorizontal.xaml b/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Axis/LinearGaugeLabelsHorizontal.xaml index 387fec0a..526c85fc 100644 --- a/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Axis/LinearGaugeLabelsHorizontal.xaml +++ b/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Axis/LinearGaugeLabelsHorizontal.xaml @@ -54,7 +54,7 @@ - @@ -62,7 +62,7 @@ - @@ -70,7 +70,7 @@ - diff --git a/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Axis/LinearGaugeLabelsVertical.xaml b/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Axis/LinearGaugeLabelsVertical.xaml index 5ff452ed..8d439735 100644 --- a/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Axis/LinearGaugeLabelsVertical.xaml +++ b/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Axis/LinearGaugeLabelsVertical.xaml @@ -23,7 +23,7 @@ + MaximumWidthRequest="{OnPlatform MacCatalyst='600', WinUI='600'}"> @@ -66,7 +66,7 @@ - @@ -75,7 +75,7 @@ - @@ -83,7 +83,7 @@ - diff --git a/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Axis/LinearGaugeTicksVertical.xaml b/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Axis/LinearGaugeTicksVertical.xaml index 3b89b909..715defdf 100644 --- a/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Axis/LinearGaugeTicksVertical.xaml +++ b/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Axis/LinearGaugeTicksVertical.xaml @@ -21,7 +21,7 @@ - + diff --git a/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Axis/LinearGaugeTrackVertical.xaml b/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Axis/LinearGaugeTrackVertical.xaml index 886e2ee8..edfeda4f 100644 --- a/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Axis/LinearGaugeTrackVertical.xaml +++ b/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Axis/LinearGaugeTrackVertical.xaml @@ -21,7 +21,7 @@ - + diff --git a/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Pointers/LinearGaugeBarPointerVertical.xaml b/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Pointers/LinearGaugeBarPointerVertical.xaml index 134970c4..00f0901c 100644 --- a/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Pointers/LinearGaugeBarPointerVertical.xaml +++ b/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Pointers/LinearGaugeBarPointerVertical.xaml @@ -23,7 +23,7 @@ + MaximumWidthRequest="{OnPlatform MacCatalyst='650', WinUI='650'}"> diff --git a/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Pointers/LinearGaugeContentPointerHorizontal.xaml b/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Pointers/LinearGaugeContentPointerHorizontal.xaml index b147456f..3f86e063 100644 --- a/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Pointers/LinearGaugeContentPointerHorizontal.xaml +++ b/MAUI/Gauges/SampleBrowser.Maui.Gauges/Samples/LinearGauge/Pointers/LinearGaugeContentPointerHorizontal.xaml @@ -9,7 +9,6 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/Annotations/Controls/Toolbar/ToolbarDesktop.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/Annotations/Controls/Toolbar/ToolbarDesktop.xaml.cs new file mode 100644 index 00000000..0e5e8dab --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/Annotations/Controls/Toolbar/ToolbarDesktop.xaml.cs @@ -0,0 +1,79 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class AnnotationToolbarDesktop : AnnotationToolbarView +{ + public AnnotationToolbarDesktop() + { + InitializeComponent(); + AssignControls(); + } + + public void SetBindings() + { + textMarkupButton.SetBinding(Button.TextProperty, new Binding() { Path = nameof(Syncfusion.Maui.PdfViewer.SfPdfViewer.AnnotationMode), Source = PdfViewer, Converter = new AnnotationModeToIconConverter("TextMarkup") }); + shapeButton.SetBinding(Button.TextProperty, new Binding() { Path = nameof(Syncfusion.Maui.PdfViewer.SfPdfViewer.AnnotationMode), Source = PdfViewer, Converter = new AnnotationModeToIconConverter("Shape") }); + } + + void AssignControls() + { + StampButton = stampButton; + UndoButton = undoButton; + RedoButton = redoButton; + } + private void Button_Clicked(object sender, EventArgs e) + { + ParentView?.CloseAllDialogs(); + if (sender is Button button) + { + double x = 0; + if (button.Parent is Grid buttonGrid) + { + x = buttonGrid.X + centerLayout.X; + if (button == colorPalette || button == stickyIconChangeButton) + x += editLayout.X; + } + + if (BindingContext is CustomToolbarViewModel viewModel) + { + if (button == textMarkupButton) + { + ParentView?.TextMarkUpHighlightDisappear(); + viewModel.TextMarkupListMargin = new Thickness(x, 40, 0, 0); + } + else if (button == shapeButton) + { + ParentView?.ShapeHighlightDisapper(); + viewModel.ShapeListMargin = new Thickness(x, 40, 0, 0); + } + else if (button == stampButton) + { + double stampContextMenuWidth = 176; + if (x + stampContextMenuWidth <= this.Bounds.Width) + { + viewModel.StampListMargin = new Thickness(x, 40, 0, 0); + } + else + viewModel.StampListMargin = new Thickness(this.Bounds.Width - stampContextMenuWidth, 40, 0, 0); + if (ParentView != null && ParentView.StampView != null) + ParentView.StampView.StampMode = false; + } + else if(button == stickyIconChangeButton) + viewModel.StickyNoteListMargin = new Thickness(x, 40, 0, 0); + else if (button == colorPalette) + viewModel.ColorPaletteMargin = new Thickness(x, 40, 0, 0); + else if (button == fileOperation) + { + viewModel.FileOperationListMargin = new Thickness(0, 40, 0, 0); + viewModel.IsFileOperationListVisible = !viewModel.IsFileOperationListVisible; + } + } + } + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/Annotations/Controls/Toolbar/ToolbarMobile.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/Annotations/Controls/Toolbar/ToolbarMobile.xaml new file mode 100644 index 00000000..5b001c02 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/Annotations/Controls/Toolbar/ToolbarMobile.xaml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/Annotations/Controls/Toolbar/ToolbarMobile.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/Annotations/Controls/Toolbar/ToolbarMobile.xaml.cs new file mode 100644 index 00000000..dde7d665 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/Annotations/Controls/Toolbar/ToolbarMobile.xaml.cs @@ -0,0 +1,24 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class AnnotationToolbarMobile : AnnotationToolbarView +{ + public AnnotationToolbarMobile() + { + InitializeComponent(); + AssignControls(); + } + + void AssignControls() + { + UndoButton = mobileUndoButton; + RedoButton = mobileRedoButton; + } + +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/Annotations/Controls/Toolbar/ToolbarView.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/Annotations/Controls/Toolbar/ToolbarView.cs new file mode 100644 index 00000000..ab496c67 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/Annotations/Controls/Toolbar/ToolbarView.cs @@ -0,0 +1,45 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Microsoft.Maui.Platform; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public class AnnotationToolbarView : Microsoft.Maui.Controls.ContentView +{ + private Syncfusion.Maui.PdfViewer.SfPdfViewer? pdfViewer; + public Button? UndoButton { get; set; } + public Button? SaveButton { get; set; } + public Button? RedoButton { get; set; } + public Button? StampButton { get; set; } + + public Annotations? ParentView { get; set; } + + public Syncfusion.Maui.PdfViewer.SfPdfViewer? PdfViewer + { + get + { + return pdfViewer; + } + set + { + pdfViewer = value; + BindPdfViewerValues(); + } + } + + void BindPdfViewerValues() + { + if (PdfViewer != null) + { + if (UndoButton != null) + UndoButton.Command = PdfViewer.UndoCommand; + if (RedoButton != null) + RedoButton.Command = PdfViewer.RedoCommand; + } + } +} diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/Annotations/View/Annotations.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/Annotations/View/Annotations.xaml new file mode 100644 index 00000000..dedfdece --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/Annotations/View/Annotations.xaml @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/Annotations/View/Annotations.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/Annotations/View/Annotations.xaml.cs new file mode 100644 index 00000000..da0a0566 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/Annotations/View/Annotations.xaml.cs @@ -0,0 +1,460 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Microsoft.Maui.Platform; +using SampleBrowser.Maui.Base; +using Syncfusion.Maui.Core.Internals; +using Syncfusion.Maui.PdfViewer; +using System.Reflection; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; +[XamlCompilation(XamlCompilationOptions.Compile)] +public partial class Annotations : SampleView +{ + private string? previousDocument = string.Empty; + AnnotationToolbarView? toolbar; +#if ANDROID || IOS + private ViewCell? lastCell; +#endif + public Stream CustomStampImageStream { get; set; } = new MemoryStream(); + public double CustomStampWidth { get; set; } + public double CustomStampHeight { get; set; } + public bool CustomStamp { get; set; } + public StampView? StampView { get; set; } + + CustomToolbarViewModel viewModel; + public Annotations() + { + InitializeComponent(); + viewModel = new CustomToolbarViewModel(PdfViewer); + viewModel.LockButtonsVisible = true; + viewModel.PropertyChanged += ViewModel_PropertyChanged; + BindingContext = viewModel; + AddItems(); +#if ANDROID || IOS + toolbar = MobileToolbar; + StampView = MobileStampView; + fileOperationGrid.IsVisible = false; +#else + StampView = DesktopStampView; + toolbar = DesktopToolbar; +#endif + PdfViewer.UndoCommand!.CanExecuteChanged += UndoCommand_CanExecuteChanged; + UpdateToolbarProperties(); + DesktopToolbar.SetBindings(); + StampView!.StampHelper = PdfViewer; + StampView.StampSelected += StampView_StampSelected; + viewModel.StickyNoteSelected += ViewModel_StickyNoteSelected; + + string basePath = "SampleBrowser.Maui.Resources.Pdf."; + if (BaseConfig.IsIndividualSB) + basePath = "SampleBrowser.Maui.PdfViewer.Samples.Pdf."; + Stream? documentStream = this.GetType().Assembly.GetManifestResourceStream(basePath + "Annotations1.pdf"); + PdfViewer.LoadDocumentAsync(documentStream, flattenOptions: FlattenOptions.Unsupported); + } + public void AddItems() + { + saveLayout.Children.Add(CreateView("\uE75f", "Save", 16)); + importLayout.Children.Add(CreateView("\uE782", "Import Annotation",19)); + exportLayout.Children.Add(CreateView("\uE781", "Export Annotation",19)); + } + private Grid CreateView(string icon, string iconName,int iconSize) + { + GestureGrid childRow = new GestureGrid(); + childRow.WidthRequest = 200; + childRow.HeightRequest = 40; + childRow.PointerPressed += ItemClicked; + Label iconLabel = new Label() + { + Padding = new Thickness(20, 0, 0, 0), + TextColor = new Color(0, 0, 0, 0.6f), + FontSize = iconSize, + FontFamily = "Maui Material Assets", + HorizontalOptions = LayoutOptions.Start, + VerticalOptions = LayoutOptions.Center, + Text = icon, + }; + childRow.Children.Add(iconLabel); + Label iconNameLabel = new Label() + { + Padding = new Thickness(15, 0, 0, 0), + Margin = new Thickness(30, 0, 0, 0), + TextColor = new Color(0, 0, 0, 0.6f), + FontSize = 16, + VerticalOptions = LayoutOptions.Center, + Text = iconName, + }; + childRow.Children.Add(iconNameLabel); + return childRow; + } + private void ItemClicked(object? sender, EventArgs e) + { + GestureGrid? grid = sender as GestureGrid; + string operation = ""; + if (grid!.Children[1] is Label iconName) + { + operation = iconName.Text; + } + if (this.BindingContext is CustomToolbarViewModel bindingContext) + { + if (operation.Contains("Save")) + bindingContext.SaveDocument(); + else if (operation.Contains("Import")) + bindingContext.ImportAnnotations(); + else if (operation.Contains("Export")) + bindingContext.ExportAnnotations(); + bindingContext.IsFileOperationListVisible = false; + } + } + + + private void ViewModel_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e) + { + if (e.PropertyName == nameof(viewModel.ColorPaletteMargin)) + { + View? view = null; + if (viewModel.IsInkColorPalleteVisible) + view = inkColorPalette; + else if (viewModel.IsStampOpacitySliderbarVisible) + view = stampOpacityBar; + else if (viewModel.IsTextMarkUpColorPalleteVisible) + view = textMarkupColorPalette; + else if (viewModel.IsShapeColorPalleteVisible) + view = shapeColorPalette; + if (view != null) + { + SizeRequest sizeRequest = view.Measure(double.PositiveInfinity, double.PositiveInfinity); + if (viewModel.ColorPaletteMargin.Left + sizeRequest.Request.Width > Width) + viewModel.ColorPaletteMargin = new Thickness(Width - sizeRequest.Request.Width - 20, viewModel.ColorPaletteMargin.Top, viewModel.ColorPaletteMargin.Right, viewModel.ColorPaletteMargin.Bottom); + } + } + } + + private void ViewModel_StickyNoteSelected(object? sender, EventArgs e) + { + PdfViewer.AnnotationMode = AnnotationMode.None; + if (BindingContext is CustomToolbarViewModel viewModel && viewModel.IsStickyNoteMode) + { + ShowToast("Tap on the page to insert the sticky note"); + } + } + + private void StampView_StampSelected(object? sender, EventArgs e) + { + PdfViewer.AnnotationMode = AnnotationMode.None; + ShowToast("Tap on the page to insert the selected stamp"); + } + + async void ShowToast(string text) + { + toast.Opacity = 1; + toastText.Text = text; + await toast.FadeTo(0, 2000, Easing.SinIn); + } + + private void UndoCommand_CanExecuteChanged(object? sender, EventArgs e) + { + viewModel.IsSaveLayoutVisible = true; + } + + void UpdateToolbarProperties() + { + if (toolbar != null) + { + toolbar.ParentView = this; + toolbar.PdfViewer = PdfViewer; + } + } + + internal void CloseAllDialogs() + { + viewModel.CloseAllDialogs(); + } + + ///// + ///// Handles when leaving the current page + ///// + public override void OnDisappearing() + { + base.OnDisappearing(); + PdfViewer?.UnloadDocument(); + PdfViewer?.Handler?.DisconnectHandler(); + } + + /// + /// Handles when a Pdf is tapped. + /// + private void PdfViewer_Tapped(object sender, GestureEventArgs e) + { +#if ANDROID + if (Platform.CurrentActivity?.CurrentFocus != null) + Platform.CurrentActivity.HideKeyboard(Platform.CurrentActivity.CurrentFocus); +#endif + if (StampView != null && e != null) + { + PointF point = new PointF(e.PagePosition.X, e.PagePosition.Y); + if (StampView.StampMode) + { + if (!CustomStamp) + { + StampType type = StampView.stampType; + StampAnnotation builtStamp = new StampAnnotation(type, e.PageNumber, point); + PdfViewer.AddAnnotation(builtStamp); + } + else if (CustomStamp && CustomStampImageStream != null) + { + StampAnnotation customStamp = new StampAnnotation(CustomStampImageStream, e.PageNumber, new RectF(point.X, point.Y, (float)CustomStampWidth, (float)CustomStampHeight)); + PdfViewer.AddAnnotation(customStamp); + CustomStamp = false; + } + StampView.StampMode = false; + } + } + // Adding sticky note annotation on the tapped position of the page + if (e != null) + { + if (this.BindingContext is CustomToolbarViewModel bindingContextForSticky) + { + if (bindingContextForSticky.IsStickyNoteMode) + { + PointF point = new PointF(e.PagePosition.X, e.PagePosition.Y); + StickyNoteAnnotation builtStickyNote = new StickyNoteAnnotation(bindingContextForSticky.StickyIcon,"",e.PageNumber, point); + PdfViewer.AddAnnotation(builtStickyNote); + bindingContextForSticky.IsStickyNoteMode = false; + } + } + } + if (this.BindingContext is CustomToolbarViewModel bindingContext) + { + bindingContext.HideOverlayToolbars(); + bindingContext.IsFileListViewVisible = false; + bindingContext.ShowMoreOptions = false; + bindingContext.IsStampViewVisible = false; + bindingContext.StampHighlightColor = Colors.Transparent; + bindingContext.StickyNoteHighlightColor = Colors.Transparent; +#if WINDOWS || MACCATALYST + bindingContext.IsShapeListVisible = false; + bindingContext.IsStickyNoteListVisible = false; + bindingContext.IsTextMarkupListVisible = false; + bindingContext.IsStampListVisible = false; + bindingContext.IsInkColorPalleteVisible = false; + bindingContext.IsShapeColorPalleteVisible = false; + bindingContext.IsTextMarkUpColorPalleteVisible = false; + bindingContext.IsStampOpacitySliderbarVisible = false; + bindingContext.IsStickyNoteColorPalleteVisible = false; +#endif + bindingContext.IsFileOperationListVisible = false; + } + } + + /// + /// Handles when a file picker content is tapped. + /// + private void ListView_ItemTapped(object? sender, EventArgs e) + { + GestureGrid? grid = sender as GestureGrid; + string currentTappedDocument = ""; + if (grid!.Children[0] is Label iconName) + { + currentTappedDocument= iconName.Text; + } + if (this.BindingContext is CustomToolbarViewModel bindingContext) + { + if (bindingContext.IsFilePickerVisible) + { + if (previousDocument != currentTappedDocument) + bindingContext.UpdateFileName(currentTappedDocument); + bindingContext.IsFilePickerVisible = false; + bindingContext.HideOverlayToolbars(); +#if ANDROID || IOS + bindingContext.BottomToolbarContent= new AnnotationToolbar(viewModel); +#endif + previousDocument = currentTappedDocument; + } + bindingContext.IsFileOperationListVisible= false; + } + } + + /// + /// Handles when a file picker content is tapped. + /// + private void ViewCell_Tapped(object sender, EventArgs e) + { +#if ANDROID || IOS + if (lastCell != null) + lastCell.View.BackgroundColor = Colors.Transparent; + var viewCell = (ViewCell)sender; + if (viewCell.View != null) + { + viewCell.View.BackgroundColor = Color.FromArgb("#0A000000"); + lastCell = viewCell; + } +#endif + } + + /// + /// Handles when a document is loaded. + /// + private void PdfViewer_DocumentLoaded(object sender, EventArgs e) + { + if (this.BindingContext is CustomToolbarViewModel bindingContext) + { + bindingContext.IsDocumentLoaded = true; + bindingContext.IsEditLayoutVisible = false; + bindingContext.IsTextMarkupListVisible = false; + bindingContext.IsShapeListVisible = false; + bindingContext.IsStickyNoteListVisible = false; + bindingContext.IsStampListVisible = false; + + } + } + + /// + /// Handles when a document is unloaded. + /// + private void PdfViewer_DocumentUnloaded(object sender, EventArgs e) + { + viewModel.IsDocumentLoaded = false; + viewModel.IsSaveLayoutVisible = false; + viewModel.HideOverlayToolbars(); + viewModel.ShowMoreOptions = false; + viewModel.IsStampViewVisible = false; +#if WINDOWS || MACCATALYST + viewModel.IsShapeListVisible = false; + viewModel.IsTextMarkupListVisible = false; + viewModel.IsStampListVisible = false; + viewModel.IsInkColorPalleteVisible = false; + viewModel.IsShapeColorPalleteVisible = false; + viewModel.IsTextMarkUpColorPalleteVisible = false; + viewModel.IsStampOpacitySliderbarVisible = false; +#endif + } + + + + + private void PdfViewer_AnnotationSelected(object sender, AnnotationEventArgs e) + { + viewModel.SelectedAnnotation = e.Annotation; + + } + + private void PdfViewer_AnnotationDeselected(object sender, AnnotationEventArgs e) + { + viewModel.SelectedAnnotation = null; + } + + private void saveButton_Clicked(object? sender, EventArgs e) + { + viewModel?.SaveDocument(); + } + + private void thicknessSlider_ValueChanged(object sender, EventArgs e) + { + float thickness = (float)ThicknessSlider.Value; + viewModel.ThicknessCommand.Execute(thickness); + } + + private void stampOpacitySlider_ValueChanged(object sender, EventArgs e) + { + viewModel.OpacityCommand.Execute((float)StampOpacitySlider.Value); + } + + private void importButton_Clicked(object sender, EventArgs e) + { + viewModel?.ImportAnnotations(); + } + + private void exportButton_Clicked(object sender, EventArgs e) + { + viewModel?.ExportAnnotations(); + } + + private void FileListView_FileSelected(object sender, FileSelectedEventArgs e) + { + viewModel.DocumentData.FileName = e.FileName; + } + + private void OnCreateStampClicked(object sender, StampDialogEventArgs e) + { + if (e.IsVisible == true) + stampDialog.IsVisible = false; + else + stampDialog.IsVisible = true; + viewModel.IsStampListVisible = false; + } + + private async void OnCustomStampCreated(object sender, CustomStampEventArgs e) + { + Stream imageStream = await e.StampView!.GetStreamAsync(Syncfusion.Maui.Core.ImageFileFormat.Png); + StampImage image = new StampImage(); + Stream memoryStream = new MemoryStream(); + await imageStream.CopyToAsync(memoryStream); + memoryStream.Position = imageStream.Position = 0; + image.ImageStream = memoryStream; + image.Source = ImageSource.FromStream(() => imageStream); + image.HeightRequest = 40; + image.HorizontalOptions = LayoutOptions.Start; + image.Margin = new Thickness(5); + StampView?.CustomStampListLayout?.Children.Add(CreateView(image)); + if (sender is View view) + view.IsVisible = false; + ShowToast("The stamp is created and added to custom stamps menu"); + } + + private View CreateView(StampImage Image) + { + GestureGrid customStamp = new GestureGrid(); + if (Image.Bounds.Width < 200) + customStamp.WidthRequest = 195; + else + customStamp.WidthRequest = Image.Bounds.Width; + customStamp.PointerPressed += OnCustomStampTapped; + customStamp.Children.Add(Image); + return customStamp; + } + + private async void OnCustomStampTapped(object? sender, EventArgs? e) + { + ShowToast("Tap on the page to insert the custom stamp"); + GestureGrid? grid = sender as GestureGrid; + if (grid!.Children[0] is StampImage image) + { + CustomStampImageStream = new MemoryStream(); + if (image != null && image.ImageStream != null) + { + await image.ImageStream.CopyToAsync(CustomStampImageStream); + image.ImageStream.Position = CustomStampImageStream.Position = 0; + CustomStampWidth = image.Bounds.Width; + CustomStampHeight = image.Bounds.Height; + } + CustomStamp = true; + StampView!.StampMode = true; + viewModel.IsStampListVisible = false; + viewModel.IsStampViewVisible = false; + } + } + + private void OnCreateStampMobileClicked(object sender, StampDialogMobileEventArgs e) + { + if (e.IsVisible == true) + stampDialogMobile.IsVisible = false; + else + stampDialogMobile.IsVisible = true; + viewModel.IsStampViewVisible = false; + } + internal void ShapeHighlightDisapper() + { + shapeListView.DisappearHighlight(); + } + internal void TextMarkUpHighlightDisappear() + { + textmarkupView.DisappearHighlight(); + } + + +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/StampAnnotation/Model/StampsData.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/StampAnnotation/Model/StampsData.cs new file mode 100644 index 00000000..1c72f550 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/StampAnnotation/Model/StampsData.cs @@ -0,0 +1,197 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Microsoft.Maui.Controls.Shapes; +using Syncfusion.Maui.PdfViewer; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer +{ + internal class StampsData + { + public List StandardStampItems { get; set; } + + public StampsData() + { + StandardStampItems = new List + { + + new StandardStamps + { + BorderBackground = Color.FromArgb("#ecf3e5"), LabelText = "APPROVED", + LabelTextColor = Color.FromArgb("#416a1c"),BorderHeight = 36,BorderColor = Color.FromArgb("#416a1c"), + #if ANDROID || IOS + BorderWidth = 90 + #elif WINDOWS || MACCATALYST + BorderWidth = 103 + #endif + }, + + new StandardStamps + { + BorderBackground = Color.FromArgb("#ecf3e5"), LabelText = "FINAL", + LabelTextColor = Color.FromArgb("#416a1c"),BorderHeight = 36,BorderColor = Color.FromArgb("#416a1c"), + #if ANDROID || IOS + BorderWidth = 55 + #elif WINDOWS || MACCATALYST + BorderWidth = 71 + #endif + }, + + new StandardStamps + { + BorderBackground = Color.FromArgb("#dde5f2"), LabelText = "AS IS", + LabelTextColor = Color.FromArgb("#182564"),BorderHeight = 36,BorderColor = Color.FromArgb("#182564"), + #if ANDROID || IOS + BorderWidth = 55 + #elif WINDOWS || MACCATALYST + BorderWidth = 60 + #endif + }, + + new StandardStamps + { + BorderBackground = Color.FromArgb("#ecf3e5"), LabelText = "COMPLETED", + LabelTextColor = Color.FromArgb("#416a1c"),BorderHeight = 36,BorderColor = Color.FromArgb("#416a1c"), + #if ANDROID || IOS + BorderWidth = 98 + #elif WINDOWS || MACCATALYST + BorderWidth = 114 + #endif + }, + + new StandardStamps + { + BorderBackground = Color.FromArgb("#fce2e0"), LabelText = "NOT APPROVED", + LabelTextColor = Color.FromArgb("#910f05"),BorderHeight = 36,BorderColor = Color.FromArgb("#910f05"), + #if ANDROID || IOS + BorderWidth = 120 + #elif WINDOWS || MACCATALYST + BorderWidth = 139 + #endif + }, + + new StandardStamps + { + BorderBackground = Color.FromArgb("#dde5f2"), LabelText = "CONFIDENTIAL", + LabelTextColor = Color.FromArgb("#182564"),BorderHeight = 36,BorderColor = Color.FromArgb("#182564"), + #if ANDROID || IOS + BorderWidth = 112 + #elif WINDOWS || MACCATALYST + BorderWidth = 132 + #endif + }, + + new StandardStamps + { + BorderBackground = Color.FromArgb("#dde5f2"), LabelText = "DEPARTMENTAL", + LabelTextColor = Color.FromArgb("#182564"),BorderHeight = 36,BorderColor = Color.FromArgb("#182564"), + #if ANDROID || IOS + BorderWidth = 128 + #elif WINDOWS || MACCATALYST + BorderWidth = 143 + #endif + }, + + new StandardStamps + { + BorderBackground = Color.FromArgb("#dde5f2"), LabelText = "DRAFT", + LabelTextColor = Color.FromArgb("#182564"),BorderHeight = 36,BorderColor = Color.FromArgb("#182564"), + #if ANDROID || IOS + BorderWidth = 60 + #elif WINDOWS || MACCATALYST + BorderWidth = 71 + #endif + }, + + new StandardStamps + { + BorderBackground = Color.FromArgb("#dde5f2"), LabelText = "EXPIRED", + LabelTextColor = Color.FromArgb("#182564"),BorderHeight = 36,BorderColor = Color.FromArgb("#182564"), + #if ANDROID || IOS + BorderWidth = 75 + #elif WINDOWS || MACCATALYST + BorderWidth = 85 + #endif + }, + + new StandardStamps + { + BorderBackground = Color.FromArgb("#dde5f2"), LabelText = "FOR COMMENT", + LabelTextColor = Color.FromArgb("#182564"),BorderHeight = 36,BorderColor = Color.FromArgb("#182564" ), + #if ANDROID || IOS + BorderWidth = 118 + #elif WINDOWS || MACCATALYST + BorderWidth = 134 + #endif + }, + + new StandardStamps + { + BorderBackground = Color.FromArgb("#dde5f2"), LabelText = "FOR PUBLIC RELEASE", + LabelTextColor = Color.FromArgb("#182564"),BorderHeight = 36,BorderColor = Color.FromArgb("#182564"), + #if ANDROID || IOS + BorderWidth = 155 + #elif WINDOWS || MACCATALYST + BorderWidth = 181 + #endif + }, + + new StandardStamps + { + BorderBackground = Color.FromArgb("#dde5f2"), LabelText = "INFORMATION ONLY", + LabelTextColor = Color.FromArgb("#182564"),BorderHeight = 36,BorderColor = Color.FromArgb("#182564"), + #if ANDROID || IOS + BorderWidth = 148 + #elif WINDOWS || MACCATALYST + BorderWidth = 171 + #endif + }, + + new StandardStamps + { + BorderBackground = Color.FromArgb("#fce2e0"), LabelText = "VOID", + LabelTextColor = Color.FromArgb("#910f05"),BorderHeight = 36,BorderColor = Color.FromArgb("#910f05"), + #if ANDROID || IOS + BorderWidth = 56 + #elif WINDOWS || MACCATALYST + BorderWidth = 70 + #endif + }, + + new StandardStamps + { + BorderBackground = Color.FromArgb("#dde5f2"), LabelText = "PRELIMINARY RESULTS", + LabelTextColor = Color.FromArgb("#182564"),BorderHeight = 36,BorderColor = Color.FromArgb("#182564"), + #if ANDROID || IOS + BorderWidth = 160 + #elif WINDOWS || MACCATALYST + BorderWidth = 216 + #endif + }, + + }; + + } + + } + public class StandardStamps + { + public Color? BorderBackground { get; set; } + public Color? BorderColor { get; set; } + public string? LabelText { get; set; } + public Color? LabelTextColor { get; set; } + public double? BorderHeight { get; set; } + public double? BorderWidth { get; set; } + } + + +} diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/StampAnnotation/View/StampContextMenu.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/StampAnnotation/View/StampContextMenu.cs new file mode 100644 index 00000000..93871df6 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/StampAnnotation/View/StampContextMenu.cs @@ -0,0 +1,142 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Microsoft.Maui.Controls.Shapes; +using Syncfusion.Maui.Core.Internals; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer +{ + public class StampContextMenu: ContentView + { + StackLayout stackLayout = new StackLayout(); + Border contextMenuborder = new Border() + { + Padding = new Thickness(0, 7, 0, 7), + BackgroundColor = Color.FromArgb("#EEE8F4"), + StrokeShape = new RoundRectangle + { + CornerRadius = 5 + } + }; + Grid? selectedItem = null; + + public event EventHandler? ItemTapped; + + public StampContextMenu() + { + this.HorizontalOptions = LayoutOptions.Start; + this.VerticalOptions = LayoutOptions.Start; + contextMenuborder.Content = stackLayout; + this.Content = contextMenuborder; + stackLayout.Spacing = 0; + } + + public void AddSeparator() + { + Line line = new Line(); + line.BackgroundColor = Color.FromArgb("#FFCAC4D0"); + line.HeightRequest = 1; + stackLayout.Children.Add(line); + } + + Grid ChildRow(View view) + { + GestureGrid childRow = new GestureGrid(); + childRow.Children.Add(view); + childRow.PointerPressed += ItemClicked; + view.PropertyChanged += ChildRowPropertyChanged; + return childRow; + } + + public void AddItem(View view) + { + stackLayout.Children.Add(ChildRow(view)); + } + + private void ChildRowPropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e) + { + if (e.PropertyName == "IsEnabled") + { + if (sender is View view && view.Parent is GestureGrid grid) + { + grid.ClearBackground(); + grid.IsEnabled = view.IsEnabled; + grid.Opacity = grid.IsEnabled ? 1 : 0.25; + } + } + } + + private void ItemClicked(object? sender, EventArgs e) + { + GestureGrid? grid = sender as GestureGrid; + ItemTapped?.Invoke(this, new ItemTappedEventArgs(grid!.Children[0])); + } + + public void Clear() + { + selectedItem!.BackgroundColor = Colors.Transparent; + } + } + + public class GestureGrid : Grid, Syncfusion.Maui.Core.Internals.ITouchListener + { + public GestureGrid() + { + this.AddTouchListener(this); + } + + internal event EventHandler? PointerPressed; + + Color normalColor = Colors.Transparent; + Color mouseHoverColor = Color.FromArgb("#141C1B1F"); + Color pressedColor = Color.FromArgb("#261C1B1E"); + + public void OnTouch(Syncfusion.Maui.Core.Internals.PointerEventArgs e) + { + if (this.IsEnabled == false) + return; + switch (e.Action) + { + case PointerActions.Pressed: + this.BackgroundColor = pressedColor; + PointerPressed?.Invoke(this, EventArgs.Empty); + break; + case PointerActions.Entered: + this.BackgroundColor = mouseHoverColor; + break; + case PointerActions.Exited: + this.BackgroundColor = normalColor; + break; +#if ANDROID || IOS + case PointerActions.Released: + this.BackgroundColor = normalColor; + break; +#endif + } + } + + public void ClearBackground() + { + this.BackgroundColor = normalColor; + } + } + + public class ItemTappedEventArgs : EventArgs + { + public View? TappedItem; + + public ItemTappedEventArgs(IView view) + { + TappedItem = view as View; + } + } +} diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/StampAnnotation/View/StampDialog.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/StampAnnotation/View/StampDialog.xaml new file mode 100644 index 00000000..99a8ecb3 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/StampAnnotation/View/StampDialog.xaml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/StampAnnotation/View/StampDialog.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/StampAnnotation/View/StampDialog.xaml.cs new file mode 100644 index 00000000..53d5d255 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/StampAnnotation/View/StampDialog.xaml.cs @@ -0,0 +1,161 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Microsoft.Maui.Controls.Shapes; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class StampDialog : ContentView +{ + Ellipse? selectedColorButtonHighlight; + Button? PreButton; + + public event EventHandler? CustomStampCreated; + + public StampDialog() + { + InitializeComponent(); + this.PropertyChanged += StampDialogPropertyChanged; + } + + private async void StampDialogPropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e) + { + if(e.PropertyName=="IsVisible" && this.IsVisible==true) + { + await Task.Delay(250); + createEntry?.Focus(); + } + } + + private void OnEntryTextChanged(object sender, TextChangedEventArgs e) + { + if (string.IsNullOrWhiteSpace(e.NewTextValue)) + { + label.Text = "Text"; + } + else + { + label.Text = e.NewTextValue; + } + double textWidth = MeasureTextWidth(label.Text, label.FontSize); + double newBorderWidth = textWidth + 50; + border.WidthRequest = newBorderWidth; + layout.WidthRequest = newBorderWidth; + } + + private double MeasureTextWidth(string text, double fontSize) + { + label.Text = text; + SizeRequest sizeRequest = label.Measure(double.PositiveInfinity, double.PositiveInfinity); + return sizeRequest.Request.Width; + } + + private void OnCloseClicked(object sender, EventArgs e) + { + this.IsVisible = false; + } + + private void OnApplyClicked(object sender, EventArgs e) + { + CustomStampEventArgs customStampEventArgs = new CustomStampEventArgs(border, label); + CustomStampCreated?.Invoke(this, customStampEventArgs); + } + + private void ColorHighlightButton_Clicked(object sender, EventArgs e) + { + if (PreButton != null) + { + PreButton.HeightRequest = 35; + PreButton.WidthRequest = 35; + PreButton.CornerRadius = 20; + } + PreButton = sender as Button; + if (selectedColorButtonHighlight == null) + { + selectedColorButtonHighlight = new Ellipse(); + selectedColorButtonHighlight.WidthRequest = 35; + selectedColorButtonHighlight.HeightRequest = 35; + selectedColorButtonHighlight.VerticalOptions = LayoutOptions.Center; + selectedColorButtonHighlight.HorizontalOptions = LayoutOptions.Center; + selectedColorButtonHighlight.Stroke = Brush.Black; + selectedColorButtonHighlight.StrokeThickness = 2; + } + if (sender is Button button) + { + button.HeightRequest = 30; + button.WidthRequest = 30; + button.CornerRadius = 15; + button.HorizontalOptions = LayoutOptions.Center; + button.VerticalOptions = LayoutOptions.Center; + int column = Grid.GetColumn(button); + int row = Grid.GetRow(button); + Grid.SetColumn(selectedColorButtonHighlight, column); + Grid.SetRow(selectedColorButtonHighlight, row); + border.Stroke = button.BackgroundColor; + border.BackgroundColor = GetLightenColor(button.BackgroundColor, (float)0.85); + label.TextColor = button.BackgroundColor; + } + if (selectedColorButtonHighlight.Parent == null) + { + stampColor.Children.Add(selectedColorButtonHighlight); + } + } + + internal Color GetLightenColor(Color color, float lighteningFactor) + { + float R = (float)color.Red; + float G = (float)color.Green; + float B = (float)color.Blue; + + if (lighteningFactor < -1) + lighteningFactor = -1; + else if (lighteningFactor > 1) + lighteningFactor = 1; + + if (lighteningFactor < 0) + { + lighteningFactor = 1 + lighteningFactor; + R *= lighteningFactor; + G *= lighteningFactor; + B *= lighteningFactor; + } + else + { + R = (1 - R) * lighteningFactor + R; + G = (1 - G) * lighteningFactor + G; + B = (1 - B) * lighteningFactor + B; + } + return Color.FromRgba((float)R, (float)G, (float)B, color.Alpha); + } +} + +public class StampImage : Image +{ + public Stream? ImageStream { get; set; } + + public StampImage() + { + this.HorizontalOptions = LayoutOptions.Center; + } +} + +public class CustomStampEventArgs : EventArgs +{ + public Border? StampView { get; set; } + public Label? CustomStampLabel { get; set; } + + public CustomStampEventArgs(Border? stampView, Label? customStampLabel) + { + StampView = stampView; + CustomStampLabel = customStampLabel; + } + + public CustomStampEventArgs(Border? stampeView) + { + StampView = stampeView; + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/StampAnnotation/View/StampView.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/StampAnnotation/View/StampView.cs new file mode 100644 index 00000000..795c2213 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/StampAnnotation/View/StampView.cs @@ -0,0 +1,84 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Syncfusion.Maui.PdfViewer; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer +{ + public class StampView : ContentView + { + public Syncfusion.Maui.PdfViewer.SfPdfViewer? StampHelper { get; set; } + public event EventHandler? StampSelected; + + internal StampType stampType { get; set; } + + internal bool StampMode { get; set; } = false; + + public VerticalStackLayout? CustomStampListLayout { get; set; } + + public StampView() + { + + } + + public void OnStampSelected() + { + StampSelected?.Invoke(this, EventArgs.Empty); + } + + internal StampType GetStampType(string stampType) + { + if (stampType == "APPROVED") + return StampType.Approved; + else if (stampType == "AS IS") + return StampType.AsIs; + else if (stampType == "COMPLETED") + return StampType.Completed; + else if (stampType == "CONFIDENTIAL") + return StampType.Confidential; + else if (stampType == "DEPARTMENTAL") + return StampType.Departmental; + else if (stampType == "DRAFT") + return StampType.Draft; + else if (stampType == "EXPERIMENTAL") + return StampType.Experimental; + else if (stampType == "EXPIRED") + return StampType.Expired; + else if (stampType == "FINAL") + return StampType.Final; + else if (stampType == "FOR COMMENT") + return StampType.ForComment; + else if (stampType == "FOR PUBLIC RELEASE") + return StampType.ForPublicRelease; + else if (stampType == "INFORMATION ONLY") + return StampType.InformationOnly; + else if (stampType == "NOT APPROVED") + return StampType.NotApproved; + else if (stampType == "NOT FOR PUBLIC RELEASE") + return StampType.NotForPublicRelease; + else if (stampType == "VOID") + return StampType.Void; + else if (stampType == "PRELIMINARY RESULTS") + return StampType.PreliminaryResults; + return StampType.Departmental; + } + + internal Task? GetStreamFromImageSourceAsync(StreamImageSource streamImage, CancellationToken cancellationToken) + { + if (streamImage.Stream != null) + { + return streamImage.Stream(cancellationToken); + } + return null; + } + } +} diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/StampAnnotation/View/StampViewDesktop.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/StampAnnotation/View/StampViewDesktop.xaml new file mode 100644 index 00000000..d9ccf3cc --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/StampAnnotation/View/StampViewDesktop.xaml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/StampAnnotation/View/StampViewDesktop.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/StampAnnotation/View/StampViewDesktop.xaml.cs new file mode 100644 index 00000000..dc72cf67 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/StampAnnotation/View/StampViewDesktop.xaml.cs @@ -0,0 +1,233 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion + +using Microsoft.Maui.Layouts; +using Syncfusion.Maui.PdfViewer; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class StampViewDesktop : StampView +{ + public event EventHandler? CreateStampClicked; + HorizontalStackLayout? customStampMenuItem; + + public StampViewDesktop() + { + InitializeComponent(); + AssignControls(); + ContextMenu.ItemTapped += ContextMenu_ItemTapped; + ContextMenu.WidthRequest = 176; + ContextMenu.AddItem(CreateItem("Standard Stamps", "\uE706", 122, 40)); + customStampMenuItem = CreateItem("Custom Stamps", "\uE706", 120, 40); + ContextMenu.AddItem(customStampMenuItem); + ContextMenu.AddSeparator(); + ContextMenu.AddItem(CreateItem("Create Stamps", "\uE70d", 120, 40)); + this.ParentChanged += StampViewDesktop_ParentChanged; + } + + private void StampViewDesktop_ParentChanged(object? sender, EventArgs e) + { + if(this.Parent!=null) + { + this.Parent.PropertyChanged += Parent_PropertyChanged; + } + } + + private void Parent_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e) + { + if (e.PropertyName == nameof(IsVisible)) + { + if(this.Parent is Grid grid) + { + if (grid.IsVisible == false) + { + if (StandardStampMenu != null && StandardStampMenu.IsVisible == true) + { + HideStandardStamps(); + } + if (CustomStampMenu != null && CustomStampMenu.IsVisible == true) + { + HideCustomStamps(); + } + } + else + { + if(CustomStampListLayout!=null && customStampMenuItem!=null) + { + if (CustomStampListLayout.Count == 0) + { + customStampMenuItem.IsEnabled = false; + } + else + { + customStampMenuItem.IsEnabled = true; + } + } + } + } + } + } + + void AssignControls() + { + CustomStampListLayout = CustomStampsList; + } + + private void StampMenu_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) + { + if (e.PropertyName == nameof(IsVisible)) + { + if (StandardStampMenu != null && StandardStampMenu.IsVisible == true) + { + HideStandardStamps(); + } + if (CustomStampMenu != null && CustomStampMenu.IsVisible == true) + { + HideCustomStamps(); + } + } + } + + void HideStandardStamps() + { + StandardStampMenu.IsVisible = false; + if (this.Parent is Grid grid) + grid.Margin = new Thickness(grid.Margin.Left + 280, + grid.Margin.Top, grid.Margin.Right, grid.Margin.Bottom); + } + + void ShowStandardStamps() + { + StandardStampMenu.IsVisible = true; + if (this.Parent is Grid grid) + grid.Margin = new Thickness(grid.Margin.Left - 280, + grid.Margin.Top, grid.Margin.Right, grid.Margin.Bottom); + if (CustomStampMenu.IsVisible == true) + HideCustomStamps(); + } + + void HideCustomStamps() + { + CustomStampMenu.IsVisible = false; + if (this.Parent is Grid grid) + grid.Margin = new Thickness(grid.Margin.Left + 160, + grid.Margin.Top, grid.Margin.Right, grid.Margin.Bottom); + } + + void ShowCustomStamps() + { + CustomStampMenu.IsVisible = true; + if (this.Parent is Grid grid) + grid.Margin = new Thickness(grid.Margin.Left - 160, + grid.Margin.Top, grid.Margin.Right, grid.Margin.Bottom); + if (StandardStampMenu.IsVisible == true) + HideStandardStamps(); + } + + private void StandardStampMenu_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) + { + if (e.PropertyName == nameof(IsVisible)) + { + StandardStampMenuItems.SelectedItem = null; + } + } + + private void Stamp_ItemTapped(object sender, Microsoft.Maui.Controls.ItemTappedEventArgs e) + { + if (StampHelper != null) + { + if (e.Item is StandardStamps standardStamp && standardStamp.LabelText != null) + { + stampType = GetStampType(standardStamp.LabelText); + StampMode = true; + } + } + if (Parent != null && Parent.BindingContext is CustomToolbarViewModel viewModel) + { + viewModel.IsStampListVisible = false; + } + if (StandardStampMenu.IsVisible == true) + { + HideStandardStamps(); + } + if(CustomStampMenu.IsVisible==true) + { + HideCustomStamps(); + } + OnStampSelected(); + } + + HorizontalStackLayout CreateItem(string text, string icon, double textWidth, double iconWidth) + { + HorizontalStackLayout horizontalStackLayout = new HorizontalStackLayout(); + horizontalStackLayout.HeightRequest = 40; + Label label1 = new Label() + { + Text = text, + WidthRequest = textWidth, + VerticalTextAlignment = TextAlignment.Center, + Margin = new Thickness(16, 8, 0, 8), + FontSize = 16 + }; + Label label2 = new Label() + { + Text = icon, + WidthRequest = iconWidth, + HorizontalTextAlignment = TextAlignment.Center, + VerticalTextAlignment = TextAlignment.Center, + FontSize = 16, + FontFamily = "Maui Material Assets" + }; + horizontalStackLayout.Children.Add(label1); + horizontalStackLayout.Children.Add(label2); + return horizontalStackLayout; + } + + private void ContextMenu_ItemTapped(object? sender, ItemTappedEventArgs e) + { + if (e.TappedItem is HorizontalStackLayout stack) + { + if (stack.Children[0] is Label label) + { + if (label.Text == "Standard Stamps") + { + if (StandardStampMenu.IsVisible) + { + HideStandardStamps(); + } + else + { + ShowStandardStamps(); + } + } + else if (label.Text == "Custom Stamps") + { + if (CustomStampMenu.IsVisible) + HideCustomStamps(); + else + ShowCustomStamps(); + } + else if (label.Text == "Create Stamps") + { + StampDialogEventArgs stampDialogEventArgs = new StampDialogEventArgs(false); + CreateStampClicked?.Invoke(this, stampDialogEventArgs); + } + } + } + } +} + +public class StampDialogEventArgs : EventArgs +{ + public bool? IsVisible { get; set; } + public StampDialogEventArgs(bool isVisible) + { + this.IsVisible = isVisible; + } +} + diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/AnnotationModeToBoolConvertor.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/AnnotationModeToBoolConvertor.cs new file mode 100644 index 00000000..6979a287 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/AnnotationModeToBoolConvertor.cs @@ -0,0 +1,40 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using System; +using System.Collections.Generic; +using System.Globalization; +using Syncfusion.Maui.PdfViewer; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Reflection.Metadata.Ecma335; + +namespace SampleBrowser.Maui.PdfViewer +{ + internal class AnnotationModeToBoolConvertor: IValueConverter + { + public AnnotationModeToBoolConvertor() + { + + } + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is AnnotationMode annotationMode) + { + + return annotationMode != AnnotationMode.None; + } + return false; + } + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } + +} diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/AnnotationToolbar.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/AnnotationToolbar.xaml new file mode 100644 index 00000000..fbbb0dff --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/AnnotationToolbar.xaml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/AnnotationToolbar.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/AnnotationToolbar.xaml.cs new file mode 100644 index 00000000..b1b13c21 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/AnnotationToolbar.xaml.cs @@ -0,0 +1,17 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class AnnotationToolbar : ContentView +{ + public AnnotationToolbar(CustomToolbarViewModel bindingContext) + { + BindingContext = bindingContext; + InitializeComponent(); + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/BottomToolbar.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/BottomToolbar.xaml new file mode 100644 index 00000000..510a9bd6 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/BottomToolbar.xaml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/BottomToolbar.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/BottomToolbar.xaml.cs new file mode 100644 index 00000000..c4cea2b2 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/BottomToolbar.xaml.cs @@ -0,0 +1,19 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using System.ComponentModel; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class BottomToolbar : ContentView +{ + + public BottomToolbar() + { + InitializeComponent(); + } +} diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/ColorToolbar.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/ColorToolbar.xaml new file mode 100644 index 00000000..e56ccbd5 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/ColorToolbar.xaml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/ColorToolbar.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/ColorToolbar.xaml.cs new file mode 100644 index 00000000..96f67891 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/ColorToolbar.xaml.cs @@ -0,0 +1,51 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Microsoft.Maui.Controls.Shapes; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class ColorToolbar : ContentView +{ + Ellipse selectedColorButtonHighlight; + + public ColorToolbar() + { + InitializeComponent(); + selectedColorButtonHighlight = new Ellipse(); + selectedColorButtonHighlight.WidthRequest = 30; + selectedColorButtonHighlight.HeightRequest = 30; + selectedColorButtonHighlight.VerticalOptions = LayoutOptions.Center; + selectedColorButtonHighlight.Stroke = new SolidColorBrush(Colors.Black); + selectedColorButtonHighlight.StrokeThickness = 2; + } + + private void ColorButton_Clicked(object sender, EventArgs e) + { + if (sender is Button button) + { + if(button!=OpacityButton) + { + int column = Grid.GetColumn(button); + Grid.SetColumn(selectedColorButtonHighlight, column); + if (BindingContext is CustomToolbarViewModel bindingContext) + bindingContext.ColorCommand.Execute(button.BackgroundColor); + } + else + Grid.SetColumn(selectedColorButtonHighlight, 8); + } + if (selectedColorButtonHighlight.Parent == null) + colorGrid.Children.Add(selectedColorButtonHighlight); + } + + private void OpacityValue_Changed(object sender, EventArgs e) + { + float opacity = (float)opacitySlider.Value; + if (BindingContext is CustomToolbarViewModel bindingContext) + bindingContext.OpacityCommand.Execute(opacity); + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/EraserToolbar.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/EraserToolbar.xaml new file mode 100644 index 00000000..1f6af4e2 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/EraserToolbar.xaml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/EraserToolbar.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/EraserToolbar.xaml.cs new file mode 100644 index 00000000..6a185cf7 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/EraserToolbar.xaml.cs @@ -0,0 +1,19 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using System.ComponentModel; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class EraserToolbar : PropertyToolbar +{ + public EraserToolbar(CustomToolbarViewModel bindingContext) + { + BindingContext = bindingContext; + InitializeComponent(); + } +} diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/InkToolbar.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/InkToolbar.xaml new file mode 100644 index 00000000..081be696 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/InkToolbar.xaml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/InkToolbar.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/InkToolbar.xaml.cs new file mode 100644 index 00000000..43a8a82b --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/InkToolbar.xaml.cs @@ -0,0 +1,36 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using System.ComponentModel; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class InkToolbar : PropertyToolbar +{ + public InkToolbar(CustomToolbarViewModel bindingContext) + { + BindingContext = bindingContext; + InitializeComponent(); + DeleteButtonLayout = deleteButtonLayout; + } + private void deleteButtonLayout_PropertyChanged(object sender, PropertyChangedEventArgs e) + { + if (e.PropertyName == "IsVisible") + { + if (deleteButtonLayout.IsVisible) + { + deleteButtonLayout.Margin = new Thickness(10, 0, 0, 0); + lockUnlokButtonLayout.Margin = new Thickness(10, 0, 0, 0); + } + else + { + deleteButtonLayout.Margin = new Thickness(0, 0, 0, 0); + lockUnlokButtonLayout.Margin = new Thickness(0, 0, 0, 0); + } + } + } +} diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/ShapesPropertyToolbar.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/ShapesPropertyToolbar.xaml new file mode 100644 index 00000000..33f639ae --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/ShapesPropertyToolbar.xaml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/ShapesPropertyToolbar.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/ShapesPropertyToolbar.xaml.cs new file mode 100644 index 00000000..a12dbd44 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/ShapesPropertyToolbar.xaml.cs @@ -0,0 +1,37 @@ + +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using System.ComponentModel; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; +public partial class ShapesPropertyToolbar : PropertyToolbar +{ + public ShapesPropertyToolbar(CustomToolbarViewModel bindingContext) + { + BindingContext = bindingContext; + InitializeComponent(); + DeleteButtonLayout = deleteButtonLayout; + } + + private void deleteButtonLayout_PropertyChanged(object sender, PropertyChangedEventArgs e) + { + if (e.PropertyName == "IsVisible") + { + if (deleteButtonLayout.IsVisible) + { + deleteButtonLayout.Margin = new Thickness(10, 0, 0, 0); + lockUnlokButtonLayout.Margin = new Thickness(10, 0, 0, 0); + } + else + { + deleteButtonLayout.Margin = new Thickness(0, 0, 0, 0); + lockUnlokButtonLayout.Margin = new Thickness(0, 0, 0, 0); + } + } + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/ShapesToolbar.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/ShapesToolbar.xaml new file mode 100644 index 00000000..d16e5c4f --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/ShapesToolbar.xaml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/ShapesToolbar.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/ShapesToolbar.xaml.cs new file mode 100644 index 00000000..bba30d94 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/ShapesToolbar.xaml.cs @@ -0,0 +1,20 @@ + +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using System.ComponentModel; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; +public partial class ShapesToolbar : ContentView +{ + public ShapesToolbar(CustomToolbarViewModel bindingContext) + { + BindingContext = bindingContext; + InitializeComponent(); + } + +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StampDialogMobile.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StampDialogMobile.xaml new file mode 100644 index 00000000..41707ca7 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StampDialogMobile.xaml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StampDialogMobile.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StampDialogMobile.xaml.cs new file mode 100644 index 00000000..481adb50 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StampDialogMobile.xaml.cs @@ -0,0 +1,154 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Microsoft.Maui.Controls.Shapes; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class StampDialogMobile : ContentView +{ + Ellipse? selectedColorButtonHighlight; + Button? PreButton; + + public event EventHandler? CustomStampCreated; + public StampDialogMobile() + { + InitializeComponent(); + this.PropertyChanged += StampDialogPropertyChanged; + } + + private async void StampDialogPropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e) + { + if (e.PropertyName == "IsVisible" && this.IsVisible == true) + { + await Task.Delay(250); + createEntry?.Focus(); + } + else if(e.PropertyName == "IsVisible" && this.IsVisible == false) + { + InitializeDialog(); + } + } + + private void OnBackButtonClicked(object sender, EventArgs e) + { + this.IsVisible = false; + } + + private void OnEntryTextChanged(object sender, TextChangedEventArgs e) + { + if (string.IsNullOrWhiteSpace(e.NewTextValue)) + { + label.Text = "Text"; + } + else + { + label.Text = e.NewTextValue; + } + double textWidth = MeasureTextWidth(label.Text, label.FontSize); + double newBorderWidth = textWidth + 50; + border.WidthRequest = newBorderWidth; + layout.WidthRequest = newBorderWidth; + } + + private double MeasureTextWidth(string text, double fontSize) + { + label.Text = text; + SizeRequest sizeRequest = label.Measure(double.PositiveInfinity, double.PositiveInfinity); + return sizeRequest.Request.Width; + } + + private void ColorHighlightButton_Clicked(object sender, EventArgs e) + { + if (PreButton != null) + { + PreButton.HeightRequest = 35; + PreButton.WidthRequest = 35; + PreButton.CornerRadius = 20; + } + PreButton = sender as Button; + if (selectedColorButtonHighlight == null) + { + selectedColorButtonHighlight = new Ellipse(); + selectedColorButtonHighlight.WidthRequest = 35; + selectedColorButtonHighlight.HeightRequest = 35; + selectedColorButtonHighlight.VerticalOptions = LayoutOptions.Center; + selectedColorButtonHighlight.HorizontalOptions = LayoutOptions.Center; + selectedColorButtonHighlight.Stroke = Brush.Black; + selectedColorButtonHighlight.StrokeThickness = 2; + } + if (sender is Button button) + { + button.HeightRequest = 28; + button.WidthRequest = 28; + button.CornerRadius = 14; + button.HorizontalOptions = LayoutOptions.Center; + button.VerticalOptions = LayoutOptions.Center; + int column = Grid.GetColumn(button); + int row = Grid.GetRow(button); + Grid.SetColumn(selectedColorButtonHighlight, column); + Grid.SetRow(selectedColorButtonHighlight, row); + border.Stroke = button.BackgroundColor; + border.BackgroundColor = GetLightenColor(button.BackgroundColor, (float)0.85); + label.TextColor = button.BackgroundColor; + } + if (selectedColorButtonHighlight.Parent == null) + { + stampColor.Children.Add(selectedColorButtonHighlight); + } + } + + internal Color GetLightenColor(Color color, float lighteningFactor) + { + float R = (float)color.Red; + float G = (float)color.Green; + float B = (float)color.Blue; + + if (lighteningFactor < -1) + lighteningFactor = -1; + else if (lighteningFactor > 1) + lighteningFactor = 1; + + if (lighteningFactor < 0) + { + lighteningFactor = 1 + lighteningFactor; + R *= lighteningFactor; + G *= lighteningFactor; + B *= lighteningFactor; + } + else + { + R = (1 - R) * lighteningFactor + R; + G = (1 - G) * lighteningFactor + G; + B = (1 - B) * lighteningFactor + B; + } + return Color.FromRgba((float)R, (float)G, (float)B, color.Alpha); + } + + private void OnApplyButtonClicked(object sender, EventArgs e) + { + CustomStampEventArgs customStampEventArgs = new CustomStampEventArgs(border); + CustomStampCreated?.Invoke(this, customStampEventArgs); + } + + void InitializeDialog() + { + stampColor.Children.Remove(selectedColorButtonHighlight); + label.Text = "Text"; + border.Stroke = Color.FromArgb("#A007A3"); + border.BackgroundColor = Color.FromArgb("#FADFFB"); + label.TextColor = Color.FromArgb("#A007A3"); + border.WidthRequest = 80; + createEntry.Text = ""; + if(PreButton != null) + { + PreButton.HeightRequest = 35; + PreButton.WidthRequest = 35; + PreButton.CornerRadius = 20; + } + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StampPropertyToolbar.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StampPropertyToolbar.xaml new file mode 100644 index 00000000..a45f21d4 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StampPropertyToolbar.xaml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StampPropertyToolbar.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StampPropertyToolbar.xaml.cs new file mode 100644 index 00000000..671f3d92 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StampPropertyToolbar.xaml.cs @@ -0,0 +1,40 @@ + +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion + +using Microsoft.Maui.Controls.Shapes; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; +public partial class StampPropertyToolbar : PropertyToolbar +{ + Ellipse selectedColorButtonHighlight; + public StampPropertyToolbar(CustomToolbarViewModel bindingContext) + { + BindingContext = bindingContext; + InitializeComponent(); + DeleteButtonLayout = deleteButtonLayout; + selectedColorButtonHighlight = new Ellipse(); + selectedColorButtonHighlight.WidthRequest = 30; + selectedColorButtonHighlight.HeightRequest = 30; + selectedColorButtonHighlight.VerticalOptions = LayoutOptions.Center; + selectedColorButtonHighlight.Stroke = new SolidColorBrush(Colors.Black); + selectedColorButtonHighlight.StrokeThickness = 2; + } + + private void ColorButton_Clicked(object sender, EventArgs e) + { + if (sender is Button button) + { + int column = Grid.GetColumn(button); + Grid.SetColumn(selectedColorButtonHighlight, column); + + } + if (selectedColorButtonHighlight.Parent == null) + opacityGrid.Children.Add(selectedColorButtonHighlight); + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StampViewMobile.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StampViewMobile.xaml new file mode 100644 index 00000000..235956b4 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StampViewMobile.xaml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StampViewMobile.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StampViewMobile.xaml.cs new file mode 100644 index 00000000..859a4b5a --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StampViewMobile.xaml.cs @@ -0,0 +1,55 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Syncfusion.Maui.PdfViewer; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class StampViewMobile : StampView +{ + public event EventHandler? CreateStampMobileClicked; + public StampViewMobile() + { + InitializeComponent(); + AssignControls(); + } + + void AssignControls() + { + CustomStampListLayout = CustomStampsList; + } + + private void ListView_Tapped(object sender, Syncfusion.Maui.ListView.ItemTappedEventArgs e) + { + if (StampHelper != null) + { + if (e.DataItem is StandardStamps standardStamp && standardStamp.LabelText != null) + { + stampType = GetStampType(standardStamp.LabelText); + StampMode = true; + } + } + if (Parent != null && Parent.BindingContext is CustomToolbarViewModel viewModel) + viewModel.IsStampViewVisible = false; + OnStampSelected(); + } + + public void CreateStampMobile_Clicked(object sender, EventArgs e) + { + StampDialogMobileEventArgs stampDialogMobileEventArgs = new StampDialogMobileEventArgs(false); + CreateStampMobileClicked?.Invoke(this, stampDialogMobileEventArgs); + } +} + +public class StampDialogMobileEventArgs : EventArgs +{ + public bool? IsVisible { get; set; } + public StampDialogMobileEventArgs(bool isVisible) + { + this.IsVisible = isVisible; + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StickyNotePropertyToolbar.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StickyNotePropertyToolbar.xaml new file mode 100644 index 00000000..8fc9c03c --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StickyNotePropertyToolbar.xaml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StickyNotePropertyToolbar.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StickyNotePropertyToolbar.xaml.cs new file mode 100644 index 00000000..30e3ad21 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StickyNotePropertyToolbar.xaml.cs @@ -0,0 +1,34 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; +public partial class StickyNotePropertyToolbar : PropertyToolbar +{ + public StickyNotePropertyToolbar(CustomToolbarViewModel bindingContext) + { + BindingContext = bindingContext; + InitializeComponent(); + DeleteButtonLayout = deleteButtonLayout; + } + + private void deleteButtonLayout_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) + { + if (e.PropertyName == "IsVisible") + { + if (deleteButtonLayout.IsVisible) + { + deleteButtonLayout.Margin = new Thickness(10, 0, 0, 0); + lockUnlokButtonLayout.Margin = new Thickness(7, 0, 0, 0); + } + else + { + deleteButtonLayout.Margin = new Thickness(0, 0, 0, 0); + lockUnlokButtonLayout.Margin = new Thickness(0, 0, 0, 0); + } + } + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StickyNoteToolbar.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StickyNoteToolbar.xaml new file mode 100644 index 00000000..f8d2b5de --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StickyNoteToolbar.xaml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StickyNoteToolbar.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StickyNoteToolbar.xaml.cs new file mode 100644 index 00000000..37b3560e --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/StickyNoteToolbar.xaml.cs @@ -0,0 +1,16 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class StickyNoteToolbar : ContentView +{ + public StickyNoteToolbar() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/TextMarkUpPropertyToolbar.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/TextMarkUpPropertyToolbar.xaml new file mode 100644 index 00000000..830fe84b --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/TextMarkUpPropertyToolbar.xaml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/TextMarkUpPropertyToolbar.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/TextMarkUpPropertyToolbar.xaml.cs new file mode 100644 index 00000000..8095e466 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/TextMarkUpPropertyToolbar.xaml.cs @@ -0,0 +1,37 @@ + +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using System.ComponentModel; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; +public partial class TextMarkUpPropertyToolbar : PropertyToolbar +{ + public TextMarkUpPropertyToolbar(CustomToolbarViewModel bindingContext) + { + BindingContext = bindingContext; + InitializeComponent(); + DeleteButtonLayout = deleteButtonLayout; + } + + private void deleteButtonLayout_PropertyChanged(object sender, PropertyChangedEventArgs e) + { + if (e.PropertyName == "IsVisible") + { + if (deleteButtonLayout.IsVisible) + { + deleteButtonLayout.Margin = new Thickness(10, 0, 0, 0); + lockUnlokButtonLayout.Margin = new Thickness(10, 0, 0, 0); + } + else + { + deleteButtonLayout.Margin = new Thickness(0, 0, 0, 0); + lockUnlokButtonLayout.Margin = new Thickness(0, 0, 0, 0); + } + } + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/TextMarkupToolbar - Copy.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/TextMarkupToolbar - Copy.xaml new file mode 100644 index 00000000..18ba8978 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/TextMarkupToolbar - Copy.xaml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/TextMarkupToolbar - Copy.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/TextMarkupToolbar - Copy.xaml.cs new file mode 100644 index 00000000..95a09f6e --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/BottolToolbar/TextMarkupToolbar - Copy.xaml.cs @@ -0,0 +1,19 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using System.ComponentModel; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class TextMarkupToolbar : ContentView +{ + public TextMarkupToolbar(CustomToolbarViewModel bindingContext) + { + BindingContext = bindingContext; + InitializeComponent(); + } +} diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ColorCode.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ColorCode.xaml new file mode 100644 index 00000000..9b8dd033 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ColorCode.xaml @@ -0,0 +1,284 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ColorCode.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ColorCode.xaml.cs new file mode 100644 index 00000000..6d64b69a --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ColorCode.xaml.cs @@ -0,0 +1,218 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Microsoft.Maui.Controls.Shapes; +using SampleBrowser.Maui.PdfViewer.SfPdfViewer; +using Syncfusion.Maui.Sliders; +using Syncfusion.Maui.TabView; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class ColorCode : ContentView +{ + Ellipse? selectedColorButtonHighlight; + Ellipse? selectedColorButtonHighlightStroke; + + Button? PreButton = null; + public ColorCode() + { + InitializeComponent(); + + Colorpaletteborder.Content = MyGrid; + this.Content = Colorpaletteborder; + tabView.SelectionChanged += OnSelectionChanged; + } + + Border Colorpaletteborder = new Border() + { + BackgroundColor = Color.FromArgb("#EEE8F4"), + Stroke = Color.FromArgb("#26000000"), + StrokeThickness = 1, + VerticalOptions = LayoutOptions.Start, + HorizontalOptions = LayoutOptions.Start, + StrokeShape = new RoundRectangle + { + CornerRadius = new CornerRadius(12) + }, + Shadow = new Shadow + { + Offset = new Point(-1, 0), + Brush = Color.FromRgba("#000000"), + Radius = 8, + Opacity = 0.5f + }, + WidthRequest = 280, + }; + + private void OnSelectionChanged(object? sender, TabSelectionChangedEventArgs e) + { + if (e.OldIndex != e.NewIndex) + { + if (sender is View view && view.Parent is Grid grid) + { + if (Fill.IsSelected) + { + grid.HeightRequest = 350; + Fill.TextColor = Color.FromArgb("#6750A4"); + Stroke.TextColor = Color.FromArgb("#49454F"); + } + else if (Stroke.IsSelected) + { + grid.HeightRequest = 370; + Stroke.TextColor = Color.FromArgb("#6750A4"); + Fill.TextColor = Color.FromArgb("#49454F"); + } + int row = Grid.GetRow(grid); + Grid.SetRow(view, row); + } + } + } + + private void ColorFillButton_Clicked(object sender, EventArgs e) + { + if (PreButton != null) + { + PreButton.HeightRequest = 30; + PreButton.WidthRequest = 30; + PreButton.CornerRadius = 15; + } + PreButton = sender as Button; + if (selectedColorButtonHighlight == null) + { + selectedColorButtonHighlight = new Ellipse(); + selectedColorButtonHighlight.WidthRequest = 30; + selectedColorButtonHighlight.HeightRequest = 30; + selectedColorButtonHighlight.VerticalOptions = LayoutOptions.Center; + selectedColorButtonHighlight.HorizontalOptions = LayoutOptions.Center; + selectedColorButtonHighlight.Stroke = Brush.Black; + selectedColorButtonHighlight.StrokeThickness = 2; + } + if (sender is Button button) + { + button.HeightRequest = 22; + button.WidthRequest = 22; + button.CornerRadius = 11; + button.HorizontalOptions = LayoutOptions.Center; + button.VerticalOptions = LayoutOptions.Center; + int column = Grid.GetColumn(button); + int row = Grid.GetRow(button); + Grid.SetColumn(selectedColorButtonHighlight, column); + Grid.SetRow(selectedColorButtonHighlight, row); + if (BindingContext is CustomToolbarViewModel bindingContext) + { + bindingContext.IsDeskTopColorToolbarVisible = false; + bindingContext.IsDeskTopFillColorToolbarVisible = true; + bindingContext.ColorCommand.Execute(button.BackgroundColor); + } + + } + if (selectedColorButtonHighlight.Parent == null) + { + ColorFill.Children.Add(selectedColorButtonHighlight); + } + } + + private void ColorStrokeButton_Clicked(object sender, EventArgs e) + { + if (PreButton != null) + { + PreButton.HeightRequest = 30; + PreButton.WidthRequest = 30; + PreButton.CornerRadius = 15; + } + PreButton = sender as Button; + if (selectedColorButtonHighlightStroke == null) + { + selectedColorButtonHighlightStroke = new Ellipse(); + selectedColorButtonHighlightStroke.WidthRequest = 30; + selectedColorButtonHighlightStroke.HeightRequest = 30; + selectedColorButtonHighlightStroke.VerticalOptions = LayoutOptions.Center; + selectedColorButtonHighlightStroke.HorizontalOptions = LayoutOptions.Center; + selectedColorButtonHighlightStroke.Stroke = Brush.Black; + selectedColorButtonHighlightStroke.StrokeThickness = 2; + } + if (sender is Button button) + { + button.HeightRequest = 22; + button.WidthRequest = 22; + button.CornerRadius = 11; + button.HorizontalOptions = LayoutOptions.Center; + button.VerticalOptions = LayoutOptions.Center; + int column = Grid.GetColumn(button); + int row = Grid.GetRow(button); + Grid.SetColumn(selectedColorButtonHighlightStroke, column); + Grid.SetRow(selectedColorButtonHighlightStroke, row); + if (BindingContext is CustomToolbarViewModel bindingContext) + { + bindingContext.IsDeskTopColorToolbarVisible = true; + bindingContext.IsDeskTopFillColorToolbarVisible = false; + bindingContext.ColorCommand.Execute(button.BackgroundColor); + } + } + if (selectedColorButtonHighlightStroke.Parent == null) + { + ColorStroke.Children.Add(selectedColorButtonHighlightStroke); + } + } + + private void thicknessSlider_valueChanged(object sender, EventArgs e) + { + float thickness = (float)desktopThicknessSlider.Value; + + if (BindingContext is CustomToolbarViewModel bindingContext) + { + bindingContext.IsDeskTopColorToolbarVisible = true; + bindingContext.IsDeskTopFillColorToolbarVisible = false; + bindingContext.ThicknessCommand.Execute(thickness); + } + + } + + private void ShapeStrokeOpacitySlidervalue_Chnaged(object sender, EventArgs e) + { + float opacity = (float)shapeStrokeOpacitySlider.Value; + if (BindingContext is CustomToolbarViewModel bindingContext) + { + bindingContext.IsDeskTopColorToolbarVisible = true; + bindingContext.IsDeskTopFillColorToolbarVisible = false; + bindingContext.OpacityCommand.Execute(opacity); + } + } + + private void ShapeFillColorOpacitySlidervalue_Chnaged(object sender, EventArgs e) + { + float opacity = (float)shapeFillColorOpacitySlider.Value; + if (BindingContext is CustomToolbarViewModel bindingContext) + { + bindingContext.IsDeskTopColorToolbarVisible = false; + bindingContext.IsDeskTopFillColorToolbarVisible = true; + bindingContext.OpacityCommand.Execute(opacity); + } + } + + private void NoColorButton_Clicked(object sender, EventArgs e) + { + if (PreButton != null) + { + PreButton.HeightRequest = 30; + PreButton.WidthRequest = 30; + PreButton.CornerRadius = 15; + ColorFill.Children.Remove(selectedColorButtonHighlight); + selectedColorButtonHighlight = null; + } + if (sender is Button button) + { + button.BackgroundColor = Colors.Transparent; + if (BindingContext is CustomToolbarViewModel bindingContext) + { + bindingContext.IsDeskTopColorToolbarVisible = false; + bindingContext.IsDeskTopFillColorToolbarVisible = true; + bindingContext.ColorCommand.Execute(button.BackgroundColor); + } + } + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/EraserThickness.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/EraserThickness.xaml new file mode 100644 index 00000000..a77998b9 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/EraserThickness.xaml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/EraserThickness.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/EraserThickness.xaml.cs new file mode 100644 index 00000000..90431ac5 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/EraserThickness.xaml.cs @@ -0,0 +1,50 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Microsoft.Maui.Controls.Shapes; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; +public partial class EraserThickness : ContentView +{ + public EraserThickness() + { + InitializeComponent(); + Thicknessborder.Content = MyGrid; + this.Content = Thicknessborder; + } + Border Thicknessborder = new Border() + { + BackgroundColor = Color.FromArgb("#EEE8F4"), + Stroke = Color.FromArgb("#26000000"), + StrokeThickness = 1, + VerticalOptions = LayoutOptions.Start, + HorizontalOptions = LayoutOptions.Start, + StrokeShape = new RoundRectangle + { + CornerRadius = new CornerRadius(12) + }, + Shadow = new Shadow + { + Offset = new Point(-1, 0), + Brush = Color.FromRgba("#000000"), + Radius = 5, + Opacity = 0.3f + }, + WidthRequest = 280, + }; + + private void EraserThicknessValue_Changed(object sender, EventArgs e) + { + float thickness = (float)eraserThicknessSlider.Value; + if (BindingContext is CustomToolbarViewModel bindingContext) + { + bindingContext.IsDeskTopColorToolbarVisible = true; + bindingContext.IsDeskTopFillColorToolbarVisible = false; + bindingContext.ThicknessCommand.Execute(thickness); + } + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/FileOperationListView.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/FileOperationListView.xaml new file mode 100644 index 00000000..adc0bbac --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/FileOperationListView.xaml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/FileOperationListView.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/FileOperationListView.xaml.cs new file mode 100644 index 00000000..bb2b8520 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/FileOperationListView.xaml.cs @@ -0,0 +1,95 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Microsoft.Maui.Controls.Shapes; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class FileOperationListView : ContentView +{ + public event EventHandler? ItemTapped; + public FileOperationListView() + { + InitializeComponent(); + AddItems(); + } + public void AddItems() + { + openLayout.Children.Add(CreateView("\uE712", "Open", true)); + saveLayout.Children.Add(CreateView("\uE75f", "Save", false)); + } + private void ItemClicked(object? sender, EventArgs e) + { + GestureGrid? grid = sender as GestureGrid; + if(BindingContext is CustomToolbarViewModel viewModel) + { + if (grid!.Children[1] is Label openIconName && openIconName.Text.Equals("Open")) + { + viewModel.OpenCloseFile(); + } + else if(grid!.Children[1] is Label saveIconName && saveIconName.Text.Equals("Save")) + { + viewModel.SaveDocument(); + } + else if(grid!.Children[1] is Label importIconName && importIconName.Text.Equals("Import Annotation")) + { + viewModel.ImportAnnotations(); + } + else if (grid!.Children[1] is Label exportIconName && exportIconName.Text.Equals("Export Annotation")) + { + viewModel.ExportAnnotations(); + } + } + ItemTapped?.Invoke(this, new ItemTappedEventArgs(grid!.Children[0])); + } + private Grid CreateView(string icon, string iconName, bool isExpand) + { + GestureGrid childRow = new GestureGrid(); + childRow.WidthRequest = 120; + childRow.HeightRequest = 40; + childRow.PointerPressed += ItemClicked; + Label iconLabel = new Label() + { + Padding = new Thickness(20, 0, 0, 0), + TextColor = new Color(0,0,0,0.6f), + FontSize = 16, + FontFamily = "Maui Material Assets", + HorizontalOptions = LayoutOptions.Start, + VerticalOptions = LayoutOptions.Center, + VerticalTextAlignment = TextAlignment.Center, + Text = icon, + }; + childRow.Children.Add(iconLabel); + Label iconNameLabel = new Label() + { + Padding = new Thickness(15, 0, 0, 0), + Margin = new Thickness(30, 0, 0, 0), + TextColor = new Color(0, 0, 0, 0.6f), + FontSize = 16, + VerticalOptions = LayoutOptions.Center, + VerticalTextAlignment = TextAlignment.Center, + Text = iconName, + }; + childRow.Children.Add(iconNameLabel); + if(isExpand) + { + Label expandLabel = new Label() + { + Margin = new Thickness(0, 0, 15, 0), + TextColor = new Color(0, 0, 0, 0.6f), + FontFamily = "Maui Material Assets", + FontSize = 16, + HorizontalOptions = LayoutOptions.End, + VerticalOptions = LayoutOptions.Center, + VerticalTextAlignment = TextAlignment.Center, + Text = "\uE704" + }; + childRow.Children.Add(expandLabel); + } + return childRow; + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/InkColorCode.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/InkColorCode.xaml new file mode 100644 index 00000000..7805c504 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/InkColorCode.xaml @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/InkColorCode.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/InkColorCode.xaml.cs new file mode 100644 index 00000000..89f3428c --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/InkColorCode.xaml.cs @@ -0,0 +1,110 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Microsoft.Maui.Controls.Shapes; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class InkColorCode : ContentView + +{ + Ellipse? selectedColorButtonHighlight; + + Button? PreButton = null; + public InkColorCode() + { + InitializeComponent(); + Colorpaletteborder.Content = MyGrid; + this.Content = Colorpaletteborder; + } + + Border Colorpaletteborder = new Border() + { + BackgroundColor = Color.FromArgb("#EEE8F4"), + Stroke = Color.FromArgb("#26000000"), + StrokeThickness = 1, + VerticalOptions = LayoutOptions.Start, + HorizontalOptions = LayoutOptions.Start, + StrokeShape = new RoundRectangle + { + CornerRadius = new CornerRadius(12) + }, + Shadow = new Shadow + { + Offset = new Point(-1, 0), + Brush = Color.FromRgba("#000000"), + Radius = 8, + Opacity = 0.5f + }, + WidthRequest = 280, + }; + private void ColorHeighlightButton_Clicked(object sender, EventArgs e) + { + if (PreButton != null) + { + PreButton.HeightRequest = 30; + PreButton.WidthRequest = 30; + PreButton.CornerRadius = 15; + } + PreButton = sender as Button; + if (selectedColorButtonHighlight == null) + { + selectedColorButtonHighlight = new Ellipse(); + selectedColorButtonHighlight.WidthRequest = 30; + selectedColorButtonHighlight.HeightRequest = 30; + selectedColorButtonHighlight.VerticalOptions = LayoutOptions.Center; + selectedColorButtonHighlight.HorizontalOptions = LayoutOptions.Center; + selectedColorButtonHighlight.Stroke = Brush.Black; + selectedColorButtonHighlight.StrokeThickness = 2; + } + if (sender is Button button) + { + button.HeightRequest = 22; + button.WidthRequest = 22; + button.CornerRadius = 11; + button.HorizontalOptions = LayoutOptions.Center; + button.VerticalOptions = LayoutOptions.Center; + int column = Grid.GetColumn(button); + int row = Grid.GetRow(button); + Grid.SetColumn(selectedColorButtonHighlight, column); + Grid.SetRow(selectedColorButtonHighlight, row); + if (BindingContext is CustomToolbarViewModel bindingContext) + { + bindingContext.IsDeskTopColorToolbarVisible = false; + bindingContext.IsDeskTopFillColorToolbarVisible = false; + bindingContext.ColorCommand.Execute(button.BackgroundColor); + } + } + if (selectedColorButtonHighlight.Parent == null) + { + MyInk.Children.Add(selectedColorButtonHighlight); + } + } + + private void Thicknes_ValueChanged(object sender, EventArgs e) + { + float thickness = (float)inkThicknessSlider.Value; + + if (BindingContext is CustomToolbarViewModel bindingContext) + { + bindingContext.IsDeskTopColorToolbarVisible = false; + bindingContext.IsDeskTopFillColorToolbarVisible = false; + bindingContext.ThicknessCommand.Execute(thickness); + } + } + + private void OpacitySliderValue_Changed(object sender, EventArgs e) + { + float opacity = (float)inkOpacitySlider.Value; + if (BindingContext is CustomToolbarViewModel bindingContext) + { + bindingContext.IsDeskTopColorToolbarVisible = true; + bindingContext.IsDeskTopFillColorToolbarVisible = false; + bindingContext.OpacityCommand.Execute(opacity); + } + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/PropertyToolbar.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/PropertyToolbar.cs new file mode 100644 index 00000000..6527b047 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/PropertyToolbar.cs @@ -0,0 +1,26 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class PropertyToolbar : ContentView +{ + internal HorizontalStackLayout? DeleteButtonLayout { get; set; } + + bool isDeleteButtonVisible = false; + internal bool IsDeleteButtonVisible + { + get { return isDeleteButtonVisible; } + set + { + isDeleteButtonVisible = value; + if (DeleteButtonLayout != null) + DeleteButtonLayout.IsVisible = value; + } + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ShapeListView.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ShapeListView.xaml new file mode 100644 index 00000000..e6db2d66 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ShapeListView.xaml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ShapeListView.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ShapeListView.xaml.cs new file mode 100644 index 00000000..9c88ff7f --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ShapeListView.xaml.cs @@ -0,0 +1,53 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using System.Collections.ObjectModel; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class ShapeListView : ContentView +{ + public ShapeListView() + { + InitializeComponent(); + listView.ItemsSource = new List() + { + new AnnotationButtonItem() + { + Icon = "\uE731", + IconName = "Square" + }, + new AnnotationButtonItem() + { + Icon = "\uE73f", + IconName = "Circle" + }, + new AnnotationButtonItem() + { + Icon = "\uE73d", + IconName = "Line" + }, + new AnnotationButtonItem() + { + Icon = "\uE73c", + IconName = "Arrow" + }, + }; + } + + private void SfListView_ItemTapped(object sender, Syncfusion.Maui.ListView.ItemTappedEventArgs e) + { + if (e.DataItem is AnnotationButtonItem textMarkupDetails && BindingContext is CustomToolbarViewModel viewModel) + { + viewModel.ToolbarCommand.Execute(textMarkupDetails.IconName); + } + } + internal void DisappearHighlight() + { + listView.SelectedItem = null; + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/StampOpacity.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/StampOpacity.xaml new file mode 100644 index 00000000..d2908fbf --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/StampOpacity.xaml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/StampOpacity.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/StampOpacity.xaml.cs new file mode 100644 index 00000000..4f841b29 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/StampOpacity.xaml.cs @@ -0,0 +1,50 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Microsoft.Maui.Controls.Shapes; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; +public partial class StampOpacity : ContentView +{ + public StampOpacity() + { + InitializeComponent(); + Opacityborder.Content = MyGrid; + this.Content = Opacityborder; + } + Border Opacityborder = new Border() + { + BackgroundColor = Color.FromArgb("#EEE8F4"), + Stroke = Color.FromArgb("#26000000"), + StrokeThickness = 1, + VerticalOptions = LayoutOptions.Start, + HorizontalOptions = LayoutOptions.Start, + StrokeShape = new RoundRectangle + { + CornerRadius = new CornerRadius(12) + }, + Shadow = new Shadow + { + Offset = new Point(-1, 0), + Brush = Color.FromRgba("#000000"), + Radius = 5, + Opacity = 0.3f + }, + WidthRequest = 280, + }; + + private void StampOpacityValue_Changed(object sender, EventArgs e) + { + float opacity = (float)stampOpacitySlider.Value; + if (BindingContext is CustomToolbarViewModel bindingContext) + { + bindingContext.IsDeskTopColorToolbarVisible = true; + bindingContext.IsDeskTopFillColorToolbarVisible = false; + bindingContext.OpacityCommand.Execute(opacity); + } + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/StickyNoteColorCode.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/StickyNoteColorCode.xaml new file mode 100644 index 00000000..1439586d --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/StickyNoteColorCode.xaml @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/StickyNoteColorCode.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/StickyNoteColorCode.xaml.cs new file mode 100644 index 00000000..b7a6d2ec --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/StickyNoteColorCode.xaml.cs @@ -0,0 +1,97 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Microsoft.Maui.Controls.Shapes; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class StickyNoteColorCode : ContentView +{ + Ellipse? selectedColorButtonHighlight; + + Button? PreButton = null; + public StickyNoteColorCode() + { + InitializeComponent(); + Colorpaletteborder.Content = MyGrid; + this.Content = Colorpaletteborder; + } + + Border Colorpaletteborder = new Border() + { + BackgroundColor = Color.FromArgb("#EEE8F4"), + Stroke = Color.FromArgb("#26000000"), + StrokeThickness = 1, + VerticalOptions = LayoutOptions.Start, + HorizontalOptions = LayoutOptions.Start, + StrokeShape = new RoundRectangle + { + CornerRadius = new CornerRadius(12) + }, + Shadow = new Shadow + { + Offset = new Point(-1, 0), + Brush = Color.FromRgba("#000000"), + Radius = 8, + Opacity = 0.5f + }, + WidthRequest = 280, + }; + private void ColorHeighlightButton_Clicked(object sender, EventArgs e) + { + if (PreButton != null) + { + PreButton.HeightRequest = 30; + PreButton.WidthRequest = 30; + PreButton.CornerRadius = 15; + } + PreButton = sender as Button; + if (selectedColorButtonHighlight == null) + { + selectedColorButtonHighlight = new Ellipse(); + selectedColorButtonHighlight.WidthRequest = 30; + selectedColorButtonHighlight.HeightRequest = 30; + selectedColorButtonHighlight.VerticalOptions = LayoutOptions.Center; + selectedColorButtonHighlight.HorizontalOptions = LayoutOptions.Center; + selectedColorButtonHighlight.Stroke = Brush.Black; + selectedColorButtonHighlight.StrokeThickness = 2; + } + if (sender is Button button) + { + button.HeightRequest = 22; + button.WidthRequest = 22; + button.CornerRadius = 11; + button.HorizontalOptions = LayoutOptions.Center; + button.VerticalOptions = LayoutOptions.Center; + int column = Grid.GetColumn(button); + int row = Grid.GetRow(button); + Grid.SetColumn(selectedColorButtonHighlight, column); + Grid.SetRow(selectedColorButtonHighlight, row); + if (BindingContext is CustomToolbarViewModel bindingContext) + { + bindingContext.IsDeskTopColorToolbarVisible = true; + bindingContext.IsDeskTopFillColorToolbarVisible = false; + bindingContext.ColorCommand.Execute(button.BackgroundColor); + } + } + if (selectedColorButtonHighlight.Parent == null) + { + MyTextMarkup.Children.Add(selectedColorButtonHighlight); + } + } + + private void StickyNoteOpacitySliderChanged(object sender, EventArgs e) + { + float opacity = (float)stickyNoteOpacitySlider.Value; + if (BindingContext is CustomToolbarViewModel bindingContext) + { + bindingContext.IsDeskTopColorToolbarVisible = true; + bindingContext.IsDeskTopFillColorToolbarVisible = false; + bindingContext.OpacityCommand.Execute(opacity); + } + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/StickyNoteListView.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/StickyNoteListView.xaml new file mode 100644 index 00000000..b36934ef --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/StickyNoteListView.xaml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/StickyNoteListView.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/StickyNoteListView.xaml.cs new file mode 100644 index 00000000..22cda2f2 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/StickyNoteListView.xaml.cs @@ -0,0 +1,66 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Syncfusion.Maui.PdfViewer; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class StickyNoteListView : ContentView +{ + + public StickyNoteListView() + { + InitializeComponent(); + listView.ItemsSource = new List() + { + new AnnotationButtonItem() + { + Icon = "\uE775", + IconName = "Note" + }, + new AnnotationButtonItem() + { + Icon = "\uE779", + IconName = "Insert" + }, + new AnnotationButtonItem() + { + Icon = "\uE711", + IconName = "Comment" + }, + new AnnotationButtonItem() + { + Icon = "\uE777", + IconName = "Key" + }, + new AnnotationButtonItem() + { + Icon = "\uE778", + IconName = "Help" + }, + new AnnotationButtonItem() + { + Icon = "\uE776", + IconName = "Paragraph" + }, + new AnnotationButtonItem() + { + Icon = "\uE77a", + IconName = "New Paragraph" + }, + }; + } + + private void SfListView_ItemTapped(object sender, Syncfusion.Maui.ListView.ItemTappedEventArgs e) + { + + if (e.DataItem is AnnotationButtonItem stickyNoteDetails && BindingContext is CustomToolbarViewModel viewModel) + { + viewModel.ToolbarCommand.Execute(stickyNoteDetails.IconName); + } + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/TextMarkupColorCode.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/TextMarkupColorCode.xaml new file mode 100644 index 00000000..12a4de12 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/TextMarkupColorCode.xaml @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/TextMarkupColorCode.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/TextMarkupColorCode.xaml.cs new file mode 100644 index 00000000..da6658bd --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/TextMarkupColorCode.xaml.cs @@ -0,0 +1,98 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Microsoft.Maui.Controls.Shapes; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class TextMarkupColorCode : ContentView + +{ + Ellipse? selectedColorButtonHighlight; + + Button? PreButton = null; + public TextMarkupColorCode() + { + InitializeComponent(); + Colorpaletteborder.Content = MyGrid; + this.Content = Colorpaletteborder; + } + + Border Colorpaletteborder = new Border() + { + BackgroundColor = Color.FromArgb("#EEE8F4"), + Stroke = Color.FromArgb("#26000000"), + StrokeThickness = 1, + VerticalOptions = LayoutOptions.Start, + HorizontalOptions = LayoutOptions.Start, + StrokeShape = new RoundRectangle + { + CornerRadius = new CornerRadius(12) + }, + Shadow = new Shadow + { + Offset = new Point(-1, 0), + Brush = Color.FromRgba("#000000"), + Radius = 8, + Opacity = 0.5f + }, + WidthRequest = 280, + }; + private void ColorHeighlightButton_Clicked(object sender, EventArgs e) + { + if (PreButton != null) + { + PreButton.HeightRequest = 30; + PreButton.WidthRequest = 30; + PreButton.CornerRadius = 15; + } + PreButton = sender as Button; + if (selectedColorButtonHighlight == null) + { + selectedColorButtonHighlight = new Ellipse(); + selectedColorButtonHighlight.WidthRequest = 30; + selectedColorButtonHighlight.HeightRequest = 30; + selectedColorButtonHighlight.VerticalOptions = LayoutOptions.Center; + selectedColorButtonHighlight.HorizontalOptions = LayoutOptions.Center; + selectedColorButtonHighlight.Stroke = Brush.Black; + selectedColorButtonHighlight.StrokeThickness = 2; + } + if (sender is Button button) + { + button.HeightRequest = 22; + button.WidthRequest = 22; + button.CornerRadius = 11; + button.HorizontalOptions = LayoutOptions.Center; + button.VerticalOptions = LayoutOptions.Center; + int column = Grid.GetColumn(button); + int row = Grid.GetRow(button); + Grid.SetColumn(selectedColorButtonHighlight, column); + Grid.SetRow(selectedColorButtonHighlight, row); + if (BindingContext is CustomToolbarViewModel bindingContext) + { + bindingContext.IsDeskTopColorToolbarVisible = true; + bindingContext.IsDeskTopFillColorToolbarVisible = false; + bindingContext.ColorCommand.Execute(button.BackgroundColor); + } + } + if (selectedColorButtonHighlight.Parent == null) + { + MyTextMarkup.Children.Add(selectedColorButtonHighlight); + } + } + + private void TextMarkUpOpacitySliderChanged(object sender, EventArgs e) + { + float opacity = (float)textMarkUpOpacitySlidr.Value; + if (BindingContext is CustomToolbarViewModel bindingContext) + { + bindingContext.IsDeskTopColorToolbarVisible = true; + bindingContext.IsDeskTopFillColorToolbarVisible = false; + bindingContext.OpacityCommand.Execute(opacity); + } + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/TextmarkupDetails.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/TextmarkupDetails.cs new file mode 100644 index 00000000..aa231d88 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/TextmarkupDetails.cs @@ -0,0 +1,21 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer +{ + public class AnnotationButtonItem + { + public string? Icon { get; set; } + public string? IconName { get; set; } + } +} diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/TextmarkupView.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/TextmarkupView.xaml new file mode 100644 index 00000000..d7c25a69 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/TextmarkupView.xaml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/TextmarkupView.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/TextmarkupView.xaml.cs new file mode 100644 index 00000000..d48619ca --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/TextmarkupView.xaml.cs @@ -0,0 +1,53 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using System.Collections.ObjectModel; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class TextmarkupView : ContentView +{ + public TextmarkupView() + { + InitializeComponent(); + listView.ItemsSource = new List() + { + new AnnotationButtonItem() + { + Icon = "\uE760", + IconName = "Highlight" + }, + new AnnotationButtonItem() + { + Icon = "\uE762", + IconName = "Underline" + }, + new AnnotationButtonItem() + { + Icon = "\uE763", + IconName = "StrikeOut" + }, + new AnnotationButtonItem() + { + Icon = "\uE765", + IconName = "Squiggly" + }, + }; + } + + private void SfListView_ItemTapped(object sender, Syncfusion.Maui.ListView.ItemTappedEventArgs e) + { + if (e.DataItem is AnnotationButtonItem textMarkupDetails && BindingContext is CustomToolbarViewModel viewModel) + { + viewModel.ToolbarCommand.Execute(textMarkupDetails.IconName); + } + } + internal void DisappearHighlight() + { + listView.SelectedItem = null; + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ToolbarDesktop.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ToolbarDesktop.xaml index 0aa47829..644d1b09 100644 --- a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ToolbarDesktop.xaml +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ToolbarDesktop.xaml @@ -27,20 +27,41 @@ - - - - - - - + + + + + + + + + + + + + + @@ -89,8 +110,140 @@ Text="" Margin="4,0,0,0" Style="{StaticResource buttonIconStyle}" Command="{Binding ZoomInCommand}"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + + + + + + + + + - + + + x:Name="searchButton" + Text="" + FontSize="20" + FontFamily="Maui Material Assets" + Style="{StaticResource buttonIconStyle}" + Clicked="Search_Clicked"/> + x:Name="moreButton" + Text="" + FontSize="20" + Command="{Binding ToolbarCommand}" + CommandParameter="More" + FontFamily="Maui Material Assets" + Style="{StaticResource buttonIconStyle}" + /> + \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ToolbarMobile.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ToolbarMobile.xaml.cs index 21abf8ed..c38ebb6a 100644 --- a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ToolbarMobile.xaml.cs +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ToolbarMobile.xaml.cs @@ -7,7 +7,7 @@ #endregion namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; -public partial class ToolbarMobile : ToolbarView +public partial class ToolbarMobile : ToolbarView { public ToolbarMobile() { @@ -17,9 +17,8 @@ public partial class ToolbarMobile : ToolbarView void AssignControls() { - PageNumberEntry = pageNumberEntry; SearchButton = searchButton; - OutlineButton = outlineButton; - PageCountLabel = pageCountLabel; + UndoButton = mobileUndoButton; + RedoButton = mobileRedoButton; } } \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ToolbarView.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ToolbarView.cs index b9603d17..9cc12507 100644 --- a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ToolbarView.cs +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Controls/Toolbar/ToolbarView.cs @@ -21,6 +21,10 @@ public class ToolbarView : Microsoft.Maui.Controls.ContentView public Button? OutlineButton { get; set; } public Button? GoToPreviousPageButton { get; set; } public Button? GoToNextPageButton { get; set; } + public Button? UndoButton { get; set; } + public Button? SaveButton { get; set; } + public Button? RedoButton { get; set; } + public Button? StampButton { get; set; } public CustomToolbar? ParentView { get; set; } @@ -49,6 +53,10 @@ public class ToolbarView : Microsoft.Maui.Controls.ContentView GoToPreviousPageButton.Command = PdfViewer.GoToPreviousPageCommand; if (GoToNextPageButton != null) GoToNextPageButton.Command = PdfViewer.GoToNextPageCommand; + if (UndoButton != null) + UndoButton.Command = PdfViewer.UndoCommand; + if (RedoButton != null) + RedoButton.Command = PdfViewer.RedoCommand; } } @@ -90,16 +98,55 @@ public class ToolbarView : Microsoft.Maui.Controls.ContentView { if (!viewModel.ShowOutlineView) ParentView?.CloseAllDialogs(); + viewModel.IsShapeListVisible = false; + viewModel.IsStampListVisible = false; + viewModel.IsStickyNoteListVisible = false; + viewModel.IsTextMarkupListVisible = false; + viewModel.IsInkColorPalleteVisible = false; + viewModel.IsShapeColorPalleteVisible = false; + viewModel.IsStickyNoteColorPalleteVisible = false; + viewModel.IsStampOpacitySliderbarVisible = false; + viewModel.IsTextMarkUpColorPalleteVisible = false; viewModel.ShowOutlineView = !viewModel.ShowOutlineView; + viewModel.DeselectSelectedAnnotation(); + if (pdfViewer != null) + { + pdfViewer.AnnotationMode = Syncfusion.Maui.PdfViewer.AnnotationMode.None; + viewModel.ClearButtonHighlights(); + } } } public void Search_Clicked(object sender, EventArgs e) { +#if ANDROID || IOS + if (ParentView != null && ParentView.BindingContext is CustomToolbarViewModel viewModel) + { + viewModel.ToolbarCommand.Execute("Back"); + viewModel.BottomToolbarContent = new AnnotationToolbar(viewModel); + } +#else ParentView?.CloseAllDialogs(); + if (BindingContext is CustomToolbarViewModel viewModel) + { + viewModel.IsShapeListVisible = false; + viewModel.IsStampListVisible = false; + viewModel.IsStickyNoteListVisible = false; + viewModel.IsTextMarkupListVisible = false; + viewModel.IsInkColorPalleteVisible = false; + viewModel.IsShapeColorPalleteVisible = false; + viewModel.IsStickyNoteColorPalleteVisible = false; + viewModel.IsStampOpacitySliderbarVisible = false; + viewModel.IsTextMarkUpColorPalleteVisible = false; + viewModel.IsEraserThicknessToolbarVisible = false; + viewModel.DeselectSelectedAnnotation(); + if (pdfViewer != null) + pdfViewer.AnnotationMode = Syncfusion.Maui.PdfViewer.AnnotationMode.None; + } +#endif MainThread.BeginInvokeOnMainThread(() => ParentView?.SearchView?.Open()); } - + /// /// Handles when the page number entry is focused. /// @@ -138,4 +185,4 @@ public class ToolbarView : Microsoft.Maui.Controls.ContentView } } } -} \ No newline at end of file +} diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Converters/AnnotationModeConverter.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Converters/AnnotationModeConverter.cs new file mode 100644 index 00000000..09e14ba6 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/Converters/AnnotationModeConverter.cs @@ -0,0 +1,62 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Syncfusion.Maui.PdfViewer; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SampleBrowser.Maui.PdfViewer +{ + public class AnnotationModeToIconConverter : IValueConverter + { + string annotationType = string.Empty; + public AnnotationModeToIconConverter(string annotationType) + { + this.annotationType = annotationType; + } + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + AnnotationMode annotationMode = (AnnotationMode)value; + if (annotationType == "TextMarkup") + { + if (annotationMode == AnnotationMode.Highlight) + return "\uE760"; + else if (annotationMode == AnnotationMode.Underline) + return "\uE762"; + else if (annotationMode == AnnotationMode.StrikeOut) + return "\uE763"; + else if (annotationMode == AnnotationMode.Squiggly) + return "\uE765"; + else + return "\uE72e"; + } + else if (annotationType == "Shape") + { + if (annotationMode == AnnotationMode.Square) + return "\uE731"; + else if (annotationMode == AnnotationMode.Circle) + return "\uE73f"; + else if (annotationMode == AnnotationMode.Line) + return "\uE73d"; + else if (annotationMode == AnnotationMode.Arrow) + return "\uE73c"; + else + return "\uE73b"; + } + return string.Empty; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/View/CustomToolbar.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/View/CustomToolbar.xaml index 752844b8..dc2eeddf 100644 --- a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/View/CustomToolbar.xaml +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/View/CustomToolbar.xaml @@ -4,11 +4,11 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:localCore="clr-namespace:SampleBrowser.Maui.Base;assembly=SampleBrowser.Maui.Base" xmlns:local="clr-namespace:SampleBrowser.Maui.PdfViewer.SfPdfViewer" - xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer" + xmlns:core="clr-namespace:Syncfusion.Maui.Core.Converters;assembly=Syncfusion.Maui.Core" + xmlns:syncfusion="clr-namespace:Syncfusion.Maui.PdfViewer;assembly=Syncfusion.Maui.PdfViewer" + xmlns:sliders="clr-namespace:Syncfusion.Maui.Sliders;assembly=Syncfusion.Maui.Sliders" x:Class="SampleBrowser.Maui.PdfViewer.SfPdfViewer.CustomToolbar"> - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + - - - - - - - - - - - - - + StrokeThickness="1"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/View/CustomToolbar.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/View/CustomToolbar.xaml.cs index bbefe2e4..92b5f586 100644 --- a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/View/CustomToolbar.xaml.cs +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/View/CustomToolbar.xaml.cs @@ -5,9 +5,17 @@ // licensing@syncfusion.com. Any infringement will be prosecuted under // applicable laws. #endregion +using Microsoft.Maui; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.Shapes; using Microsoft.Maui.Platform; using SampleBrowser.Maui.Base; +using Syncfusion.Maui.Core.Internals; using Syncfusion.Maui.PdfViewer; +using Syncfusion.Pdf.Parsing; +using Syncfusion.Pdf; +using System.IO; +using System.Reflection; namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; [XamlCompilation(XamlCompilationOptions.Compile)] @@ -21,29 +29,126 @@ public partial class CustomToolbar : SampleView #if ANDROID || IOS private ViewCell? lastCell; #endif - + public Stream CustomStampImageStream { get; set; } = new MemoryStream(); + public double CustomStampWidth { get; set; } + public double CustomStampHeight { get; set; } + public bool CustomStamp { get; set; } public SearchView SearchView { get; set; } + public StampView? StampView { get; set; } + CustomToolbarViewModel viewModel; public CustomToolbar() { InitializeComponent(); + viewModel = new CustomToolbarViewModel(PdfViewer); + viewModel.PropertyChanged += ViewModel_PropertyChanged; + BindingContext = viewModel; + AddDocumentItems(); #if ANDROID || IOS SearchView = MobileSearchView; toolbar = MobileToolbar; + StampView = MobileStampView; #else + fileListView.IsVisible = false; SearchView = DesktopSearchView; + StampView = DesktopStampView; toolbar = DesktopToolbar; #endif + PdfViewer.UndoCommand!.CanExecuteChanged += UndoCommand_CanExecuteChanged; UpdateToolbarProperties(); + DesktopToolbar.SetBindings(); SearchView.SearchHelper = PdfViewer; SearchView.NoMatchesFound += NoMatchesFound; - + StampView!.StampHelper = PdfViewer; + StampView.StampSelected += StampView_StampSelected; + viewModel.StickyNoteSelected += ViewModel_StickyNoteSelected; #if WINDOWS //Note: Due to known MAUI issue (#13714) in Entry control when the property "IsVisible=false" by default, the mentioned property is set after the control is loaded. if (SearchView.SearchInputEntry != null) SearchView.SearchInputEntry.Loaded += SearchInputEntryLoaded; #endif } + public void AddDocumentItems() + { + documentOne.Children.Add(CreateView("PDF Succinctly")); + documentTwo.Children.Add(CreateView("Rotated PDF")); + documentThree.Children.Add(CreateView("Password protected PDF")); + documentFour.Children.Add(CreateView("Corrupted PDF")); + documentFive.Children.Add(CreateView("Single page PDF")); + documentSix.Children.Add(CreateView("Annotations PDF")); +#if !MACCATALYST + customDocument.Children.Add(CreateView("Browse files on this device")); +#endif + } + private Grid CreateView(string iconName) + { + GestureGrid childRow = new GestureGrid(); + childRow.WidthRequest = 220; + childRow.HeightRequest = 40; + childRow.PointerPressed += ListView_ItemTapped; + + Label iconNameLabel = new Label() + { + Padding = new Thickness(15, 0, 0, 0), + Margin = new Thickness(5, 0, 0, 0), + TextColor = new Color(0, 0, 0, 0.6f), + FontSize = 15, + HorizontalOptions = LayoutOptions.Start, + VerticalOptions = LayoutOptions.Center, + Text = iconName, + }; + childRow.Children.Add(iconNameLabel); + return childRow; + } + + private void ViewModel_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e) + { + if (e.PropertyName == nameof(viewModel.ColorPaletteMargin)) + { + View? view = null; + if (viewModel.IsInkColorPalleteVisible) + view = inkColorPalette; + else if (viewModel.IsStampOpacitySliderbarVisible) + view = stampOpacityBar; + else if (viewModel.IsTextMarkUpColorPalleteVisible) + view = textMarkupColorPalette; + else if (viewModel.IsShapeColorPalleteVisible) + view = shapeColorPalette; + if (view != null) + { + SizeRequest sizeRequest = view.Measure(double.PositiveInfinity, double.PositiveInfinity); + if (viewModel.ColorPaletteMargin.Left + sizeRequest.Request.Width > Width) + viewModel.ColorPaletteMargin = new Thickness(Width - sizeRequest.Request.Width - 20, viewModel.ColorPaletteMargin.Top, viewModel.ColorPaletteMargin.Right, viewModel.ColorPaletteMargin.Bottom); + } + } + } + + private void ViewModel_StickyNoteSelected(object? sender, EventArgs e) + { + PdfViewer.AnnotationMode = AnnotationMode.None; + if (BindingContext is CustomToolbarViewModel viewModel && viewModel.IsStickyNoteMode) + { + ShowToast("Tap on the page to insert the sticky note"); + } + } + + private void StampView_StampSelected(object? sender, EventArgs e) + { + PdfViewer.AnnotationMode = AnnotationMode.None; + ShowToast("Tap on the page to insert the selected stamp"); + } + + async void ShowToast(string text) + { + toast.Opacity = 1; + toastText.Text = text; + await toast.FadeTo(0, 2000, Easing.SinIn); + } + + private void UndoCommand_CanExecuteChanged(object? sender, EventArgs e) + { + viewModel.IsSaveLayoutVisible = true; + } void UpdateToolbarProperties() { @@ -70,19 +175,26 @@ public partial class CustomToolbar : SampleView /// private void MessageBox_CloseClicked(object? sender, CloseClickedEventArgs? e) { - if (this.BindingContext is CustomToolbarViewModel bindingContext && e?.Title == "Incorrect Password") - bindingContext.UpdateFileName("Password protected PDF"); + if (this.BindingContext is CustomToolbarViewModel bindingContext) + { + if (e?.Title == "Incorrect Password") + bindingContext.UpdateFileName("Password protected PDF"); + else if (e?.Title == "Error") + { + bindingContext.IsFileListViewVisible = true; + bindingContext.ShowMessageBoxDialog = false; + } + } } internal void CloseAllDialogs() { - if (BindingContext is CustomToolbarViewModel bindingContext) - bindingContext?.CloseAllDialogsCommand?.Execute(true); + viewModel.CloseAllDialogs(); } - /// - /// Handles when leaving the current page - /// + ///// + ///// Handles when leaving the current page + ///// public override void OnDisappearing() { base.OnDisappearing(); @@ -93,32 +205,144 @@ public partial class CustomToolbar : SampleView /// /// Handles when a Pdf is tapped. /// - private void TapGestureRecognizer_Tapped(object sender, EventArgs e) + private void PdfViewer_Tapped(object sender, GestureEventArgs e) { #if ANDROID if (Platform.CurrentActivity?.CurrentFocus != null) Platform.CurrentActivity.HideKeyboard(Platform.CurrentActivity.CurrentFocus); #endif - if (this.BindingContext is CustomToolbarViewModel bindingContext && bindingContext.IsFilePickerVisible) + if (StampView != null && e != null) { + PointF point = new PointF(e.PagePosition.X, e.PagePosition.Y); + if (StampView.StampMode) + { + if (BindingContext is CustomToolbarViewModel viewModel) + { + if (viewModel.DocumentData.FileName == "rotated_document.pdf") + { + PdfLoadedDocument? document = new PdfLoadedDocument(viewModel.DocumentData.DocumentStream); + PdfLoadedPage? page = document.Pages[e.PageNumber - 1] as PdfLoadedPage; + if (page != null) + point = AdjustForRotation(page.Size.Width, page.Size.Height, page.Rotation, point.X, point.Y); + document.Dispose(); + document = null; + } + } + if (!CustomStamp) + { + StampType type = StampView.stampType; + StampAnnotation builtStamp = new StampAnnotation(type, e.PageNumber, point); + PdfViewer.AddAnnotation(builtStamp); + } + else if (CustomStamp && CustomStampImageStream != null) + { + StampAnnotation customStamp = new StampAnnotation(CustomStampImageStream, e.PageNumber, new RectF(point.X, point.Y, (float)CustomStampWidth, (float)CustomStampHeight)); + PdfViewer.AddAnnotation(customStamp); + CustomStamp = false; + } + StampView.StampMode = false; + } + } + // Adding sticky note annotation on the tapped position of the page + if (e != null) + { + if (this.BindingContext is CustomToolbarViewModel bindingContextForSticky) + { + if (bindingContextForSticky.IsStickyNoteMode) + { + PointF point = new PointF(e.PagePosition.X, e.PagePosition.Y); + if (BindingContext is CustomToolbarViewModel viewModel) + { + if(viewModel.DocumentData.FileName == "rotated_document.pdf") + { + PdfLoadedDocument? document = new PdfLoadedDocument(viewModel.DocumentData.DocumentStream); + PdfLoadedPage? page = document.Pages[e.PageNumber - 1] as PdfLoadedPage; + if (page != null) + point = AdjustForRotation(page.Size.Width, page.Size.Height, page.Rotation, point.X, point.Y); + document.Dispose(); + document = null; + } + } + StickyNoteAnnotation builtStickyNote = new StickyNoteAnnotation(bindingContextForSticky.StickyIcon,string.Empty,e.PageNumber, point); + PdfViewer.AddAnnotation(builtStickyNote); + bindingContextForSticky.IsStickyNoteMode = false; + } + } + } + if (this.BindingContext is CustomToolbarViewModel bindingContext) + { + bindingContext.HideOverlayToolbars(); bindingContext.IsFilePickerVisible = false; + bindingContext.ShowMoreOptions = false; + bindingContext.IsStampViewVisible = false; + bindingContext.StampHighlightColor = Colors.Transparent; + bindingContext.StickyNoteHighlightColor = Colors.Transparent; +#if WINDOWS || MACCATALYST + bindingContext.IsShapeListVisible = false; + bindingContext.IsStickyNoteListVisible = false; + bindingContext.IsTextMarkupListVisible = false; + bindingContext.IsStampListVisible = false; + bindingContext.IsInkColorPalleteVisible = false; + bindingContext.IsShapeColorPalleteVisible = false; + bindingContext.IsTextMarkUpColorPalleteVisible = false; + bindingContext.IsStampOpacitySliderbarVisible = false; + bindingContext.IsStickyNoteColorPalleteVisible = false; + bindingContext.IsFileOperationListVisible = false; +#endif + } + } + + internal static Point AdjustForRotation(double pageWidth, double pageHeight, PdfPageRotateAngle pageRotationAngle, double x, double y) + { + if (pageRotationAngle == PdfPageRotateAngle.RotateAngle90) + { + double rotatedX = pageHeight - y; + double rotatedY = x; + return new Point(rotatedX, rotatedY); + } + else if (pageRotationAngle == PdfPageRotateAngle.RotateAngle180) + { + double rotatedX = pageWidth - x; + double rotatedY = pageHeight - y; + return new Point(rotatedX, rotatedY); + } + else if (pageRotationAngle == PdfPageRotateAngle.RotateAngle270) + { + double rotatedX = y; + double rotatedY = pageWidth - x; + return new Point(rotatedX, rotatedY); + } + else + { + return new Point(x, y); } } /// /// Handles when a file picker content is tapped. /// - private void ListView_ItemTapped(object sender, ItemTappedEventArgs e) + private void ListView_ItemTapped(object? sender, EventArgs e) { + GestureGrid? grid = sender as GestureGrid; + string currentTappedDocument = ""; + if (grid!.Children[0] is Label iconName) + { + currentTappedDocument= iconName.Text; + } if (this.BindingContext is CustomToolbarViewModel bindingContext) { if (bindingContext.IsFilePickerVisible) { - if (!passwordDialog.IsVisible || previousDocument != e.Item.ToString()) - bindingContext.UpdateFileName(e.Item.ToString()); + if (!passwordDialog.IsVisible || previousDocument != currentTappedDocument) + bindingContext.UpdateFileName(currentTappedDocument); bindingContext.IsFilePickerVisible = false; - previousDocument = e.Item.ToString(); + bindingContext.HideOverlayToolbars(); +#if ANDROID || IOS + bindingContext.BottomToolbarContent= new AnnotationToolbar(viewModel); +#endif + previousDocument = currentTappedDocument; } + bindingContext.IsFileOperationListVisible= false; } } @@ -169,6 +393,13 @@ public partial class CustomToolbar : SampleView { //Release the current waiting thread to execute. manualResetEvent.Set(); + if (this.BindingContext is CustomToolbarViewModel bindingContext) + { + if(sender is PasswordDialogBox passwordDialog && passwordDialog.Password == null) + { + bindingContext.IsFileListViewVisible = true; + } + } } /// @@ -179,13 +410,18 @@ public partial class CustomToolbar : SampleView MainThread.BeginInvokeOnMainThread(() => { toolbar!.SearchButton!.IsEnabled = false; - toolbar!.OutlineButton!.IsEnabled = false; SearchView?.Close(); CloseAllDialogs(); }); e.Handled = true; if (e.Message == "Invalid cross reference table.") + { + if (BindingContext is CustomToolbarViewModel viewModel) + { + viewModel.ShowMessageBoxDialog = true; + } MainThread.BeginInvokeOnMainThread(() => messageBox.Show("Error", "Failed to load the PDF document.")); + } else if (e.Message == "Can't open an encrypted document. The password is invalid." && !passwordDialog.IsVisible) MainThread.BeginInvokeOnMainThread(() => messageBox.Show("Incorrect Password", "The password you entered is incorrect. Please try again.", "OK")); } @@ -215,11 +451,17 @@ public partial class CustomToolbar : SampleView if (this.BindingContext is CustomToolbarViewModel bindingContext) { bindingContext.IsDocumentLoaded = true; + bindingContext.IsEditLayoutVisible = false; + bindingContext.IsTextMarkupListVisible = false; + bindingContext.IsShapeListVisible = false; + bindingContext.IsStickyNoteListVisible = false; + bindingContext.IsStampListVisible = false; + } MainThread.BeginInvokeOnMainThread(() => { toolbar!.SearchButton!.IsEnabled = true; - toolbar!.OutlineButton!.IsEnabled = true; + }); } @@ -228,13 +470,25 @@ public partial class CustomToolbar : SampleView /// private void PdfViewer_DocumentUnloaded(object sender, EventArgs e) { - if (this.BindingContext is CustomToolbarViewModel bindingContext) - { - bindingContext.IsDocumentLoaded = false; - } + viewModel.IsDocumentLoaded = false; + viewModel.IsSaveLayoutVisible = false; toolbar!.SearchButton!.IsEnabled = false; - toolbar!.OutlineButton!.IsEnabled = false; SearchView?.Close(); + + viewModel.HideOverlayToolbars(); + viewModel.ShowMoreOptions = false; + viewModel.IsStampViewVisible = false; +#if WINDOWS || MACCATALYST + viewModel.IsShapeListVisible = false; + viewModel.IsTextMarkupListVisible = false; + viewModel.IsStampListVisible = false; + viewModel.IsInkColorPalleteVisible = false; + viewModel.IsShapeColorPalleteVisible = false; + viewModel.IsTextMarkUpColorPalleteVisible = false; + viewModel.IsStampOpacitySliderbarVisible = false; +#else + viewModel.BottomToolbarContent = new AnnotationToolbar(viewModel); +#endif } private void PdfViewer_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) @@ -248,4 +502,143 @@ public partial class CustomToolbar : SampleView toolbar!.IsVisible = !PdfViewer.IsOutlineViewVisible; } } + + + private void PdfViewer_AnnotationSelected(object sender, AnnotationEventArgs e) + { + viewModel.SelectedAnnotation = e.Annotation; + SearchView!.Close(); + } + + private void PdfViewer_AnnotationDeselected(object sender, AnnotationEventArgs e) + { + viewModel.SelectedAnnotation = null; + } + + private void saveButton_Clicked(object? sender, EventArgs e) + { + viewModel?.SaveDocument(); + } + + private void thicknessSlider_ValueChanged(object sender, EventArgs e) + { + float thickness = (float)ThicknessSlider.Value; + viewModel.ThicknessCommand.Execute(thickness); + } + + private void stampOpacitySlider_ValueChanged(object sender, EventArgs e) + { + viewModel.OpacityCommand.Execute((float)StampOpacitySlider.Value); + } + + private void importButton_Clicked(object sender, EventArgs e) + { + viewModel?.ImportAnnotations(); + } + + private void exportButton_Clicked(object sender, EventArgs e) + { + viewModel?.ExportAnnotations(); + } + + private void FileListView_FileSelected(object sender, FileSelectedEventArgs e) + { + viewModel.DocumentData.FileName = e.FileName; + } + + private void OnCreateStampClicked(object sender, StampDialogEventArgs e) + { + if (e.IsVisible == true) + stampDialog.IsVisible = false; + else + stampDialog.IsVisible = true; + viewModel.IsStampListVisible = false; + } + + private async void OnCustomStampCreated(object sender, CustomStampEventArgs e) + { + Label customStampLabel = e.CustomStampLabel ?? new Label(); // Initialize only if it's null + Stream imageStream = await e.StampView!.GetStreamAsync(Syncfusion.Maui.Core.ImageFileFormat.Png); + StampImage image = new StampImage(); + Stream memoryStream = new MemoryStream(); + await imageStream.CopyToAsync(memoryStream); + memoryStream.Position = imageStream.Position = 0; + image.ImageStream = memoryStream; + image.Source = ImageSource.FromStream(() => imageStream); + image.HeightRequest = 40; +#if WINDOWS || MACCATALYST + image.HorizontalOptions = LayoutOptions.Start; +#endif + image.Margin = new Thickness(5); + StampView?.CustomStampListLayout?.Children.Add(CreateView(image, customStampLabel)); + if (sender is View view) + view.IsVisible = false; + ShowToast("The stamp is created and added to custom stamps menu"); + } + + + private View CreateView(StampImage Image,Label customStampLabel) + { + GestureGrid customStamp = new GestureGrid(); + if (Image.Bounds.Width < 200) + customStamp.WidthRequest = 195; + else + customStamp.WidthRequest = Image.Bounds.Width; +#if MACCATALYST + Image.WidthRequest = GetImageWidth(customStampLabel); +#endif + customStamp.PointerPressed += OnCustomStampTapped; + customStamp.Children.Add(Image); + return customStamp; + } + + private double GetImageWidth(Label customStampLabel) + { + double defaultWidth = 40; + double totalWidth = defaultWidth; // Start with the default width + for (int i = 0; i < customStampLabel.Text.Length; i++) + { + double textWidthContribution = 6.2; + totalWidth += textWidthContribution; + } + return totalWidth; + } + + private async void OnCustomStampTapped(object? sender, EventArgs? e) + { + ShowToast("Tap on the page to insert the custom stamp"); + GestureGrid? grid = sender as GestureGrid; + if (grid!.Children[0] is StampImage image) + { + CustomStampImageStream = new MemoryStream(); + if (image != null && image.ImageStream != null) + { + await image.ImageStream.CopyToAsync(CustomStampImageStream); + image.ImageStream.Position = CustomStampImageStream.Position = 0; + CustomStampWidth = image.Bounds.Width; + CustomStampHeight = image.Bounds.Height; + } + CustomStamp = true; + StampView!.StampMode = true; + viewModel.IsStampListVisible = false; + viewModel.IsStampViewVisible = false; + } + } + + private void OnCreateStampMobileClicked(object sender, StampDialogMobileEventArgs e) + { + if (e.IsVisible == true) + stampDialogMobile.IsVisible = false; + else + stampDialogMobile.IsVisible = true; + viewModel.IsStampViewVisible = false; + } + internal void ShapeHighlightDisapper() + { + shapeListView.DisappearHighlight(); + } + internal void TextMarkUpHighlightDisappear() + { + textmarkupView.DisappearHighlight(); + } } \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/View/FileListView.xaml b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/View/FileListView.xaml new file mode 100644 index 00000000..79854049 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/View/FileListView.xaml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/View/FileListView.xaml.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/View/FileListView.xaml.cs new file mode 100644 index 00000000..2e41dac9 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/View/FileListView.xaml.cs @@ -0,0 +1,67 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Microsoft.Maui.Controls.Shapes; +using System.Reflection; + +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public partial class FileListView : ContentView +{ + List Items = new List(); + public event EventHandler? FileSelected; + public FileListView() + { + InitializeComponent(); + + Items.Add(new AnnotationButtonItem() { IconName = "PDF_succinctly.pdf", Icon = "\uE780" }); + Items.Add(new AnnotationButtonItem() { IconName = "Rotated_document.pdf", Icon = "\uE780" }); + Items.Add(new AnnotationButtonItem() { IconName = "Password_protected_document.pdf", Icon = "\uE780" }); + Items.Add(new AnnotationButtonItem() { IconName = "Corrupted_document.pdf", Icon = "\uE780" }); + Items.Add(new AnnotationButtonItem() { IconName = "Single_page_document.pdf", Icon = "\uE780" }); + Items.Add(new AnnotationButtonItem() { IconName = "Annotations_document.pdf", Icon = "\uE780" }); + Items.Add(new AnnotationButtonItem() { IconName = "Browse files on this device", Icon = "\uE712" }); + listView.ItemsSource = Items; + } + + private async void listView_ItemTapped(object sender, Syncfusion.Maui.ListView.ItemTappedEventArgs e) + { + await Task.Delay(50); + AnnotationButtonItem? tappedItem = e.DataItem as AnnotationButtonItem; + if (tappedItem != null) + { + string fileName = string.Empty; + int tappedIndex = Items.IndexOf(tappedItem); + if (tappedIndex == 0) + fileName = "PDF_Succinctly1.pdf"; + else if (tappedIndex == 1) + fileName = "rotated_document.pdf"; + else if (tappedIndex == 2) + fileName = "password_protected_document.pdf"; + else if (tappedIndex == 3) + fileName = "corrupted_document.pdf"; + else if (tappedIndex == 4) + fileName = "Invoice.pdf"; + else if (tappedIndex == 5) + fileName = "Annotations.pdf"; + + if (BindingContext is CustomToolbarViewModel bindingContext) + { + if (tappedIndex == 6) + { + bindingContext.UpdateFileName(tappedItem.IconName); + } + else + { + FileSelected?.Invoke(this, new FileSelectedEventArgs(fileName)); + bindingContext.IsFileListViewVisible = false; + } + } + } + listView.SelectedItem = null; + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/View/FileSelectedEventArgs.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/View/FileSelectedEventArgs.cs new file mode 100644 index 00000000..c48a6e03 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/View/FileSelectedEventArgs.cs @@ -0,0 +1,18 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer; + +public class FileSelectedEventArgs : EventArgs +{ + public string? FileName { get; set; } + + public FileSelectedEventArgs(string? fileName) + { + FileName = fileName; + } +} \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/ViewModel/CustomToolbarViewModel.cs b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/ViewModel/CustomToolbarViewModel.cs index 8dc1e45b..ef037de7 100644 --- a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/ViewModel/CustomToolbarViewModel.cs +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/ViewModel/CustomToolbarViewModel.cs @@ -5,19 +5,33 @@ // licensing@syncfusion.com. Any infringement will be prosecuted under // applicable laws. #endregion +using SampleBrowser.Maui.Base; +using Syncfusion.Maui.PdfViewer; using System.ComponentModel; +using System.Reflection; using System.Windows.Input; +#if WINDOWS +using Windows.Storage; +#endif namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer { public class CustomToolbarViewModel : INotifyPropertyChanged { private PdfData _documentData; + private Thickness _textMarkupListMargin; + private Thickness _shapeListMargin; + private Thickness _stampListMargin; + private Thickness _stickyNoteListMargin; + private Thickness _fileOperationListMargin; + private Thickness _colorPaletteMargin; private bool _isFilePickerVisible; private ICommand? _openCloseFilePickerCommand; private ICommand? _zoomInCommand; private ICommand? _zoomOutCommand; - private ICommand? _closeAllDialogsCommand; + private ICommand? _outlineCommand; + private ICommand? _backToFileListCommand; + private ICommand? _editCommand; private object? _selectedFile; private double _currentZoom = 1; private double? _minZoom = null; @@ -26,9 +40,62 @@ namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer private bool _showMessageBoxDialog = false; private bool _showHyperlinkDialog = false; private bool _showOutlineView = false; + private bool _showMoreView = false; + private bool _isTextMarkupListVisible = false; + private bool _isShapeListVisible = false; + private bool _isStickyNoteListVisible = false; + private bool _isFileOperationListVisible = false; + private bool _isStampListVisible = false; + private bool _isDeleteButtonVisible = false; + private bool _isEditLayoutVisible = false; + private bool _isSaveLayoutVisible = false; + private bool _isStickyNoteMode = false; + private StickyNoteIcon _stickyNoteIcon = StickyNoteIcon.Note; + private bool _isFileListViewVisible = false; + private Color _selectedColor = new(); bool m_isDocumentLoaded; + bool isStickyNoteToolbarVisible; + ContentView bottomToolbarContent; + ICommand? toolbarCommand; + ICommand? colorCommand; + ICommand? opacityCommand; + ICommand? thicknessCommand; + bool isColorToolbarVisible; + bool isAnnotationsToolsVisible = true; + bool isShapeColorPalleteVisible = false; + bool isInkColorPalleteVisible = false; + bool isTextMarkUpColorPalleteVisible = false; + bool isStickyNoteColorPalleteVisible=false; + bool isStickyIconChangeButtonVisible = false; + bool isEraserThicknessToolbarVisible = false; + bool isDeskTopColorToolbarVisible; + bool isDeskTopFillColorToolbarVisible; + bool isStampOpacitySliderbarVisible; + bool isFillColorToolbarVisible; + bool isStampOpacityToolbarVisible; + bool isThicknessToolbarVisible; + bool isOpacityToolbarVisible; + bool isStampViewVisible; + bool isAnnotationModeLineOrArrow; + bool isLockVisible = false; + bool isUnlockVisible = false; + Syncfusion.Maui.PdfViewer.SfPdfViewer pdfViewer; + Annotation? selectedAnnotation; + Color? textMarkupHighlightColor = Colors.Transparent; + Color? shapeHighlightColor = Colors.Transparent; + Color? inkHighlightColor = Colors.Transparent; + Color? inkEraserHighlightColor = Colors.Transparent; + Color? stickyNoteHighlightColor = Colors.Transparent; + Color? stampHighlightColor = Colors.Transparent; + float selectedOpacity; + float selectedThickness, minimumThickness = 1, maximumThickness = 20, minimumEraserThickness = 10, maximumEraserThickness = 100; + string textMarkupButtonIcon = string.Empty; + string shapeButtonIcon = string.Empty; + string selectedAnnotationIcon = string.Empty; + public event PropertyChangedEventHandler? PropertyChanged; + public event EventHandler? StickyNoteSelected; /// /// Returns the Pdf data. @@ -64,6 +131,7 @@ namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer "Password protected PDF", "Corrupted PDF", "Single page PDF", + "Annotations PDF", #if !MACCATALYST "Browse files on this device" #endif @@ -79,8 +147,175 @@ namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer get => _isFilePickerVisible; set { - _isFilePickerVisible = value; - OnPropertyChanged("IsFilePickerVisible"); + if (_isFilePickerVisible != value) + { + _isFilePickerVisible = value; + OnPropertyChanged(nameof(IsFilePickerVisible)); + } + } + } + public Color SelectedColor + { + get => _selectedColor; + set + { + if (_selectedColor != value) + { + _selectedColor = value; + OnPropertyChanged(nameof(SelectedColor)); + } + } + } + public bool IsFileListViewVisible + { + get => _isFileListViewVisible; + set + { + if (_isFileListViewVisible != value) + { + _isFileListViewVisible = value; + OnPropertyChanged(nameof(IsFileListViewVisible)); + } + } + } + + public bool IsTextMarkupListVisible + { + get => _isTextMarkupListVisible; + set + { + if (_isTextMarkupListVisible != value) + { + _isTextMarkupListVisible = value; + OnPropertyChanged(nameof(IsTextMarkupListVisible)); + } + } + } + + public bool IsShapeListVisible + { + get => _isShapeListVisible; + set + { + if (_isShapeListVisible != value) + { + _isShapeListVisible = value; + OnPropertyChanged(nameof(IsShapeListVisible)); + } + } + } + + public bool IsFileOperationListVisible + { + get => _isFileOperationListVisible; + set + { + if (_isFileOperationListVisible != value) + { + _isFileOperationListVisible = value; + OnPropertyChanged(nameof(IsFileOperationListVisible)); + } + } + } + + public bool IsAnnotationModeLineOrArrow + { + get => isAnnotationModeLineOrArrow; + set + { + if (isAnnotationModeLineOrArrow != value) + { + isAnnotationModeLineOrArrow = value; + OnPropertyChanged(nameof(IsAnnotationModeLineOrArrow)); + } + } + } + public bool IsStampListVisible + { + get => _isStampListVisible; + set + { + if (_isStampListVisible != value) + { + _isStampListVisible = value; + OnPropertyChanged(nameof(IsStampListVisible)); + } + } + } + + public bool IsStickyNoteListVisible + { + get => _isStickyNoteListVisible; + set + { + if (_isStickyNoteListVisible != value) + { + _isStickyNoteListVisible = value; + OnPropertyChanged(nameof(IsStickyNoteListVisible)); + } + } + } + + public bool IsStickyNoteMode + { + get => _isStickyNoteMode; + set + { + if (_isStickyNoteMode != value) + { + _isStickyNoteMode = value; + } + } + } + + public StickyNoteIcon StickyIcon + { + get => _stickyNoteIcon; + set + { + if (_stickyNoteIcon != value) + { + _stickyNoteIcon = value; + } + } + } + + public bool IsDeleteButtonVisible + { + get => _isDeleteButtonVisible; + set + { + if (_isDeleteButtonVisible != value) + { + _isDeleteButtonVisible = value; + OnPropertyChanged(nameof(IsDeleteButtonVisible)); + } + } + } + + public bool IsEditLayoutVisible + { + get => _isEditLayoutVisible; + set + { + if (_isEditLayoutVisible != value) + { + _isEditLayoutVisible = value; + OnPropertyChanged(nameof(IsEditLayoutVisible)); + } + } + } + + public bool IsSaveLayoutVisible + { + get => _isSaveLayoutVisible; + set + { + if (_isSaveLayoutVisible != value) + { + _isSaveLayoutVisible = value; + OnPropertyChanged(nameof(IsSaveLayoutVisible)); + } } } @@ -92,8 +327,11 @@ namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer get => _showPasswordDialog; set { - _showPasswordDialog = value; - OnPropertyChanged("ShowPasswordDialog"); + if (_showPasswordDialog != value) + { + _showPasswordDialog = value; + OnPropertyChanged(nameof(ShowPasswordDialog)); + } } } @@ -105,8 +343,11 @@ namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer get => _showMessageBoxDialog; set { - _showMessageBoxDialog = value; - OnPropertyChanged("ShowMessageBoxDialog"); + if (_showMessageBoxDialog != value) + { + _showMessageBoxDialog = value; + OnPropertyChanged(nameof(ShowMessageBoxDialog)); + } } } @@ -118,8 +359,11 @@ namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer get => _showHyperlinkDialog; set { - _showHyperlinkDialog = value; - OnPropertyChanged("ShowHyperlinkDialog"); + if (_showHyperlinkDialog != value) + { + _showHyperlinkDialog = value; + OnPropertyChanged(nameof(ShowHyperlinkDialog)); + } } } @@ -128,8 +372,122 @@ namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer get => _showOutlineView; set { - _showOutlineView = value; - OnPropertyChanged("ShowOutlineView"); + if (_showOutlineView != value) + { + _showOutlineView = value; + OnPropertyChanged(nameof(ShowOutlineView)); + } + } + } + public bool ShowMoreOptions + { + get => _showMoreView; + set + { + if (_showMoreView != value) + { + _showMoreView = value; + OnPropertyChanged(nameof(ShowMoreOptions)); + } + } + } + + public Thickness ColorPaletteMargin + { + get => _colorPaletteMargin; + set + { + if (_colorPaletteMargin != value) + { + _colorPaletteMargin = value; + OnPropertyChanged(nameof(ColorPaletteMargin)); + } + } + } + + public Thickness ShapeListMargin + { + get => _shapeListMargin; + set + { + _shapeListMargin = value; + OnPropertyChanged(nameof(ShapeListMargin)); + } + } + public Thickness TextMarkupListMargin + { + get => _textMarkupListMargin; + set + { + _textMarkupListMargin = value; + OnPropertyChanged(nameof(TextMarkupListMargin)); + } + } + public Thickness StampListMargin + { + get => _stampListMargin; + set + { + _stampListMargin = value; + OnPropertyChanged(nameof(StampListMargin)); + } + } + public Thickness FileOperationListMargin + { + get => _fileOperationListMargin; + set + { + _fileOperationListMargin = value; + OnPropertyChanged(nameof(FileOperationListMargin)); + } + } + + public Thickness StickyNoteListMargin + { + get => _stickyNoteListMargin; + set + { + _stickyNoteListMargin = value; + OnPropertyChanged(nameof(StickyNoteListMargin)); + } + } + + public string TextMarkupButtonIcon + { + get => textMarkupButtonIcon; + set + { + if (textMarkupButtonIcon != value) + { + textMarkupButtonIcon = value; + OnPropertyChanged(nameof(TextMarkupButtonIcon)); + } + } + } + + public string ShapeButtonIcon + { + get => shapeButtonIcon; + set + { + if (shapeButtonIcon != value) + { + shapeButtonIcon = value; + OnPropertyChanged(nameof(ShapeButtonIcon)); + } + } + } + + public string SelectedAnnotationIcon + { + get => selectedAnnotationIcon; + set + { + if (selectedAnnotationIcon != value) + { + selectedAnnotationIcon = value; + OnPropertyChanged(nameof(SelectedAnnotationIcon)); + } } } @@ -147,6 +505,7 @@ namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer } } + /// /// Gets or sets the minimum zoom. /// @@ -170,6 +529,7 @@ namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer { m_isDocumentLoaded = value; RefreshZoomCommandCanExecutes(); + RefreshToolbarCommandCanExecute(); OnPropertyChanged(nameof(IsDocumentLoaded)); } } @@ -187,6 +547,28 @@ namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer } } + public bool IsLockButtonVisible + { + get => isLockVisible; + set + { + isLockVisible = value; + OnPropertyChanged(nameof(IsLockButtonVisible)); + } + } + + public bool IsUnlockButtonVisible + { + get => isUnlockVisible; + set + { + isUnlockVisible = value; + OnPropertyChanged(nameof(IsUnlockButtonVisible)); + } + } + + public bool LockButtonsVisible { get; set; } = false; + /// /// Gets the command to open or close the file picker. /// @@ -228,41 +610,56 @@ namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer } } - public ICommand CloseAllDialogsCommand + public ICommand OutlineCommand { get { - if (_closeAllDialogsCommand == null) - _closeAllDialogsCommand = new Command(CloseAllDialogs); - return _closeAllDialogsCommand; + if (_outlineCommand == null) + _outlineCommand = new Command(() => { + ShowMoreOptions = false; + ShowOutlineView = !ShowOutlineView; + }); + return _outlineCommand; + } + } + + public ICommand BackToFileListCommand + { + get + { + if (_backToFileListCommand == null) + _backToFileListCommand = new Command(() => + { + IsFileListViewVisible = true; + pdfViewer.UnloadDocument(); + }); + return _backToFileListCommand; } } /// /// Constructor of the view model class /// - public CustomToolbarViewModel() + public CustomToolbarViewModel(Syncfusion.Maui.PdfViewer.SfPdfViewer pdfViewer) { _documentData = new PdfData(); +#if ANDROID || IOS + _isFileListViewVisible = true; +#else _documentData.FileName = "PDF_Succinctly1.pdf"; +#endif + this.pdfViewer = pdfViewer; + bottomToolbarContent = new AnnotationToolbar(this); } - void CloseAllDialogs() + internal void CloseAllDialogs() { - if (ShowPasswordDialog) - ShowPasswordDialog = false; - - if (ShowMessageBoxDialog) - ShowMessageBoxDialog = false; - - if (ShowHyperlinkDialog) - ShowHyperlinkDialog = false; - - if (ShowOutlineView) - ShowOutlineView = false; - - if (IsFilePickerVisible) - IsFilePickerVisible = false; + ShowPasswordDialog = false; + ShowHyperlinkDialog = false; + ShowOutlineView = false; + IsFilePickerVisible = false; + ShowMoreOptions = false; + IsStampViewVisible = false; } /// @@ -276,9 +673,26 @@ namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer zoomOutCommand.ChangeCanExecute(); } + void RefreshToolbarCommandCanExecute() + { + if (ToolbarCommand is Command toolbarCommand) + toolbarCommand.ChangeCanExecute(); + } + public void OnPropertyChanged(string name) { - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); +#if ANDROID + // There is a known exception in Android platform when the PropertyChanged event is invoked. + // As there is no fix for this issue yet, caught the exception. + // Issue link: https://github.com/dotnet/maui/issues/10867 + try + { +#endif + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); +#if ANDROID + } + catch (Java.Lang.NullPointerException) { } +#endif } /// @@ -286,12 +700,22 @@ namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer /// void OpenCloseFilePicker(object commandParameter) { + bool isFilePickerOpen = IsFilePickerVisible; CloseAllDialogs(); - - if (IsFilePickerVisible == true) - IsFilePickerVisible = false; - else - IsFilePickerVisible = true; + IsShapeListVisible = false; + IsStickyNoteListVisible = false; + IsTextMarkupListVisible = false; + IsStampListVisible = false; + IsFilePickerVisible = !isFilePickerOpen; + } + internal void OpenCloseFile() + { + bool isFilePickerOpen = IsFilePickerVisible; + CloseAllDialogs(); + IsShapeListVisible = false; + IsTextMarkupListVisible = false; + IsStampListVisible = false; + IsFilePickerVisible = !isFilePickerOpen; } /// @@ -316,6 +740,9 @@ namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer case "Single page PDF": _documentData.FileName = "Invoice.pdf"; break; + case "Annotations PDF": + _documentData.FileName = "Annotations.pdf"; + break; case "Browse files on this device": // Create file picker with file type as PDF. FilePickerFileType pdfFileType = new FilePickerFileType(new Dictionary>{ @@ -330,7 +757,7 @@ namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer PickerTitle = "Please select a PDF file", FileTypes = pdfFileType, }; - await PickAndShow(options); + await PickFile(options); break; } } @@ -338,7 +765,7 @@ namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer /// /// Picks the file from local storage and store as stream. /// - public async Task PickAndShow(PickOptions options) + public async Task PickFile(PickOptions options) { try { @@ -346,8 +773,18 @@ namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer var result = await FilePicker.Default.PickAsync(options); if (result != null) { + IsFileListViewVisible = false; // Store the resultant PDF as stream. - _documentData.DocumentStream = await result.OpenReadAsync(); + if (result.FileName != null) + { + if (result.FileName.EndsWith(".pdf", StringComparison.OrdinalIgnoreCase)) + _documentData.DocumentStream = await result.OpenReadAsync(); + else if (result.FileName.EndsWith(".xfdf", StringComparison.OrdinalIgnoreCase)) + { + Stream importStream = await result.OpenReadAsync(); + pdfViewer.ImportAnnotations(importStream, Syncfusion.Pdf.Parsing.AnnotationDataFormat.XFdf); + } + } } return result; } @@ -363,5 +800,1498 @@ namespace SampleBrowser.Maui.PdfViewer.SfPdfViewer } return null; } + + public ICommand ToolbarCommand + { + get + { + if (toolbarCommand == null) + toolbarCommand = new Command((parameter) => { OnToolbarCommand(parameter); }, canExecute: (o) => { return IsDocumentLoaded; }); + return toolbarCommand; + } + } + + public ICommand EditCommand + { + get + { + if (_editCommand == null) + _editCommand = new Command((parameter) => { OnEditCommand(parameter); }, canExecute: (o) => + { + if (SelectedAnnotation == null) + return true; + else + return !SelectedAnnotation.IsLocked; + }); + return _editCommand; + } + } + public ICommand ThicknessCommand + { + get + { + return thicknessCommand ?? (thicknessCommand = new Command(OnThicknessCommand)); + } + } + public ICommand OpacityCommand + { + get + { + return opacityCommand ?? (opacityCommand = new Command(OnOpacityCommand)); + } + } + public ICommand ColorCommand + { + get + { + return colorCommand ?? (colorCommand = new Command(OnColorCommand)); + } + } + + internal Annotation? SelectedAnnotation + { + get + { + return selectedAnnotation!; + } + set + { + if (selectedAnnotation != value) + { + selectedAnnotation = value; + if (selectedAnnotation == null) + { +#if ANDROID || IOS + BottomToolbarContent = new AnnotationToolbar(this); + IsStickyNoteToolbarVisible = false; +#endif + IsDeleteButtonVisible = false; + IsEditLayoutVisible = false; + IsStickyIconChangeButtonVisible = false; + IsStickyNoteListVisible = false; + IsStampOpacityToolbarVisible = false; + IsAnnotationsToolsVisible = true; + IsLockButtonVisible = IsUnlockButtonVisible = false; + HideOverlayToolbars(); + } + else + { + CloseAllDialogs(); + SetSliderValues(); + SetSelectedAnnotationIcon(); +#if ANDROID || IOS + if (selectedAnnotation is ShapeAnnotation) + BottomToolbarContent = new ShapesPropertyToolbar(this) { IsDeleteButtonVisible = true }; + else if (selectedAnnotation is InkAnnotation) + BottomToolbarContent = new InkToolbar(this) { IsDeleteButtonVisible = true }; + else if (selectedAnnotation is HighlightAnnotation || selectedAnnotation is UnderlineAnnotation || selectedAnnotation is StrikeOutAnnotation || selectedAnnotation is SquigglyAnnotation) + BottomToolbarContent = new TextMarkUpPropertyToolbar(this) { IsDeleteButtonVisible = true }; + else if(selectedAnnotation is StampAnnotation) + BottomToolbarContent = new StampPropertyToolbar(this) { IsDeleteButtonVisible = true }; + else if (selectedAnnotation is StickyNoteAnnotation) + BottomToolbarContent = new StickyNotePropertyToolbar(this) { IsDeleteButtonVisible = true}; +#endif + + if (selectedAnnotation is StickyNoteAnnotation stickyNoteAnnotation) + { + IsStickyIconChangeButtonVisible = true; + StickyIcon = stickyNoteAnnotation.Icon; + SetSelectedAnnotationIcon(); + } + if (selectedAnnotation.IsLocked) + { + IsEditLayoutVisible = false; + IsDeleteButtonVisible = false; + IsLockButtonVisible = false; + IsUnlockButtonVisible = true; + } + else + { + IsEditLayoutVisible = true; + IsDeleteButtonVisible = true; + IsLockButtonVisible = true; + IsUnlockButtonVisible = false; + } + IsAnnotationsToolsVisible = false; + } + } + } + } + + public bool IsEraserThicknessToolbarVisible + { + get + { + return isEraserThicknessToolbarVisible; + } + set + { + if (isEraserThicknessToolbarVisible != value) + { + isEraserThicknessToolbarVisible = value; + OnPropertyChanged(nameof(IsEraserThicknessToolbarVisible)); + } + } + } + public bool IsStickyNoteToolbarVisible + { + get + { + return isStickyNoteToolbarVisible; + } + set + { + if (isStickyNoteToolbarVisible != value) + { + isStickyNoteToolbarVisible = value; + OnPropertyChanged(nameof(IsStickyNoteToolbarVisible)); + } + } + } + + public bool IsAnnotationsToolsVisible + { + get + { + return isAnnotationsToolsVisible; + } + set + { + if (isAnnotationsToolsVisible != value) + { + isAnnotationsToolsVisible = value; + OnPropertyChanged(nameof(IsAnnotationsToolsVisible)); + } + } + } + + public bool IsStampOpacitySliderbarVisible + { + get + { + return isStampOpacitySliderbarVisible; + } + set + { + if (isStampOpacitySliderbarVisible != value) + { + isStampOpacitySliderbarVisible = value; + OnPropertyChanged(nameof(IsStampOpacitySliderbarVisible)); + } + } + } + public bool IsFillColorToolbarVisible + { + get + { + return isFillColorToolbarVisible; + } + set + { + if (isFillColorToolbarVisible != value) + { + isFillColorToolbarVisible = value; + OnPropertyChanged(nameof(IsFillColorToolbarVisible)); + } + } + } + public bool IsDeskTopColorToolbarVisible + { + get + { + return isDeskTopColorToolbarVisible; + } + set + { + if (isDeskTopColorToolbarVisible != value) + { + isDeskTopColorToolbarVisible = value; + OnPropertyChanged(nameof(IsDeskTopColorToolbarVisible)); + } + } + } + public bool IsShapeColorPalleteVisible + { + get + { + return isShapeColorPalleteVisible; + } + set + { + if (isShapeColorPalleteVisible != value) + { + isShapeColorPalleteVisible = value; + OnPropertyChanged(nameof(IsShapeColorPalleteVisible)); + } + } + } + public bool IsTextMarkUpColorPalleteVisible + { + get + { + return isTextMarkUpColorPalleteVisible; + } + set + { + if (isTextMarkUpColorPalleteVisible != value) + { + isTextMarkUpColorPalleteVisible = value; + OnPropertyChanged(nameof(IsTextMarkUpColorPalleteVisible)); + } + } + } + public bool IsInkColorPalleteVisible + { + get + { + return isInkColorPalleteVisible; + } + set + { + if (isInkColorPalleteVisible != value) + { + isInkColorPalleteVisible = value; + OnPropertyChanged(nameof(IsInkColorPalleteVisible)); + } + } + } + public bool IsStickyNoteColorPalleteVisible + { + get + { + return isStickyNoteColorPalleteVisible; + } + set + { + if (isStickyNoteColorPalleteVisible != value) + { + isStickyNoteColorPalleteVisible = value; + OnPropertyChanged(nameof(IsStickyNoteColorPalleteVisible)); + } + } + } + public bool IsStickyIconChangeButtonVisible + { + get + { + return isStickyIconChangeButtonVisible; + } + set + { + if (isStickyIconChangeButtonVisible != value) + { + isStickyIconChangeButtonVisible = value; + OnPropertyChanged(nameof(IsStickyIconChangeButtonVisible)); + } + } + } + public bool IsDeskTopFillColorToolbarVisible + { + get + { + return isDeskTopFillColorToolbarVisible; + } + set + { + if (isDeskTopFillColorToolbarVisible != value) + { + isDeskTopFillColorToolbarVisible = value; + OnPropertyChanged(nameof(IsDeskTopFillColorToolbarVisible)); + } + } + } + public bool IsColorToolbarVisible + { + get + { + return isColorToolbarVisible; + } + set + { + if (isColorToolbarVisible != value) + { + isColorToolbarVisible = value; + OnPropertyChanged(nameof(IsColorToolbarVisible)); + } + } + } + public bool IsStampOpacityToolbarVisible + { + get + { + return isStampOpacityToolbarVisible; + } + set + { + if (isStampOpacityToolbarVisible != value) + { + isStampOpacityToolbarVisible = value; + OnPropertyChanged(nameof(IsStampOpacityToolbarVisible)); + } + } + } + public bool IsThicknessToolbarVisible + { + get + { + return isThicknessToolbarVisible; + } + set + { + if (isThicknessToolbarVisible != value) + { + isThicknessToolbarVisible = value; + OnPropertyChanged(nameof(IsThicknessToolbarVisible)); + } + } + } + + public bool IsOpacityToolbarVisible + { + get + { + return isOpacityToolbarVisible; + } + set + { + if (isOpacityToolbarVisible != value) + { + isOpacityToolbarVisible = value; + OnPropertyChanged(nameof(IsOpacityToolbarVisible)); + } + } + } + + public bool IsStampViewVisible + { + get + { + return isStampViewVisible; + } + set + { + if (isStampViewVisible != value) + { + isStampViewVisible = value; + OnPropertyChanged(nameof(IsStampViewVisible)); + } + } + } + + + public Color? TextMarkupHighlightColor + { + get + { + return textMarkupHighlightColor; + } + set + { + if (textMarkupHighlightColor != value) + { + textMarkupHighlightColor = value; + OnPropertyChanged(nameof(TextMarkupHighlightColor)); + } + } + } + + public Color? ShapeHighlightColor + { + get + { + return shapeHighlightColor; + } + set + { + if (shapeHighlightColor != value) + { + shapeHighlightColor = value; + OnPropertyChanged(nameof(ShapeHighlightColor)); + } + } + } + + public Color? InkHighlightColor + { + get + { + return inkHighlightColor; + } + set + { + if (inkHighlightColor != value) + { + inkHighlightColor = value; + OnPropertyChanged(nameof(InkHighlightColor)); + } + } + } + + public Color? InkEraserHighlightColor + { + get + { + return inkEraserHighlightColor; + } + set + { + if (inkEraserHighlightColor != value) + { + inkEraserHighlightColor = value; + OnPropertyChanged(nameof(InkEraserHighlightColor)); + } + } + } + + public Color? StampHighlightColor + { + get + { + return stampHighlightColor; + } + set + { + if (stampHighlightColor != value) + { + stampHighlightColor = value; + OnPropertyChanged(nameof(StampHighlightColor)); + } + } + } + + public Color? StickyNoteHighlightColor + { + get + { + return stickyNoteHighlightColor; + } + set + { + if (stickyNoteHighlightColor != value) + { + stickyNoteHighlightColor = value; + OnPropertyChanged(nameof(StickyNoteHighlightColor)); + } + } + } + + public float SelectedOpacity + { + get + { + return selectedOpacity; + } + set + { + if (selectedOpacity != value) + { + selectedOpacity = value; + OnPropertyChanged(nameof(SelectedOpacity)); + } + } + } + + public float SelectedThickness + { + get + { + return selectedThickness; + } + set + { + if (selectedThickness != value) + { + selectedThickness = value; + OnPropertyChanged(nameof(SelectedThickness)); + } + } + } + + public float MinimumThickness + { + get + { + return minimumThickness; + } + set + { + if (minimumThickness != value) + { + minimumThickness = value; + OnPropertyChanged(nameof(MinimumThickness)); + } + } + } + + public float MinimumEraserThickness + { + get + { + return minimumEraserThickness; + } + set + { + if (minimumEraserThickness != value) + { + minimumEraserThickness = value; + OnPropertyChanged(nameof(MinimumEraserThickness)); + } + } + } + public float MaximumThickness + { + get + { + return maximumThickness; + } + set + { + if (maximumThickness != value) + { + maximumThickness = value; + OnPropertyChanged(nameof(MaximumThickness)); + } + } + } + + public float MaximumEraserThickness + { + get + { + return maximumEraserThickness; + } + set + { + if (maximumEraserThickness != value) + { + maximumEraserThickness = value; + OnPropertyChanged(nameof(MaximumEraserThickness)); + } + } + } + public ContentView BottomToolbarContent + { + get + { + return bottomToolbarContent; + } + set + { + bottomToolbarContent = value; + CloseAllDialogs(); + OnPropertyChanged(nameof(BottomToolbarContent)); + } + } + + void SetSliderValues() + { + if (selectedAnnotation != null) + { + SelectedOpacity = selectedAnnotation.Opacity; + if (selectedAnnotation is ShapeAnnotation shape) + { + SelectedThickness = shape.BorderWidth; + } + else if (selectedAnnotation is InkAnnotation ink) + { + SelectedColor = ink.Color; + SelectedThickness = ink.BorderWidth; + } + else if (selectedAnnotation is UnderlineAnnotation underline) + { + SelectedColor = underline.Color; + } + else if (selectedAnnotation is StrikeOutAnnotation strikeOut) + { + SelectedColor = strikeOut.Color; + } + else if (selectedAnnotation is HighlightAnnotation highlight) + { + SelectedColor = highlight.Color; + } + else if (selectedAnnotation is SquigglyAnnotation squiggly) + { + SelectedColor = squiggly.Color; + } + else if (selectedAnnotation is StickyNoteAnnotation stickyNote) + { + SelectedColor = stickyNote.Color; + } + } + else + { + switch (pdfViewer.AnnotationMode) + { + case AnnotationMode.Square: + SelectedThickness = pdfViewer.AnnotationSettings.Square.BorderWidth; + SelectedOpacity = pdfViewer.AnnotationSettings.Square.Opacity; + break; + + case AnnotationMode.Circle: + SelectedThickness = pdfViewer.AnnotationSettings.Circle.BorderWidth; + SelectedOpacity = pdfViewer.AnnotationSettings.Circle.Opacity; + break; + + case AnnotationMode.Line: + SelectedThickness = pdfViewer.AnnotationSettings.Line.BorderWidth; + SelectedOpacity = pdfViewer.AnnotationSettings.Line.Opacity; + break; + + case AnnotationMode.Arrow: + SelectedThickness = pdfViewer.AnnotationSettings.Arrow.BorderWidth; + SelectedOpacity = pdfViewer.AnnotationSettings.Arrow.Opacity; + break; + + case AnnotationMode.Ink: + SelectedThickness = pdfViewer.AnnotationSettings.Ink.BorderWidth; + SelectedOpacity = pdfViewer.AnnotationSettings.Ink.Opacity; + SelectedColor = pdfViewer.AnnotationSettings.Ink.Color; + break; + + case AnnotationMode.InkEraser: + SelectedThickness = pdfViewer.AnnotationSettings.InkEraser.Thickness; + break; + + case AnnotationMode.Highlight: + SelectedOpacity = pdfViewer.AnnotationSettings.Highlight.Opacity; + SelectedColor = pdfViewer.AnnotationSettings.Highlight.Color; + break; + + case AnnotationMode.Underline: + SelectedOpacity = pdfViewer.AnnotationSettings.Underline.Opacity; + SelectedColor = pdfViewer.AnnotationSettings.Underline.Color; + break; + + case AnnotationMode.StrikeOut: + SelectedOpacity = pdfViewer.AnnotationSettings.StrikeOut.Opacity; + SelectedColor = pdfViewer.AnnotationSettings.StrikeOut.Color; + break; + + case AnnotationMode.Squiggly: + SelectedOpacity = pdfViewer.AnnotationSettings.Squiggly.Opacity; + SelectedColor = pdfViewer.AnnotationSettings.Squiggly.Color; + break; + + } + } + } + + internal void DeselectSelectedAnnotation() + { + if (SelectedAnnotation != null) + pdfViewer?.DeselectAnnotation(SelectedAnnotation); + } + + internal void HideOverlayToolbars() + { + IsColorToolbarVisible = false; + IsOpacityToolbarVisible = false; + IsThicknessToolbarVisible = false; + IsFillColorToolbarVisible = false; + IsStampOpacityToolbarVisible = false; + } + + void OnEditCommand(object parameter) + { + if (parameter.Equals("Thickness")) + { + if (pdfViewer.AnnotationMode == AnnotationMode.InkEraser) + { + MinimumThickness = 10; + MaximumThickness = 100; + } + else + { + MinimumThickness = 1; + MaximumThickness = 20; + } + IsThicknessToolbarVisible = !IsThicknessToolbarVisible; + IsColorToolbarVisible = false; + IsFillColorToolbarVisible = false; + } + else if (parameter.Equals("StampOpacity")) + { + IsThicknessToolbarVisible = false; + IsStampOpacityToolbarVisible = !IsStampOpacityToolbarVisible; + } + else if (parameter.Equals("Opacity")) + { + IsOpacityToolbarVisible = !IsOpacityToolbarVisible; + } + else if (parameter.Equals("Color")) + { + IsFillColorToolbarVisible = false; + IsStickyNoteToolbarVisible = false; + IsColorToolbarVisible = !IsColorToolbarVisible; + IsThicknessToolbarVisible = false; + } + else if (parameter.Equals("Fill")) + { + IsColorToolbarVisible = false; + + IsFillColorToolbarVisible = !IsFillColorToolbarVisible; + IsThicknessToolbarVisible = false; + } + else if (parameter.Equals("Delete")) + { + if (SelectedAnnotation != null) + pdfViewer.RemoveAnnotation(SelectedAnnotation); + } + else if (parameter.Equals("StickyIconChange")) + { +#if ANDROID || IOS + IsStickyNoteToolbarVisible = !IsStickyNoteToolbarVisible; + IsColorToolbarVisible = false; + IsOpacityToolbarVisible = false; +#else + IsStickyNoteListVisible = !IsStickyNoteListVisible; +#endif + IsTextMarkupListVisible = false; + IsStampListVisible = false; + IsShapeListVisible = false; + CloseAllDialogs(); + } + } + + void OnToolbarCommand(object parameter) + { + if (parameter is string) + { + if (parameter.Equals("TextMarkup")) + { +#if ANDROID || IOS + BottomToolbarContent = new TextMarkupToolbar(this); +#endif + if (pdfViewer.AnnotationMode == AnnotationMode.None) + IsTextMarkupListVisible = !IsTextMarkupListVisible; + pdfViewer.AnnotationMode = AnnotationMode.None; + ClearButtonHighlights(); + IsFileOperationListVisible = false; + IsShapeListVisible = false; + IsStickyNoteListVisible = false; + IsStampListVisible = false; + CloseAllDialogs(); + } + else if (parameter.Equals("Ink")) + { + IsFileOperationListVisible = false; + IsTextMarkupListVisible = false; + IsShapeListVisible = false; + IsStampListVisible = false; + IsStickyNoteMode = false; + pdfViewer.AnnotationMode = pdfViewer.AnnotationMode == AnnotationMode.Ink ? AnnotationMode.None : AnnotationMode.Ink; +#if ANDROID || IOS + BottomToolbarContent = new InkToolbar(this); +#endif + ClearButtonHighlights(); + InkHighlightColor = pdfViewer.AnnotationMode == AnnotationMode.None ? Colors.Transparent : Color.FromRgba(0, 0, 0, 20); + CloseAllDialogs(); + SetSliderValues(); + } + else if (parameter.Equals("InkEraser")) + { + IsFileOperationListVisible = false; + IsTextMarkupListVisible = false; + IsStickyNoteListVisible = false; + IsStickyNoteMode = false; + IsShapeListVisible = false; + IsStampListVisible = false; + pdfViewer.AnnotationMode = pdfViewer.AnnotationMode == AnnotationMode.InkEraser ? AnnotationMode.None : AnnotationMode.InkEraser; + ClearButtonHighlights(); + InkEraserHighlightColor = pdfViewer.AnnotationMode == AnnotationMode.None ? Colors.Transparent : Color.FromRgba(0, 0, 0, 20); +#if ANDROID || IOS + if (pdfViewer.AnnotationMode == AnnotationMode.None) + { + BottomToolbarContent = new AnnotationToolbar(this); + MinimumThickness = 1; + MaximumThickness = 20; + } + else + { + BottomToolbarContent = new EraserToolbar(this); + MinimumThickness = 10; + MaximumThickness = 100; + } +#endif + CloseAllDialogs(); + SetSliderValues(); + } + else if (parameter.Equals("Shapes")) + { +#if ANDROID || IOS + BottomToolbarContent = new ShapesToolbar(this); +#endif + if (pdfViewer.AnnotationMode == AnnotationMode.None) + IsShapeListVisible = !IsShapeListVisible; + pdfViewer.AnnotationMode = AnnotationMode.None; + ClearButtonHighlights(); + IsStickyNoteListVisible = false; + IsFileOperationListVisible = false; + IsTextMarkupListVisible = false; + IsStampListVisible = false; + CloseAllDialogs(); + } + else if (parameter.Equals("FileOperation")) + { + IsFileOperationListVisible = !IsFileOperationListVisible; + IsShapeListVisible = false; + IsStickyNoteMode = false; + IsTextMarkupListVisible = false; + IsStampListVisible = false; + pdfViewer.AnnotationMode = AnnotationMode.None; + ShapeHighlightColor = Colors.Transparent; + CloseAllDialogs(); + } + else if (parameter.Equals("Back")) + { +#if ANDROID || IOS + CloseAllDialogs(); + HideOverlayToolbars(); + IsStickyNoteToolbarVisible = false; + pdfViewer.AnnotationMode = AnnotationMode.None; + if (selectedAnnotation != null) + pdfViewer.DeselectAnnotation(selectedAnnotation); + else + { + if (bottomToolbarContent is ShapesToolbar || bottomToolbarContent is InkToolbar || bottomToolbarContent is TextMarkupToolbar || bottomToolbarContent is EraserToolbar || bottomToolbarContent is StickyNotePropertyToolbar) + BottomToolbarContent = new AnnotationToolbar(this); + else if (bottomToolbarContent is ShapesPropertyToolbar) + BottomToolbarContent = new ShapesToolbar(this); + else if (bottomToolbarContent is TextMarkUpPropertyToolbar) + BottomToolbarContent = new TextMarkupToolbar(this); + } +#endif + } + else if (parameter.Equals("Thickness")) + { + if(pdfViewer.AnnotationMode == AnnotationMode.InkEraser) + { + MinimumThickness = 10; + MaximumThickness = 100; + } + else + { + MinimumThickness = 1; + MaximumThickness = 20; + } + IsThicknessToolbarVisible = !IsThicknessToolbarVisible; + IsColorToolbarVisible = false; + IsFillColorToolbarVisible = false; + } + else if (parameter.Equals("StampOpacity")) + { + IsThicknessToolbarVisible = false; + IsStampOpacityToolbarVisible = !IsStampOpacityToolbarVisible; + } + else if (parameter.Equals("Opacity")) + { + IsOpacityToolbarVisible = !IsOpacityToolbarVisible; + } + else if (parameter.Equals("Color")) + { + IsFillColorToolbarVisible = false; + IsStickyNoteToolbarVisible = false; + IsColorToolbarVisible = !IsColorToolbarVisible; + IsThicknessToolbarVisible = false; + } + else if (parameter.Equals("Fill")) + { + IsColorToolbarVisible = false; + + IsFillColorToolbarVisible = !IsFillColorToolbarVisible; + IsThicknessToolbarVisible = false; + } + else if (parameter.Equals("LockUnlockButton")) + { + if (selectedAnnotation != null) + { + selectedAnnotation.IsLocked = !selectedAnnotation.IsLocked; + if (selectedAnnotation.IsLocked) + { + IsLockButtonVisible = false; + IsUnlockButtonVisible = true; + IsEditLayoutVisible = false; + IsDeleteButtonVisible = false; + } + else + { + IsLockButtonVisible = true; + IsUnlockButtonVisible = false; + IsEditLayoutVisible = true; + IsDeleteButtonVisible = true; + } + } + if (EditCommand is Command editCommand) + editCommand.ChangeCanExecute(); + } + + else if (parameter.Equals("Square") || parameter.Equals("Circle") || parameter.Equals("Line") || parameter.Equals("Arrow")) + { + if (parameter is string annotationMode) + pdfViewer.AnnotationMode = (Syncfusion.Maui.PdfViewer.AnnotationMode)Enum.Parse(typeof(Syncfusion.Maui.PdfViewer.AnnotationMode), annotationMode, true); + IsShapeListVisible = false; + IsStickyNoteListVisible = false; + IsStickyNoteMode = false; +#if ANDROID || IOS + BottomToolbarContent = new ShapesPropertyToolbar(this); +#endif + ClearButtonHighlights(); + ShapeHighlightColor = pdfViewer.AnnotationMode == AnnotationMode.None ? Colors.Transparent : Color.FromRgba(0, 0, 0, 20); + SetSliderValues(); + } + else if (parameter.Equals("Squiggly") || parameter.Equals("StrikeOut") || parameter.Equals("Underline") || parameter.Equals("Highlight")) + { + if (parameter is string annotationMode) + pdfViewer.AnnotationMode = (Syncfusion.Maui.PdfViewer.AnnotationMode)Enum.Parse(typeof(Syncfusion.Maui.PdfViewer.AnnotationMode), annotationMode, true); + IsTextMarkupListVisible = false; +#if ANDROID || IOS + BottomToolbarContent = new TextMarkUpPropertyToolbar(this); +#endif + ClearButtonHighlights(); + TextMarkupHighlightColor = pdfViewer.AnnotationMode == AnnotationMode.None ? Colors.Transparent : Color.FromRgba(0, 0, 0, 20); + SetSliderValues(); + } + else if (parameter.Equals("Delete")) + { + if (SelectedAnnotation != null) + pdfViewer.RemoveAnnotation(SelectedAnnotation); + } + else if (parameter.Equals("More")) + { + bool showMoreOptions = ShowMoreOptions; + pdfViewer.AnnotationMode = AnnotationMode.None; + BottomToolbarContent = new AnnotationToolbar(this); + CloseAllDialogs(); + ShowMoreOptions = !showMoreOptions; + } + else if (parameter.Equals("Stamp")) + { + pdfViewer.AnnotationMode = AnnotationMode.None; + ClearButtonHighlights(); +#if ANDROID || IOS + bool isStampViewVisible = IsStampViewVisible; + CloseAllDialogs(); + IsStampViewVisible = !isStampViewVisible; +#elif MACCATALYST || WINDOWS + bool isStampListVisible = IsStampListVisible; + CloseAllDialogs(); + IsShapeListVisible = false; + IsStickyNoteListVisible = false; + IsStickyNoteMode = false; + IsTextMarkupListVisible = false; + IsStampListVisible = !isStampListVisible; +#endif + StampHighlightColor = IsStampListVisible ? Color.FromRgba(0, 0, 0, 20) : Colors.Transparent; + } + else if (parameter.Equals("StickyNote")) + { + pdfViewer.AnnotationMode = AnnotationMode.None; + var stickyHighlightColor = stickyNoteHighlightColor; + ClearButtonHighlights(); + StickyNoteHighlightColor = stickyHighlightColor == Colors.Transparent ? Color.FromRgba(0, 0, 0, 20) : Colors.Transparent; +#if ANDROID || IOS + BottomToolbarContent = new StickyNotePropertyToolbar(this); +#endif + IsStickyNoteMode = !IsStickyNoteMode; + StickyNoteSelected?.Invoke(this, EventArgs.Empty); + StickyIcon = StickyNoteIcon.Note; + SelectedColor = Colors.Yellow; // Reset the selector color to default sticky note color + IsTextMarkupListVisible = false; + IsStampListVisible = false; + IsShapeListVisible = false; + CloseAllDialogs(); + } + else if (parameter.Equals("StickyIconChange")) + { +#if ANDROID || IOS + IsStickyNoteToolbarVisible = !IsStickyNoteToolbarVisible; + IsColorToolbarVisible = false; + IsOpacityToolbarVisible = false; +#else + IsStickyNoteListVisible = !IsStickyNoteListVisible; +#endif + IsTextMarkupListVisible = false; + IsStampListVisible = false; + IsShapeListVisible = false; + CloseAllDialogs(); + } + else if (parameter.Equals("Note") || parameter.Equals("Comment") || parameter.Equals("Key") || parameter.Equals("Insert") || parameter.Equals("Help") + || parameter.Equals("Paragraph") || parameter.Equals("New Paragraph")) + { + if (parameter is string annotationMode) + { + if (annotationMode.Equals("New Paragraph")) + annotationMode = "NewParagraph"; + StickyIcon = (Syncfusion.Maui.PdfViewer.StickyNoteIcon)Enum.Parse(typeof(Syncfusion.Maui.PdfViewer.StickyNoteIcon), annotationMode, true); + } + if(SelectedAnnotation is StickyNoteAnnotation stickyNoteAnnotation) + { + stickyNoteAnnotation.Icon = StickyIcon; + } + } + else if (parameter.Equals("ColorPalette")) + { + IsDeleteButtonVisible = pdfViewer.AnnotationMode == AnnotationMode.None; + if (pdfViewer.AnnotationMode == AnnotationMode.Square || pdfViewer.AnnotationMode == AnnotationMode.Circle || pdfViewer.AnnotationMode == AnnotationMode.Line || pdfViewer.AnnotationMode == AnnotationMode.Arrow || SelectedAnnotation is SquareAnnotation || SelectedAnnotation is CircleAnnotation || SelectedAnnotation is LineAnnotation) + { + IsTextMarkUpColorPalleteVisible = false; + IsInkColorPalleteVisible = false; + IsStickyNoteColorPalleteVisible = false; + IsStickyNoteListVisible = false; + IsStampOpacitySliderbarVisible = false; + IsStickyIconChangeButtonVisible = false; + IsEraserThicknessToolbarVisible = false; + IsShapeColorPalleteVisible = !IsShapeColorPalleteVisible; + IsAnnotationModeLineOrArrow = !(pdfViewer.AnnotationMode == AnnotationMode.Line || + pdfViewer.AnnotationMode == AnnotationMode.Arrow || + SelectedAnnotation is LineAnnotation); + } + else if (pdfViewer.AnnotationMode == AnnotationMode.Squiggly || pdfViewer.AnnotationMode == AnnotationMode.Highlight || pdfViewer.AnnotationMode == AnnotationMode.StrikeOut || pdfViewer.AnnotationMode == AnnotationMode.Underline || SelectedAnnotation is UnderlineAnnotation || SelectedAnnotation is SquigglyAnnotation || SelectedAnnotation is HighlightAnnotation || SelectedAnnotation is StrikeOutAnnotation) + { + IsShapeColorPalleteVisible = false; + IsInkColorPalleteVisible = false; + IsStickyNoteColorPalleteVisible = false; + IsStickyNoteListVisible = false; + IsStampOpacitySliderbarVisible = false; + IsStickyIconChangeButtonVisible = false; + IsEraserThicknessToolbarVisible=false; + IsTextMarkUpColorPalleteVisible = !IsTextMarkUpColorPalleteVisible; + } + else if (pdfViewer.AnnotationMode == AnnotationMode.Ink || SelectedAnnotation is InkAnnotation) + { + IsTextMarkUpColorPalleteVisible = false; + IsShapeColorPalleteVisible = false; + IsStickyNoteColorPalleteVisible = false; + IsStickyNoteListVisible = false; + IsStampOpacitySliderbarVisible = false; + IsStickyIconChangeButtonVisible = false; + IsEraserThicknessToolbarVisible = false; + IsInkColorPalleteVisible = !IsInkColorPalleteVisible; + } + if (SelectedAnnotation is StampAnnotation) + { + IsTextMarkUpColorPalleteVisible = false; + IsShapeColorPalleteVisible = false; + IsStickyNoteColorPalleteVisible = false; + IsStickyNoteListVisible = false; + IsInkColorPalleteVisible = false; + IsStickyIconChangeButtonVisible = false; + IsEraserThicknessToolbarVisible = false; + IsStampOpacitySliderbarVisible = !IsStampOpacitySliderbarVisible; + } + else if (SelectedAnnotation is StickyNoteAnnotation) + { + IsStickyNoteColorPalleteVisible = !IsStickyNoteColorPalleteVisible; + IsStickyNoteListVisible = false; + IsTextMarkUpColorPalleteVisible = false; + IsShapeColorPalleteVisible = false; + IsInkColorPalleteVisible = false; + IsStampOpacitySliderbarVisible = false; + IsEraserThicknessToolbarVisible=false; + } + else if(pdfViewer.AnnotationMode == AnnotationMode.InkEraser) + { + IsTextMarkUpColorPalleteVisible = false; + IsInkColorPalleteVisible = false; + IsStickyNoteColorPalleteVisible = false; + IsStickyNoteListVisible = false; + IsStampOpacitySliderbarVisible = false; + IsStickyIconChangeButtonVisible = false; + IsShapeColorPalleteVisible = false; + IsEraserThicknessToolbarVisible = !IsEraserThicknessToolbarVisible; + } + } + else if (parameter.Equals("Eraser")) + { + pdfViewer.AnnotationMode = AnnotationMode.InkEraser; + SetSliderValues(); + } + if (!parameter.Equals("ColorPalette")) + { + IsShapeColorPalleteVisible = false; + IsInkColorPalleteVisible = false; + IsTextMarkUpColorPalleteVisible = false; + IsStampOpacitySliderbarVisible = false; + IsStickyNoteColorPalleteVisible = false; + IsEraserThicknessToolbarVisible = false; + } + } + SetSelectedAnnotationIcon(); + if (SelectedAnnotation == null) + IsEditLayoutVisible = pdfViewer.AnnotationMode != AnnotationMode.None; + } + + internal void ClearButtonHighlights() + { + InkHighlightColor = Colors.Transparent; + ShapeHighlightColor = Colors.Transparent; + TextMarkupHighlightColor = Colors.Transparent; + StickyNoteHighlightColor = Colors.Transparent; + InkEraserHighlightColor = Colors.Transparent; + StampHighlightColor = Colors.Transparent; + } + + public void SetSelectedAnnotationIcon() + { + if (pdfViewer.AnnotationMode == AnnotationMode.Highlight || SelectedAnnotation is HighlightAnnotation) + SelectedAnnotationIcon = "\uE760"; + if (pdfViewer.AnnotationMode == AnnotationMode.Underline || SelectedAnnotation is UnderlineAnnotation) + SelectedAnnotationIcon = "\uE762"; + if (pdfViewer.AnnotationMode == AnnotationMode.StrikeOut || SelectedAnnotation is StrikeOutAnnotation) + SelectedAnnotationIcon = "\uE763"; + if (pdfViewer.AnnotationMode == AnnotationMode.Squiggly || SelectedAnnotation is SquigglyAnnotation) + SelectedAnnotationIcon = "\uE765"; + if (pdfViewer.AnnotationMode == AnnotationMode.Square || SelectedAnnotation is SquareAnnotation) + SelectedAnnotationIcon = "\uE731"; + if (pdfViewer.AnnotationMode == AnnotationMode.Circle || SelectedAnnotation is CircleAnnotation) + SelectedAnnotationIcon = "\uE73f"; + if (pdfViewer.AnnotationMode == AnnotationMode.Line || (SelectedAnnotation is LineAnnotation line && line.LineEndingStyle == LineEndingStyle.None)) + SelectedAnnotationIcon = "\uE73d"; + if (pdfViewer.AnnotationMode == AnnotationMode.Arrow || (SelectedAnnotation is LineAnnotation arrow && arrow.LineEndingStyle == LineEndingStyle.Open)) + SelectedAnnotationIcon = "\uE73c"; + if (pdfViewer.AnnotationMode == AnnotationMode.Ink || SelectedAnnotation is InkAnnotation) + SelectedAnnotationIcon = "\uE766"; + if (pdfViewer.AnnotationMode == AnnotationMode.InkEraser) + SelectedAnnotationIcon = "\uE764"; + if (SelectedAnnotation is StampAnnotation) + SelectedAnnotationIcon = "\uE761"; + if (SelectedAnnotation is StickyNoteAnnotation || IsStickyNoteMode) + { + if (StickyIcon == StickyNoteIcon.Note) + SelectedAnnotationIcon = "\uE775"; + else if (StickyIcon == StickyNoteIcon.Comment) + SelectedAnnotationIcon = "\uE711"; + else if (StickyIcon == StickyNoteIcon.Key) + SelectedAnnotationIcon = "\uE777"; + else if (StickyIcon == StickyNoteIcon.Help) + SelectedAnnotationIcon = "\uE778"; + else if (StickyIcon == StickyNoteIcon.Insert) + SelectedAnnotationIcon = "\uE779"; + else if (StickyIcon == StickyNoteIcon.Paragraph) + SelectedAnnotationIcon = "\uE776"; + else if (StickyIcon == StickyNoteIcon.NewParagraph) + SelectedAnnotationIcon = "\uE77a"; + } + } + + void OnOpacityCommand(object parameter) + { + if (parameter is float opacity) + { + if (selectedAnnotation != null) + { + if (IsFillColorToolbarVisible || isDeskTopFillColorToolbarVisible) + { + if (selectedAnnotation is ShapeAnnotation shape) + { + Color existingFillColor = shape.FillColor; + Color modifiedFillColor = existingFillColor.WithAlpha(opacity); + shape.FillColor = modifiedFillColor; + } + } + else if (IsColorToolbarVisible || IsStampOpacityToolbarVisible || isDeskTopColorToolbarVisible || isStampOpacitySliderbarVisible) + { + selectedAnnotation.Opacity = opacity; + SelectedOpacity = opacity; + } + } + else + { + if (isColorToolbarVisible || isDeskTopColorToolbarVisible || isInkColorPalleteVisible) + { + switch (pdfViewer.AnnotationMode) + { + case AnnotationMode.Square: + pdfViewer.AnnotationSettings.Square.Opacity = opacity; + break; + + case AnnotationMode.Circle: + pdfViewer.AnnotationSettings.Circle.Opacity = opacity; + break; + + case AnnotationMode.Line: + pdfViewer.AnnotationSettings.Line.Opacity = opacity; + break; + + case AnnotationMode.Arrow: + pdfViewer.AnnotationSettings.Arrow.Opacity = opacity; + break; + case AnnotationMode.Squiggly: + pdfViewer.AnnotationSettings.Squiggly.Opacity = opacity; + break; + + case AnnotationMode.StrikeOut: + pdfViewer.AnnotationSettings.StrikeOut.Opacity = opacity; + break; + + case AnnotationMode.Highlight: + pdfViewer.AnnotationSettings.Highlight.Opacity = opacity; + break; + + case AnnotationMode.Underline: + pdfViewer.AnnotationSettings.Underline.Opacity = opacity; + break; + case AnnotationMode.Ink: + pdfViewer.AnnotationSettings.Ink.Opacity = opacity; + break; + } + SelectedOpacity = opacity; + } + else if (isFillColorToolbarVisible || isDeskTopFillColorToolbarVisible) + { + + switch (pdfViewer.AnnotationMode) + { + case AnnotationMode.Square: + Color existingSquareFillColor = pdfViewer.AnnotationSettings.Square.FillColor; + Color modifiedSquareFillColor = existingSquareFillColor.WithAlpha(opacity); + pdfViewer.AnnotationSettings.Square.FillColor = modifiedSquareFillColor; + break; + + case AnnotationMode.Circle: + Color existingCircleFillColor = pdfViewer.AnnotationSettings.Circle.FillColor; + Color modifiedCircleFillColor = existingCircleFillColor.WithAlpha(opacity); + pdfViewer.AnnotationSettings.Circle.FillColor = modifiedCircleFillColor; + break; + + case AnnotationMode.Line: + Color existingLineFillColor = pdfViewer.AnnotationSettings.Line.FillColor; + Color modifiedLineFillColor = existingLineFillColor.WithAlpha(opacity); + pdfViewer.AnnotationSettings.Line.FillColor = modifiedLineFillColor; + break; + + case AnnotationMode.Arrow: + Color existingArrowFillColor = pdfViewer.AnnotationSettings.Arrow.FillColor; + Color modifiedArrowFillColor = existingArrowFillColor.WithAlpha(opacity); + pdfViewer.AnnotationSettings.Arrow.FillColor = modifiedArrowFillColor; + break; + } + } + } + } + } + void OnThicknessCommand(object parameter) + { + if (parameter is float thickness) + { + if (selectedAnnotation != null) + { + if (selectedAnnotation is ShapeAnnotation shape) + { + shape.BorderWidth = thickness; + } + else if (selectedAnnotation is InkAnnotation ink) + { + ink.BorderWidth = thickness; + } + SelectedThickness = thickness; + } + else + { + if (IsThicknessToolbarVisible || IsDeskTopColorToolbarVisible || IsInkColorPalleteVisible) + { + switch (pdfViewer.AnnotationMode) + { + case AnnotationMode.Square: + pdfViewer.AnnotationSettings.Square.BorderWidth = thickness; + break; + + case AnnotationMode.Circle: + pdfViewer.AnnotationSettings.Circle.BorderWidth = thickness; + break; + + case AnnotationMode.Line: + pdfViewer.AnnotationSettings.Line.BorderWidth = thickness; + break; + + case AnnotationMode.Arrow: + pdfViewer.AnnotationSettings.Arrow.BorderWidth = thickness; + break; + case AnnotationMode.Ink: + pdfViewer.AnnotationSettings.Ink.BorderWidth = thickness; + break; + case AnnotationMode.InkEraser: + pdfViewer.AnnotationSettings.InkEraser.Thickness = thickness; + break; + } + SelectedThickness = thickness; + } + } + } + } + void OnColorCommand(object parameter) + { + if (parameter is Color color) + { + if (selectedAnnotation != null) + { + if (isFillColorToolbarVisible || isDeskTopFillColorToolbarVisible) + { + if (selectedAnnotation is ShapeAnnotation shape) + shape.FillColor = color; + } + else if (isColorToolbarVisible || isDeskTopColorToolbarVisible || isInkColorPalleteVisible) + { + selectedAnnotation.Color = color; + SelectedColor = color; + } + } + else + { + if (isFillColorToolbarVisible || isDeskTopFillColorToolbarVisible) + { + switch (pdfViewer.AnnotationMode) + { + case AnnotationMode.Square: + pdfViewer.AnnotationSettings.Square.FillColor = color; + break; + + case AnnotationMode.Circle: + pdfViewer.AnnotationSettings.Circle.FillColor = color; + break; + + case AnnotationMode.Line: + pdfViewer.AnnotationSettings.Line.FillColor = color; + break; + + case AnnotationMode.Arrow: + pdfViewer.AnnotationSettings.Arrow.FillColor = color; + break; + } + } + else if (isColorToolbarVisible || isDeskTopColorToolbarVisible || isInkColorPalleteVisible) + { + switch (pdfViewer.AnnotationMode) + { + case AnnotationMode.Square: + pdfViewer.AnnotationSettings.Square.Color = color; + break; + + case AnnotationMode.Circle: + pdfViewer.AnnotationSettings.Circle.Color = color; + break; + + case AnnotationMode.Line: + pdfViewer.AnnotationSettings.Line.Color = color; + break; + + case AnnotationMode.Arrow: + pdfViewer.AnnotationSettings.Arrow.Color = color; + break; + + case AnnotationMode.Highlight: + pdfViewer.AnnotationSettings.Highlight.Color = color; + SelectedColor = color; + break; + + case AnnotationMode.Underline: + pdfViewer.AnnotationSettings.Underline.Color = color; + SelectedColor = color; + break; + + case AnnotationMode.StrikeOut: + pdfViewer.AnnotationSettings.StrikeOut.Color = color; + SelectedColor = color; + break; + + case AnnotationMode.Squiggly: + pdfViewer.AnnotationSettings.Squiggly.Color = color; + SelectedColor = color; + break; + + case AnnotationMode.Ink: + pdfViewer.AnnotationSettings.Ink.Color = color; + SelectedColor = color; + break; + } + } + } + } + } + +#if WINDOWS + async Task WriteFile(Stream stream, string fileName) + { + string filePath = string.Empty; + if (stream is MemoryStream memoryStream) + { + memoryStream.Position = 0; + StorageFolder folder = ApplicationData.Current.LocalFolder; + StorageFile file = await folder?.CreateFileAsync(fileName, CreationCollisionOption.ReplaceExisting); + if (file != null) + { + filePath = file.Path; + Windows.Storage.Streams.IRandomAccessStream fileStream = await file.OpenAsync(FileAccessMode.ReadWrite); + Stream st = fileStream.AsStreamForWrite(); + st.SetLength(0); + st.Write(memoryStream.ToArray(), 0, (int)memoryStream.Length); + st.Flush(); + st.Dispose(); + fileStream.Dispose(); + } + } + return filePath; + } +#else + string WriteFile(Stream stream, string fileName) + { + string filePath = string.Empty; + if (stream != null) + { + stream.Position = 0; + filePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), fileName); + FileStream file = File.Create(filePath); + stream.CopyTo(file); + stream.Close(); + file.Close(); + } + return filePath; + } +#endif + + internal async void SaveDocument() + { + IsFileOperationListVisible = false; + ShowMoreOptions = false; + MemoryStream stream = new MemoryStream(); + await pdfViewer.SaveDocumentAsync(stream); +#if WINDOWS + string filePath = await WriteFile(stream, "SavedDocument.pdf"); +#else + string filePath = WriteFile(stream, "SavedDocument.pdf"); +#endif + await Application.Current!.MainPage!.DisplayAlert("Document saved", $"The PDF has been saved to the file {filePath}", "OK"); + } + internal async void ImportAnnotations() + { + IsFileOperationListVisible = false; + ShowMoreOptions = false; + string basePath = "SampleBrowser.Maui.Resources.Pdf"; + if (BaseConfig.IsIndividualSB) + basePath = "SampleBrowser.Maui.PdfViewer.Samples.PdfViewer.CustomToolbar.XFDF"; + Stream? stream = typeof(CustomToolbarViewModel).GetTypeInfo().Assembly.GetManifestResourceStream($"{basePath}.Annotations.xfdf"); + if (stream != null) + { + await pdfViewer.ImportAnnotationsAsync(stream, Syncfusion.Pdf.Parsing.AnnotationDataFormat.XFdf); + } + } + + internal async void ExportAnnotations() + { + IsFileOperationListVisible = false; + ShowMoreOptions = false; + MemoryStream stream = new MemoryStream(); + await pdfViewer.ExportAnnotationsAsync(stream, Syncfusion.Pdf.Parsing.AnnotationDataFormat.XFdf); +#if WINDOWS + string filePath = await WriteFile(stream, "ExportedAnnotations.xfdf"); +#else + string filePath = WriteFile(stream, "ExportedAnnotations.xfdf"); +#endif + await Application.Current!.MainPage!.DisplayAlert("Annotations exported", $"The annotations are exported to the file {filePath}", "OK"); + } + internal bool AnnotationModeIsInkEraser() + { + return pdfViewer.AnnotationMode == AnnotationMode.InkEraser ? true : false; + } } } \ No newline at end of file diff --git a/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/XFDF/Annotations.xfdf b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/XFDF/Annotations.xfdf new file mode 100644 index 00000000..c56e85e7 --- /dev/null +++ b/MAUI/PdfViewer/SampleBrowser.Maui.PdfViewer/Samples/PdfViewer/CustomToolbar/XFDF/Annotations.xfdf @@ -0,0 +1,258 @@ + +393.303162,564.171631;393.303162,564.171631;396.747162,582.088623;397.895172,586.671631;398.660187,590.005615;400.191162,595.838623;400.573181,597.088623;401.339172,598.755615;401.721161,600.421631;401.721161,601.255615;401.339172,601.671631;400.956177,601.671631;400.191162,601.671631;399.808167,601.255615;399.043182,600.838623;398.660187,600.838623;398.277191,600.838623;397.895172,599.588623;397.895172,598.338623;397.895172,592.921631;398.277191,590.005615;399.043182,587.505615;402.104187,582.921631;404.400177,581.671631;410.140167,578.755615;412.436188,577.921631;414.349182,577.088623;416.645172,575.005615;417.410187,573.338623;417.410187,571.671631;415.114166,566.255615;412.436188,563.338623;405.548187,558.338623;401.721161,557.088623;397.512177,556.671631;391.007172,558.338623;388.328186,560.005615;384.885162,563.755615;384.119171,565.005615;383.737183,566.255615;384.119171,568.755615;384.885162,569.588623;388.328186,570.838623;391.007172,570.838623;394.068176,570.421631;400.573181,568.755615;403.635162,567.921631;407.461182,567.088623;411.288177,566.255615;413.201172,566.671631;416.645172,567.505615;418.175171,568.755615;420.854187,572.088623;421.237183,573.755615;421.619171,575.421631;421.237183,577.921631;421.237183,579.171631;420.854187,580.005615;420.089172,581.255615;420.089172,581.671631;420.089172,582.088623;420.089172,581.671631;420.471161,581.255615;420.854187,580.421631;421.619171,577.088623;422.385162,575.005615;423.533173,572.088623;424.298187,571.255615;425.828186,571.671631;427.359161,572.505615;428.124176,574.171631;430.038177,577.921631;430.803162,579.588623;431.186188,580.421631;431.186188,581.255615;431.186188,581.671631;431.568176,580.421631;432.334167,578.338623;434.247162,572.921631;435.012177,570.005615;435.395172,567.088623;436.160187,563.338623;436.160187,561.671631;436.160187,560.421631;435.777191,560.421631;435.395172,560.005615;434.247162,560.838623;433.482178,562.088623;433.099182,565.005615;433.482178,568.755615;434.247162,572.088623;436.160187,577.505615;436.543182,579.588623;437.308167,580.838623;437.691162,582.088623;438.073181,582.505615;438.839172,582.505615;439.221161,582.088623;440.369171,580.421631;441.135162,579.171631;441.517181,577.921631;441.900177,576.671631;442.283173,576.671631;442.283173,576.255615;442.283173,576.671631;442.665161,577.921631;443.048187,580.421631;443.813171,582.921631;444.196167,584.171631;444.961182,585.005615;445.344177,585.005615;445.726166,585.005615;446.492188,583.755615;447.257172,582.921631;448.405182,581.671631;448.788177,581.671631;449.553162,581.255615;450.701172,581.671631;451.849182,582.505615;453.380188,584.588623;454.145172,585.421631;454.527191,586.255615;455.293182,587.921631;455.293182,588.338623;456.058167,589.171631;456.441162,589.171631;456.441162,588.755615;456.058167,588.338623;456.058167,586.255615;456.058167,584.171631;456.823181,580.421631;457.206177,579.588623;458.354187,578.338623;459.502167,579.171631;461.798187,580.421631;465.624176,585.005615;467.155182,588.338623;468.303162,592.088623;468.686188,594.588623;469.068176,595.838623;469.068176,596.671631;469.068176,597.088623;468.686188,596.671631;468.303162,595.421631;468.303162,592.088623;467.920166,582.088623;467.920166,577.505615;468.303162,574.171631;469.451172,568.755615;469.834167,567.088623;471.364166,564.588623;472.130188,563.755615;472.895172,563.755615;475.191162,563.755615;476.339172,565.005615;477.869171,567.505615;478.252167,569.588623;477.869171,571.671631;475.956177,574.588623;474.043182,575.421631;472.512177,575.421631;469.451172,575.421631;468.303162,575.005615;467.155182,574.588623;467.920166,575.838623;469.068176,577.088623;472.130188,580.421631;473.277191,582.088623;475.191162,583.755615;475.573181,582.921631;475.573181,582.505615;475.956177,581.671631;475.956177,581.255615;476.339172,578.338623;476.339172,577.505615;476.721161,577.088623;477.104187,577.505615;478.635162,579.171631;480.548187,581.671631;481.313171,582.921631;482.461182,584.588623;482.461182,585.005615;482.844177,585.421631;482.844177,585.838623;483.226166,585.421631;483.609161,584.588623;484.374176,583.755615;485.140167,582.088623;485.905182,581.671631;486.670166,581.671631;488.201172,582.921631;489.349182,584.588623;490.497162,587.505615;490.497162,589.171631;490.497162,590.005615;490.497162,591.255615;490.497162,591.671631;491.262177,590.838623;493.175171,588.755615;493.941162,587.088623;494.706177,586.255615;495.471161,584.171631;495.854187,583.755615;495.854187,582.088623;495.471161,581.671631;494.706177,580.838623;494.706177,580.421631;495.089172,581.255615;495.471161,581.671631;496.619171,583.755615;497.002167,585.005615;498.533173,587.088623;498.915161,588.338623;498.915161,588.755615;498.915161,588.338623;498.915161,587.088623;498.915161,585.421631;498.915161,584.171631;499.298187,582.088623;499.681183,582.088623;501.211182,582.505615;502.359161,583.755615;503.890167,585.005615;505.420166,587.505615;506.186157,588.755615;506.568176,589.171631;506.951172,589.588623;506.951172,589.171631;506.951172,588.338623;506.951172,587.505615;506.951172,586.671631;507.334167,584.588623;507.716156,583.755615;508.482178,583.755615;509.630157,583.755615;511.160156,585.005615;512.308167,587.088623;513.073181,588.755615;512.691162,591.255615;512.308167,592.088623;511.543182,592.505615;510.395172,592.921631;509.630157,592.505615;508.864166,592.088623;508.482178,591.255615;508.482178,590.838623;508.864166,590.838623;509.247162,590.838623;512.308167,592.088623;513.839172,592.505615;514.987183,592.921631;516.517181,592.505615;517.283173,592.088623;517.665161,591.255615;518.048157,589.171631;518.048157,588.755615;518.048157,587.921631;518.048157,588.338623;518.048157,588.755615;518.048157,589.588623;518.431183,591.255615;519.196167,593.338623;519.961182,594.588623;520.344177,595.005615;521.109161,594.588623;522.257172,593.338623;522.640167,591.255615;524.170166,588.338623;524.170166,587.505615;524.936157,587.505615;525.701172,587.921631;527.232178,589.588623;529.145172,592.088623;531.058167,594.171631;533.354156,597.088623;533.737183,597.921631393.303162,564.171631;393.303162,564.171631;396.747162,582.088623;397.895172,586.671631;398.660187,590.005615;400.191162,595.838623;400.573181,597.088623;401.339172,598.755615;401.721161,600.421631;401.721161,601.255615;401.339172,601.671631;400.956177,601.671631;400.191162,601.671631;399.808167,601.255615;399.043182,600.838623;398.660187,600.838623;398.277191,600.838623;397.895172,599.588623;397.895172,598.338623;397.895172,592.921631;398.277191,590.005615;399.043182,587.505615;402.104187,582.921631;404.400177,581.671631;410.140167,578.755615;412.436188,577.921631;414.349182,577.088623;416.645172,575.005615;417.410187,573.338623;417.410187,571.671631;415.114166,566.255615;412.436188,563.338623;405.548187,558.338623;401.721161,557.088623;397.512177,556.671631;391.007172,558.338623;388.328186,560.005615;384.885162,563.755615;384.119171,565.005615;383.737183,566.255615;384.119171,568.755615;384.885162,569.588623;388.328186,570.838623;391.007172,570.838623;394.068176,570.421631;400.573181,568.755615;403.635162,567.921631;407.461182,567.088623;411.288177,566.255615;413.201172,566.671631;416.645172,567.505615;418.175171,568.755615;420.854187,572.088623;421.237183,573.755615;421.619171,575.421631;421.237183,577.921631;421.237183,579.171631;420.854187,580.005615;420.089172,581.255615;420.089172,581.671631;420.089172,582.088623;420.089172,581.671631;420.471161,581.255615;420.854187,580.421631;421.619171,577.088623;422.385162,575.005615;423.533173,572.088623;424.298187,571.255615;425.828186,571.671631;427.359161,572.505615;428.124176,574.171631;430.038177,577.921631;430.803162,579.588623;431.186188,580.421631;431.186188,581.255615;431.186188,581.671631;431.568176,580.421631;432.334167,578.338623;434.247162,572.921631;435.012177,570.005615;435.395172,567.088623;436.160187,563.338623;436.160187,561.671631;436.160187,560.421631;435.777191,560.421631;435.395172,560.005615;434.247162,560.838623;433.482178,562.088623;433.099182,565.005615;433.482178,568.755615;434.247162,572.088623;436.160187,577.505615;436.543182,579.588623;437.308167,580.838623;437.691162,582.088623;438.073181,582.505615;438.839172,582.505615;439.221161,582.088623;440.369171,580.421631;441.135162,579.171631;441.517181,577.921631;441.900177,576.671631;442.283173,576.671631;442.283173,576.255615;442.283173,576.671631;442.665161,577.921631;443.048187,580.421631;443.813171,582.921631;444.196167,584.171631;444.961182,585.005615;445.344177,585.005615;445.726166,585.005615;446.492188,583.755615;447.257172,582.921631;448.405182,581.671631;448.788177,581.671631;449.553162,581.255615;450.701172,581.671631;451.849182,582.505615;453.380188,584.588623;454.145172,585.421631;454.527191,586.255615;455.293182,587.921631;455.293182,588.338623;456.058167,589.171631;456.441162,589.171631;456.441162,588.755615;456.058167,588.338623;456.058167,586.255615;456.058167,584.171631;456.823181,580.421631;457.206177,579.588623;458.354187,578.338623;459.502167,579.171631;461.798187,580.421631;465.624176,585.005615;467.155182,588.338623;468.303162,592.088623;468.686188,594.588623;469.068176,595.838623;469.068176,596.671631;469.068176,597.088623;468.686188,596.671631;468.303162,595.421631;468.303162,592.088623;467.920166,582.088623;467.920166,577.505615;468.303162,574.171631;469.451172,568.755615;469.834167,567.088623;471.364166,564.588623;472.130188,563.755615;472.895172,563.755615;475.191162,563.755615;476.339172,565.005615;477.869171,567.505615;478.252167,569.588623;477.869171,571.671631;475.956177,574.588623;474.043182,575.421631;472.512177,575.421631;469.451172,575.421631;468.303162,575.005615;467.155182,574.588623;467.920166,575.838623;469.068176,577.088623;472.130188,580.421631;473.277191,582.088623;475.191162,583.755615;475.573181,582.921631;475.573181,582.505615;475.956177,581.671631;475.956177,581.255615;476.339172,578.338623;476.339172,577.505615;476.721161,577.088623;477.104187,577.505615;478.635162,579.171631;480.548187,581.671631;481.313171,582.921631;482.461182,584.588623;482.461182,585.005615;482.844177,585.421631;482.844177,585.838623;483.226166,585.421631;483.609161,584.588623;484.374176,583.755615;485.140167,582.088623;485.905182,581.671631;486.670166,581.671631;488.201172,582.921631;489.349182,584.588623;490.497162,587.505615;490.497162,589.171631;490.497162,590.005615;490.497162,591.255615;490.497162,591.671631;491.262177,590.838623;493.175171,588.755615;493.941162,587.088623;494.706177,586.255615;495.471161,584.171631;495.854187,583.755615;495.854187,582.088623;495.471161,581.671631;494.706177,580.838623;494.706177,580.421631;495.089172,581.255615;495.471161,581.671631;496.619171,583.755615;497.002167,585.005615;498.533173,587.088623;498.915161,588.338623;498.915161,588.755615;498.915161,588.338623;498.915161,587.088623;498.915161,585.421631;498.915161,584.171631;499.298187,582.088623;499.681183,582.088623;501.211182,582.505615;502.359161,583.755615;503.890167,585.005615;505.420166,587.505615;506.186157,588.755615;506.568176,589.171631;506.951172,589.588623;506.951172,589.171631;506.951172,588.338623;506.951172,587.505615;506.951172,586.671631;507.334167,584.588623;507.716156,583.755615;508.482178,583.755615;509.630157,583.755615;511.160156,585.005615;512.308167,587.088623;513.073181,588.755615;512.691162,591.255615;512.308167,592.088623;511.543182,592.505615;510.395172,592.921631;509.630157,592.505615;508.864166,592.088623;508.482178,591.255615;508.482178,590.838623;508.864166,590.838623;509.247162,590.838623;512.308167,592.088623;513.839172,592.505615;514.987183,592.921631;516.517181,592.505615;517.283173,592.088623;517.665161,591.255615;518.048157,589.171631;518.048157,588.755615;518.048157,587.921631;518.048157,588.338623;518.048157,588.755615;518.048157,589.588623;518.431183,591.255615;519.196167,593.338623;519.961182,594.588623;520.344177,595.005615;521.109161,594.588623;522.257172,593.338623;522.640167,591.255615;524.170166,588.338623;524.170166,587.505615;524.936157,587.505615;525.701172,587.921631;527.232178,589.588623;529.145172,592.088623;531.058167,594.171631;533.354156,597.088623;533.737183,597.921631353.604828,210.407501;389.518799,242.385498;425.923828,211.883514;414.597839,173.901520;364.738831,173.353516;353.604828,210.407501362.184937,108.051971;396.154968,133.255981;432.864929,107.504974;419.714966,74.082977;373.142944,73.534973;362.184937,108.051971Syncfusion0 G 1 1 1 rg 0 Tc 0 Tw 100 Tz 16.25 TL 0 Ts 0 Tr /Helv 12 Tffont: Helv 12.0pt;font-stretch:Normal; text-align:left; color:#6BD929 331.121033,413.625534;331.121033,413.625534;334.565033,431.542542;335.713043,436.125534;336.478043,439.459534;338.009033,445.292542;338.391037,446.542542;339.157043,448.209534;339.539032,449.875534;339.539032,450.709534;339.157043,451.125534;338.774033,451.125534;338.009033,451.125534;337.626038,450.709534;336.861038,450.292542;336.478043,450.292542;336.095047,450.292542;335.713043,449.042542;335.713043,447.792542;335.713043,442.375534;336.095047,439.459534;336.861038,436.959534;339.922043,432.375534;342.218033,431.125534;347.958038,428.209534;350.254044,427.375534;352.167038,426.542542;354.463043,424.459534;355.228043,422.792542;355.228043,421.125534;352.932037,415.709534;350.254044,412.792542;343.366043,407.792542;339.539032,406.542542;335.330032,406.125534;328.825043,407.792542;326.146042,409.459534;322.703033,413.209534;321.937042,414.459534;321.555038,415.709534;321.937042,418.209534;322.703033,419.042542;326.146042,420.292542;328.825043,420.292542;331.886032,419.875534;338.391037,418.209534;341.453033,417.375534;345.279037,416.542542;349.106033,415.709534;351.019043,416.125534;354.463043,416.959534;355.993042,418.209534;358.672043,421.542542;359.055038,423.209534;359.437042,424.875534;359.055038,427.375534;359.055038,428.625534;358.672043,429.459534;357.907043,430.709534;357.907043,431.125534;357.907043,431.542542;357.907043,431.125534;358.289032,430.709534;358.672043,429.875534;359.437042,426.542542;360.203033,424.459534;361.351044,421.542542;362.116043,420.709534;363.646042,421.125534;365.177032,421.959534;365.942047,423.625534;367.856033,427.375534;368.621033,429.042542;369.004044,429.875534;369.004044,430.709534;369.004044,431.125534;369.386032,429.875534;370.152039,427.792542;372.065033,422.375534;372.830032,419.459534;373.213043,416.542542;373.978043,412.792542;373.978043,411.125534;373.978043,409.875534;373.595047,409.875534;373.213043,409.459534;372.065033,410.292542;371.300034,411.542542;370.917038,414.459534;371.300034,418.209534;372.065033,421.542542;373.978043,426.959534;374.361038,429.042542;375.126038,430.292542;375.509033,431.542542;375.891037,431.959534;376.657043,431.959534;377.039032,431.542542;378.187042,429.875534;378.953033,428.625534;379.335037,427.375534;379.718033,426.125534;380.101044,426.125534;380.101044,425.709534;380.101044,426.125534;380.483032,427.375534;380.866043,429.875534;381.631042,432.375534;382.014038,433.625534;382.779037,434.459534;383.162033,434.459534;383.544037,434.459534;384.310043,433.209534;385.075043,432.375534;386.223038,431.125534;386.606033,431.125534;387.371033,430.709534;388.519043,431.125534;389.667038,431.959534;391.198044,434.042542;391.963043,434.875534;392.345047,435.709534;393.111038,437.375534;393.111038,437.792542;393.876038,438.625534;394.259033,438.625534;394.259033,438.209534;393.876038,437.792542;393.876038,435.709534;393.876038,433.625534;394.641037,429.875534;395.024033,429.042542;396.172043,427.792542;397.320038,428.625534;399.616043,429.875534;403.442047,434.459534;404.973038,437.792542;406.121033,441.542542;406.504044,444.042542;406.886032,445.292542;406.886032,446.125534;406.886032,446.542542;406.504044,446.125534;406.121033,444.875534;406.121033,441.542542;405.738037,431.542542;405.738037,426.959534;406.121033,423.625534;407.269043,418.209534;407.652039,416.542542;409.182037,414.042542;409.948044,413.209534;410.713043,413.209534;413.009033,413.209534;414.157043,414.459534;415.687042,416.959534;416.070038,419.042542;415.687042,421.125534;413.774033,424.042542;411.861038,424.875534;410.330032,424.875534;407.269043,424.875534;406.121033,424.459534;404.973038,424.042542;405.738037,425.292542;406.886032,426.542542;409.948044,429.875534;411.095047,431.542542;413.009033,433.209534;413.391037,432.375534;413.391037,431.959534;413.774033,431.125534;413.774033,430.709534;414.157043,427.792542;414.157043,426.959534;414.539032,426.542542;414.922043,426.959534;416.453033,428.625534;418.366043,431.125534;419.131042,432.375534;420.279037,434.042542;420.279037,434.459534;420.662033,434.875534;420.662033,435.292542;421.044037,434.875534;421.427032,434.042542;422.192047,433.209534;422.958038,431.542542;423.723038,431.125534;424.488037,431.125534;426.019043,432.375534;427.167038,434.042542;428.315033,436.959534;428.315033,438.625534;428.315033,439.459534;428.315033,440.709534;428.315033,441.125534;429.080032,440.292542;430.993042,438.209534;431.759033,436.542542;432.524033,435.709534;433.289032,433.625534;433.672043,433.209534;433.672043,431.542542;433.289032,431.125534;432.524033,430.292542;432.524033,429.875534;432.907043,430.709534;433.289032,431.125534;434.437042,433.209534;434.820038,434.459534;436.351044,436.542542;436.733032,437.792542;436.733032,438.209534;436.733032,437.792542;436.733032,436.542542;436.733032,434.875534;436.733032,433.625534;437.116043,431.542542;437.499039,431.542542;439.029037,431.959534;440.177032,433.209534;441.708038,434.459534;443.238037,436.959534;444.004044,438.209534;444.386032,438.625534;444.769043,439.042542;444.769043,438.625534;444.769043,437.792542;444.769043,436.959534;444.769043,436.125534;445.152039,434.042542;445.534042,433.209534;446.300034,433.209534;447.448044,433.209534;448.978043,434.459534;450.126038,436.542542;450.891037,438.209534;450.509033,440.709534;450.126038,441.542542;449.361038,441.959534;448.213043,442.375534;447.448044,441.959534;446.682037,441.542542;446.300034,440.709534;446.300034,440.292542;446.682037,440.292542;447.065033,440.292542;450.126038,441.542542;451.657043,441.959534;452.805038,442.375534;454.335037,441.959534;455.101044,441.542542;455.483032,440.709534;455.866043,438.625534;455.866043,438.209534;455.866043,437.375534;455.866043,437.792542;455.866043,438.209534;455.866043,439.042542;456.249039,440.709534;457.014038,442.792542;457.779037,444.042542;458.162033,444.459534;458.927032,444.042542;460.075043,442.792542;460.458038,440.709534;461.988037,437.792542;461.988037,436.959534;462.754044,436.959534;463.519043,437.375534;465.050034,439.042542;466.963043,441.542542;468.876038,443.625534;471.172043,446.542542;471.555038,447.375534331.121033,413.625534;331.121033,413.625534;334.565033,431.542542;335.713043,436.125534;336.478043,439.459534;338.009033,445.292542;338.391037,446.542542;339.157043,448.209534;339.539032,449.875534;339.539032,450.709534;339.157043,451.125534;338.774033,451.125534;338.009033,451.125534;337.626038,450.709534;336.861038,450.292542;336.478043,450.292542;336.095047,450.292542;335.713043,449.042542;335.713043,447.792542;335.713043,442.375534;336.095047,439.459534;336.861038,436.959534;339.922043,432.375534;342.218033,431.125534;347.958038,428.209534;350.254044,427.375534;352.167038,426.542542;354.463043,424.459534;355.228043,422.792542;355.228043,421.125534;352.932037,415.709534;350.254044,412.792542;343.366043,407.792542;339.539032,406.542542;335.330032,406.125534;328.825043,407.792542;326.146042,409.459534;322.703033,413.209534;321.937042,414.459534;321.555038,415.709534;321.937042,418.209534;322.703033,419.042542;326.146042,420.292542;328.825043,420.292542;331.886032,419.875534;338.391037,418.209534;341.453033,417.375534;345.279037,416.542542;349.106033,415.709534;351.019043,416.125534;354.463043,416.959534;355.993042,418.209534;358.672043,421.542542;359.055038,423.209534;359.437042,424.875534;359.055038,427.375534;359.055038,428.625534;358.672043,429.459534;357.907043,430.709534;357.907043,431.125534;357.907043,431.542542;357.907043,431.125534;358.289032,430.709534;358.672043,429.875534;359.437042,426.542542;360.203033,424.459534;361.351044,421.542542;362.116043,420.709534;363.646042,421.125534;365.177032,421.959534;365.942047,423.625534;367.856033,427.375534;368.621033,429.042542;369.004044,429.875534;369.004044,430.709534;369.004044,431.125534;369.386032,429.875534;370.152039,427.792542;372.065033,422.375534;372.830032,419.459534;373.213043,416.542542;373.978043,412.792542;373.978043,411.125534;373.978043,409.875534;373.595047,409.875534;373.213043,409.459534;372.065033,410.292542;371.300034,411.542542;370.917038,414.459534;371.300034,418.209534;372.065033,421.542542;373.978043,426.959534;374.361038,429.042542;375.126038,430.292542;375.509033,431.542542;375.891037,431.959534;376.657043,431.959534;377.039032,431.542542;378.187042,429.875534;378.953033,428.625534;379.335037,427.375534;379.718033,426.125534;380.101044,426.125534;380.101044,425.709534;380.101044,426.125534;380.483032,427.375534;380.866043,429.875534;381.631042,432.375534;382.014038,433.625534;382.779037,434.459534;383.162033,434.459534;383.544037,434.459534;384.310043,433.209534;385.075043,432.375534;386.223038,431.125534;386.606033,431.125534;387.371033,430.709534;388.519043,431.125534;389.667038,431.959534;391.198044,434.042542;391.963043,434.875534;392.345047,435.709534;393.111038,437.375534;393.111038,437.792542;393.876038,438.625534;394.259033,438.625534;394.259033,438.209534;393.876038,437.792542;393.876038,435.709534;393.876038,433.625534;394.641037,429.875534;395.024033,429.042542;396.172043,427.792542;397.320038,428.625534;399.616043,429.875534;403.442047,434.459534;404.973038,437.792542;406.121033,441.542542;406.504044,444.042542;406.886032,445.292542;406.886032,446.125534;406.886032,446.542542;406.504044,446.125534;406.121033,444.875534;406.121033,441.542542;405.738037,431.542542;405.738037,426.959534;406.121033,423.625534;407.269043,418.209534;407.652039,416.542542;409.182037,414.042542;409.948044,413.209534;410.713043,413.209534;413.009033,413.209534;414.157043,414.459534;415.687042,416.959534;416.070038,419.042542;415.687042,421.125534;413.774033,424.042542;411.861038,424.875534;410.330032,424.875534;407.269043,424.875534;406.121033,424.459534;404.973038,424.042542;405.738037,425.292542;406.886032,426.542542;409.948044,429.875534;411.095047,431.542542;413.009033,433.209534;413.391037,432.375534;413.391037,431.959534;413.774033,431.125534;413.774033,430.709534;414.157043,427.792542;414.157043,426.959534;414.539032,426.542542;414.922043,426.959534;416.453033,428.625534;418.366043,431.125534;419.131042,432.375534;420.279037,434.042542;420.279037,434.459534;420.662033,434.875534;420.662033,435.292542;421.044037,434.875534;421.427032,434.042542;422.192047,433.209534;422.958038,431.542542;423.723038,431.125534;424.488037,431.125534;426.019043,432.375534;427.167038,434.042542;428.315033,436.959534;428.315033,438.625534;428.315033,439.459534;428.315033,440.709534;428.315033,441.125534;429.080032,440.292542;430.993042,438.209534;431.759033,436.542542;432.524033,435.709534;433.289032,433.625534;433.672043,433.209534;433.672043,431.542542;433.289032,431.125534;432.524033,430.292542;432.524033,429.875534;432.907043,430.709534;433.289032,431.125534;434.437042,433.209534;434.820038,434.459534;436.351044,436.542542;436.733032,437.792542;436.733032,438.209534;436.733032,437.792542;436.733032,436.542542;436.733032,434.875534;436.733032,433.625534;437.116043,431.542542;437.499039,431.542542;439.029037,431.959534;440.177032,433.209534;441.708038,434.459534;443.238037,436.959534;444.004044,438.209534;444.386032,438.625534;444.769043,439.042542;444.769043,438.625534;444.769043,437.792542;444.769043,436.959534;444.769043,436.125534;445.152039,434.042542;445.534042,433.209534;446.300034,433.209534;447.448044,433.209534;448.978043,434.459534;450.126038,436.542542;450.891037,438.209534;450.509033,440.709534;450.126038,441.542542;449.361038,441.959534;448.213043,442.375534;447.448044,441.959534;446.682037,441.542542;446.300034,440.709534;446.300034,440.292542;446.682037,440.292542;447.065033,440.292542;450.126038,441.542542;451.657043,441.959534;452.805038,442.375534;454.335037,441.959534;455.101044,441.542542;455.483032,440.709534;455.866043,438.625534;455.866043,438.209534;455.866043,437.375534;455.866043,437.792542;455.866043,438.209534;455.866043,439.042542;456.249039,440.709534;457.014038,442.792542;457.779037,444.042542;458.162033,444.459534;458.927032,444.042542;460.075043,442.792542;460.458038,440.709534;461.988037,437.792542;461.988037,436.959534;462.754044,436.959534;463.519043,437.375534;465.050034,439.042542;466.963043,441.542542;468.876038,443.625534;471.172043,446.542542;471.555038,447.375534PERJQ1QgS0VZPSJBUCI+CjxTVFJFQU0gS0VZPSJOIiBERUZJTkU9IiI+CjxBUlJBWSBLRVk9IkJC +b3giPgo8RklYRUQgVkFMPSIwLjAwMDAwMCIvPgo8RklYRUQgVkFMPSIwLjAwMDAwMCIvPgo8RklY +RUQgVkFMPSIxMDAuMDAwMDAwIi8+CjxGSVhFRCBWQUw9IjEwMC4wMDAwMDAiLz4KPC9BUlJBWT4K +PE5BTUUgS0VZPSJGaWx0ZXIiIFZBTD0iRmxhdGVEZWNvZGUiLz4KPElOVCBLRVk9Ikxlbmd0aCIg +VkFMPSIxNTAiLz4KPEFSUkFZIEtFWT0iTWF0cml4Ij4KPEZJWEVEIFZBTD0iMS4wMDAwMDAiLz4K +PEZJWEVEIFZBTD0iMC4wMDAwMDAiLz4KPEZJWEVEIFZBTD0iMC4wMDAwMDAiLz4KPEZJWEVEIFZB +TD0iMS4wMDAwMDAiLz4KPEZJWEVEIFZBTD0iMC4wMDAwMDAiLz4KPEZJWEVEIFZBTD0iMC4wMDAw +MDAiLz4KPC9BUlJBWT4KPERJQ1QgS0VZPSJSZXNvdXJjZXMiPgo8RElDVCBLRVk9IkV4dEdTdGF0 +ZSI+CjxESUNUIEtFWT0iNzYwM2QzNzMtMmNkMC00YzI0LWFkY2EtNDZlNTU5NTYxNDBlIj4KPE5B +TUUgS0VZPSJCTSIgVkFMPSJOb3JtYWwiLz4KPEZJWEVEIEtFWT0iQ0EiIFZBTD0iMS4wMDAwMDAi +Lz4KPEZJWEVEIEtFWT0iY2EiIFZBTD0iMS4wMDAwMDAiLz4KPC9ESUNUPgo8L0RJQ1Q+CjxBUlJB +WSBLRVk9IlByb2NTZXQiPgo8TkFNRSBWQUw9IlBERiIvPgo8TkFNRSBWQUw9IkltYWdlQiIvPgo8 +TkFNRSBWQUw9IkltYWdlQyIvPgo8TkFNRSBWQUw9IkltYWdlSSIvPgo8TkFNRSBWQUw9IlRleHQi +Lz4KPC9BUlJBWT4KPERJQ1QgS0VZPSJYT2JqZWN0Ij4KPFNUUkVBTSBLRVk9Ijk4ZDI1MzRmLWU0 +ZjUtNDQwNy1hYWFiLTMyZTI4ZTU3YTEwNiIgREVGSU5FPSIiPgo8SU5UIEtFWT0iQml0c1BlckNv +bXBvbmVudCIgVkFMPSI4Ii8+CjxOQU1FIEtFWT0iQ29sb3JTcGFjZSIgVkFMPSJEZXZpY2VSR0Ii +Lz4KPEFSUkFZIEtFWT0iRGVjb2RlIj4KPEZJWEVEIFZBTD0iMC4wMDAwMDAiLz4KPEZJWEVEIFZB +TD0iMS4wMDAwMDAiLz4KPEZJWEVEIFZBTD0iMC4wMDAwMDAiLz4KPEZJWEVEIFZBTD0iMS4wMDAw +MDAiLz4KPEZJWEVEIFZBTD0iMC4wMDAwMDAiLz4KPEZJWEVEIFZBTD0iMS4wMDAwMDAiLz4KPC9B +UlJBWT4KPERJQ1QgS0VZPSJEZWNvZGVQYXJtcyI+CjxJTlQgS0VZPSJCaXRzUGVyQ29tcG9uZW50 +IiBWQUw9IjgiLz4KPEJPT0wgS0VZPSJCbGFja0lzMSIgVkFMPSJ0cnVlIi8+CjxJTlQgS0VZPSJD +b2x1bW5zIiBWQUw9IjE3MSIvPgo8SU5UIEtFWT0iSyIgVkFMPSItMSIvPgo8SU5UIEtFWT0iUHJl +ZGljdG9yIiBWQUw9IjE1Ii8+CjwvRElDVD4KPE5BTUUgS0VZPSJGaWx0ZXIiIFZBTD0iRENURGVj +b2RlIi8+CjxJTlQgS0VZPSJIZWlnaHQiIFZBTD0iMTMwIi8+CjxJTlQgS0VZPSJMZW5ndGgiIFZB +TD0iMzY4NyIvPgo8TkFNRSBLRVk9IlN1YnR5cGUiIFZBTD0iSW1hZ2UiLz4KPE5BTUUgS0VZPSJU +eXBlIiBWQUw9IlhPYmplY3QiLz4KPElOVCBLRVk9IldpZHRoIiBWQUw9IjE3MSIvPgo8REFUQSBN +T0RFPSJSQVciIEVOQ09ESU5HPSJIRVgiPkZGRDhGRkUwMDAxMDRBNDY0OTQ2MDAwMTAxMDAwMDAx +MDAwMTAwMDBGRkRCMDA4NAowMDA5MDYwNzA4MDcwNjA5MDgwNzA4MEEwQTA5MEIwRDE2MEYwRDBD +MEMwRDFCMTQxNTEwMTYyMDFEMjIyMjIwMUQxRjFGMjQyODM0MkMyNAoyNjMxMjcxRjFGMkQzRDJE +MzEzNTM3M0EzQTNBMjMyQjNGNDQzRjM4NDMzNDM5M0EzNzAxMEEwQTBBMEQwQzBEMUEwRjBGMUEz +NzI1MUYyNQozNzM3MzczNzM3MzczNzM3MzczNzM3MzczNzM3MzczNzM3MzczNzM3MzczNzM3Mzcz +NzM3MzczNzM3MzczNzM3MzczNzM3MzczNzM3MzczNwozNzM3MzczNzM3MzczNzM3MzczN0ZGQzAw +MDExMDgwMDgyMDBBQjAzMDEyMjAwMDIxMTAxMDMxMTAxRkZDNDAwMUIwMDAxMDAwMjAzMDEwMQow +MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDUwNjAxMDMwNDA3MDJGRkM0MDA0MTEwMDAwMTAzMDMwMjA0 +MDMwNjAzMDQwNjBCMDAwMDAwMDAwMQowMjAzMDQwMDA1MTEwNjIxMTIzMTQxNTExMzYxNzEwNzE0 +MjIzMjgxOTExNTQyNjIyMzUyNzI4MjI0MjUzMzUzQTFEMTE2MTczNTczOTJBMgpCMUIyQjNDMkYw +RkZDNDAwMTUwMTAxMDEwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMUZGQzQwMDE0MTEw +MTAwMDAwMDAwMDAwMAowMDAwMDAwMDAwMDAwMDAwMDAwMEZGREEwMDBDMDMwMTAwMDIxMTAzMTEw +MDNGMDBGNzFBNTI5NDBBNTI5NDBBNTI5NDBBNTI5NDBBNTI5NAowQTU3MzVDNjc0NUI2QzM3NjY0 +RjdEQjYyMzM0OUUyNzFDNzBFMDI0NTdDNDJCOTQzOUI2RDZFRTUxQTQyMTcwREM2RkM1NDNEQzky +NTNERgo3RTU0MUQ5NTgyNzE1MTFBNUVGRUM2QTVCNjFCOEMzNjlDNDQ2MkZCOERCNEE3MzZGMTUy +OTU3MEYxODFEODkwNzlFRkI1NzJDRkJBNERCOQo0QzcyREJBNzk2OTQyOUE1RjBDQkI4Mzg4RTI0 +NDdGRDI4MDc2NUFGQTc2NEY1RUM0MjRBRTM3QTgzNkU1QTFBOTBFQThCRUU2RTg4RUQzNgpBNzFE +NThDRTMyMTA5MDRFM0NGMTgxNUJBREYzRDhCODMyQTc2M0YxOEUxNTk0MkQwRTIwQTE0ODUwRTYw +QTRFRTNBN0QwODM1MTY1OUI1Ngo5MkI1NEJCODNBNDgyMDcxQzk5NEYyQjg5RDdENUQzODk0Nzk5 +MjRFMDBFNDM2MDMwMkI1Njg1OUIxRUU1NjA0Q0Y4RUYxNzk1MjVFNzFDNwo5Q0UxMjAxNzM4OEU0 +MjcyMDY1MjNFNTA3QTg0RDA1OEU5NEE1MDI5NEE1MDI5NEE1MDI5NEE1MDI5NEE1MDI5NEE1MDI5 +NEE1MDJCMEE1MAoxQ0NFMDU2NkFBQkVEMDY0QkE2RDkxRUNGMTFFMkQ0QUJDM0UyMjg3MTJBQzE2 +OUFDMTUzQUJGQTIwMUZBOTE0MTRERDUwQTdGNUI5NEI4NQo2QjQ1QTlDOTQyMTVBMTgwNzFFRjRF +OUM4NUM4NTc3NEExMjE2NTIzQ0IzNTc1RDU0RUMzQjBFOEQ3NjMzNzE5MkYyNTJEMjIyQzQ4OUQx +RQo3MEUxMkRBM0NDMTM4Q0Y5NjczNTQ3OTNBOTEzMUVFRDZGNEU5Qzg0RDQ5N0ZDMkY3M0IwQzM1 +NjQzNjg2NzM4NUM5NUUzOTI1NUMzODRGRQo5NDk1Njc3QURGMjZFQjJGNUFFQUQ2NjM1QUQ2MTJE +QzAwQTExRTQyMDcxMzZEQkJGMkI5MjcwNzlGMEU0QTFCMDc5OTI0RjIxNTQ1OEEwMwo0RkFBMjQ3 +RDI5Njc3RDY4NjYwQjA5NkVFMzcxNDYwMTQyQjFCQjY4RkQ2QURDOTNGOTQxRUY4QUI2NDE4QjEy +RDkwNUE4OTBEQTQ0NzhDQwoyMzA4NDI3NjRBNDU2QkIzREIyMkQ5RURDQ0MxODI4RTA2NUExRDc3 +MkEyNzcyQTUxRUFBMjQ5MjRGN0FGM0FGNjg1QTgyNUVBMEI4MUQyMQpBNkNGMTk3MTQxQjlBRjI0 +OTAwRjVGMEMxRUQ4Q0YxMUY1MURDNTQxQ0Q3MTc1RUY2QTNBQTExNkY4MkUzODhEMzE2RTU3MTNF +RkI2NzFFRgowQUYyM0U3QjgxRDg2NEY2QUY1NzhCMUQ5OEIxOUE4RjE5QTRCNENCNDkwODQzNjkx +ODA5MDM5MDE1MUJBNjJDNTEzNEVEOUQ5Qjc0MzRGQwoyOEY4OTZCM0NENkIzQ0Q0N0ZGQjk2MkE1 +OTI0MTE5MDcyMjgzMzRBNTI4MTRBNTI4MTRBNTI4MTRBNTI4MTRBQzFBODU5REE5RUREMTVGMwox +OTg1M0IzRTY2NzFFRUQwNTFFMkFDMUZENThEOTFFQUEyMDUwNERENjM4ODYzMzUwMEE3MzUyNUMw +MTI5NEM0QjNCMDQwMjE0QkZEQkJGOApFQkIwQzIxMjdFQUFBRjk4QkE2RUQ5Mzk4NkRGOTkzQTU1 +RTUwQjE5NEI5MjI0RjFCNkJGMzA4NDYxQkM3RjJEMDc3NEFENDU2NjhBRjI5OAo3NkUzMUZDNzRG +MzY1MEJFMzU4RkU1NEU0RDU3MzUzN0I0OUI1RDkyMDk3MDQ1OUVCOTBFQTU3RUVFODdBMjJEOTBB +NTAxQ0NGMTg0OUUxQwpFMzcwMEQ1QkEyNDI4QjAxOTRCNTA2MzMzMURCNDhDMDQzMkQ4NDhDN0Ew +QUYzOThCQTNFRTNBOEJEQTE0REJGRUE1NjNDM0I3QzI3RjgyMAozMEE1MDI1RTRCNkFGODE1RkMx +Q0Q1RTY0RjYxQkQxQ0IxNzVCNkI0QjI1QjYxQUI1MDU4MUI5NkU0Rjc3ODIyMTEyMTJEQkFCNTJG +RTI0QQozQzIwMDlDMEU1REY5Njc3QTgxOTUyNkZGNzlENTVDMzc5RjFFRTJEQTIzMjlBN0UyNUI2 +MzFGMEQwQTUxMDU3MTdDNUY5NTI3NjRGMUFDQQpCOTY0MEFGNDRENURBM0U3NkEwQkY0MDlGMUVG +MEE4MkM0NzYxNkNBOTJEQjc5NzAwNTFGODk0REFCM0YwQTg4REIzQ0M3NEFCMkQ5RUQ1MApBQ0Q2 +RTY2MDVCOTkwRDQ3NjQ2MTI5MDczOTNENDkzRDQ5M0I5MzQxRTFCMDZFQUVERDIxQ0Y3QTJCMEIx +NzA5RUU3MDRGNzk4NEUzREQ5OQpDRjAzNTBEODUxRkNFQUMyNDc5MDI0RjREQkQ3RjQ1RTlDNDY5 +REI0MjE5MjExRUY0RTgwNUY1MjM5MEMwRDkwOUZEMjkxQjBGQkYzMjZBMQpBNjVDNkQwREVBOTdF +NERDQTRDNDg1NkRCMjkwMUIwQjI5NDg3NjYzODlDQTk1OEVBNTI4MjAwRUI5NTlBRTY5RkFGMkU1 +M0U2QjE2Q0QyRgo2ODc0MzkyNTI1NDg5QjcxNDE2OTA4NkZBQkJDMUYzNzA4RUVBQzAzRTc0MTlG +Njk5QUNENTZCNjU1NjZCNDNBOTE3MjdDNzBBREQyQkUxMQoxOTI3QTkzRDE1OEZCMERGQjU0MzdC +MzgwRDQxOEE1Q0IwNUIxRUI5NEU3NTNDM0UzMzgwQjRDQjA5MjczOTVCODQxQ0E5NUNDODRGMTYw +MAowMzZFQjE3QTA3NEIwRDQ5QTgyNENFQjkzRUU1QzZEMzBERTUxMEU0ODFGMENCNzRGRTZDNzZE +ODEzRkNCREM4QUY2QzY5QjQzNERBNTBEMgowMjEwOTE4NEE1MjMwMDBBMDg2ODU2OTlGMjA4N0VG +QjM4M0NCQzgyOThCMTQxNjk4NDFGQkYxMkZGMDA5OEUzNkU1NTM2MDYwNjA3MkFDRAoyQTA1Mjk0 +QTA1Mjk0QTA1Mjk0QTA1NzE1RTI2Mzk2RkI2Qzg5NkM0MzdBNjM4RDIwQTkzMUQ4MTk1Qjg3QjBB +RURBQzExOUEwRjJCNzdGRAo2MDZBNjc4OTlGNjlGQzNFREJGOTYxMDlGRUVGQzdGRUYxQzQ4NTJD +OEU3QjAwOUYzRjNCMkQ5RUM5QTk2MUM2NDQ2OEVGRDg2RDExNTIzNgo2MjA0MzVCODQxRkUyNTI4 +MDNFQkMzNTZGQzU0MzZBRkJDQUFDNTYwOTMzNTk0Nzg5Mjc2NkEzMzVGREUzQ0IzQzI4NEZEQzhB +MEE0NUNFMgo1Rjc1MTZBMjc3NEU0N0Q0QjJERDgwQ0EwN0UyQ0ZCNEMzNERBMTAwRjI2OTA0MDI3 +OENGNURGMDA3RDhEQTIxNjhGN0ExNDc2NjNDNkQ1MQo3RDQzMENBMDM2REI0OTMxQzI1MjkwMzAw +MDAxOUFFRUQyMTYzNEQ4MkM4Q0M0NTJCQzQ5NkJGREFDQzdDRjM3OUU1NkVBNTEzRDc3REJEMAow +QTlCQTA4NjZBQ0IzNTk1NzEyMzUxNUNEN0Q5MkVBNTg1MjdGRjAwMTgzRkUzNUQ0MTUzMjMwRkU5 +MjExMjFCMUYzMzhEMjc4NTQzQ0NBNwo3Q0ZEMEZEMkJCRUIxNDExMzdGQjhEQzYzNUEzREVBQzE2 +RjQ1RDI0QUNBN0MzNkJDNjA4NDk0OUZDREM1REI5NTU1QTFDN0Y2OTE3NzUxRgpDNDI2NUFFQzkx +OTQzMTg4Q0Q3OEFGMjQ3OTY0OTAzRDczRjRBQjFFOEY3QkRFNkQ5MjE2MzNFMTA5RjI5MkNFN0Y3 +MDNDQjA5Qzc5NzZGMgpDNTRBNEY5OTFBREQwREU5OTMxRDQzMzFEOTQxNUI4RTJDRTAyNDBBMEYx +QUI2RTlDODkwNTEzRUYxMjJFNzc0OTM3RTE3MzdFMEM0NDI1NApDQURDOTBCNEFGMDkzRjFBMTQ0 +MTIzMDU0NDFEODU0OTVGNkM3NzJCNzA4QjZFNjJGNzNFNTZBNkQ0MDQzNzI5N0ZCM0UwMEQyN0U3 +MjRGMAo3MTA0MjQxQzBDMTE5QzlFNTUyN0VDRTlCODkyNUNCRTZBODlFMTZDRjA0RjkxRTFBMjQ2 +QzIyQTA4NEE5NDcwNzkxMjMxOUY0QUU1QjQ2QQpBOEM2RTMyNzUxMzkxNjQ0RUI5REQxNUVFRjY5 +QjZCMDAxNzUzMTUwNDhFMjIwRkM4OTUyQjJBMkEzQjZDM0I1NTE2RUIyNjk0NUQ5MkRFQwpDMTgz +N0I5RTg2MUExODA5RjBEOEU3RDRGRjAwNjdEN0NGMzVERTYwNUNEMjkwMTE3Qjc0QUJCQjkxOUIz +RkY0MDJBMTYzNkI2RjczOUM2MQo2QUQ4NDlCMUJBQTY4QkNDM0FFNDg0QUQ5NzUyM0U2MDE3QjYx +NDM2Rjg2QUIxN0ZCQUVBN0JFREFBNTZBQkIyQkIyNjBEQUVEQTUyRjQwOApBOTA1MEJCODI1MkEx +RTIyREQxOEY5Mzg3M0MyM0FGM0E4M0QwNEMyQkNGRTVCQkIyMzFDQjMwODFGRkRBQjg2RTkyNjQ1 +OUUzRkJDNURGNQozNDI4OEM2Nzg3OEREOEE5NDY0RjYxOTU2RTdGQ0FCMTc2RDZCNkE4MTA2MzNG +MURDMzNFNENDNDgzMTIxQzMyMTZFQkY5RTU4MDM5MERGNwoyNzYxNUM3NjdEMzBGREMyNkZFMzdB +QzkwQzRCQjgyODYxODg1OEUzNjIwQTdCMjQxRTZBM0I2NTQ3QUYyREE4MjUyM0I1NzU5NTFEQTkx +MAoyRkYxNUU4RUVBNDJEQjczRENDMkMyRDI3QTgyOTU4MDQ1NkMyRDZBMjZCMDUzMjZENzIwMENF +NDJEODcxQTJBRkE4NTJCMUY2MzUwN0EyMApCNTYyQjk1RTc0QkFENDk2OTExQTQ3QkNEQkQwNEUw +MThFRThFMkMyN0JGMEFGODgxRURCNTRDNUUzNTRDMEI2QkMyMUI0NTUzQUU0RTBDQgo1MDIxRTFD +Nzk1RTY0NzI0MjdGNTJCMDI4MzREQzM1MkFBQzkwMUQ5N0E5MjA5ODhEMzQzNzdEODcwM0NEMjhG +NDQ4RTRBMDQ5RDg2NTNGNQpBRjlEMDVBQTE3QUI2Q0NFNUM1NTA1NTBDMjY0MkQ5MEQ5NUYxNzEw +NEUzN0NGRDcwN0NDMUFFMDkzNkM3RDRDQzlENDlBQkZDMTcxNTA1QQo3MUY4QjZGNkNGMTMzMTQy +NTI0RjExQzhGOEREREJFNkU0MzkwRUU3MUVDRDIyNDhCNDU4RUREMDY0Mjk0QTMyRTIwOUQ4NTdD +Qzg3MTQ0MQo3MTNFODBBRDM4RjUzRTU0MTc1QTUyOTQwQTUyOTQwQUE4NUUwN0UzMUFGMkQzNkVE +OEM2QjYzMkFCOEM4MUREQzNGMDM0M0ZFRjU3RDA1NQpCQ0Q1NTM0NUZGMDA0RUI4NkEwQkQyODg1 +MDk1MzhDNzY0RjY2OTkxQzAwN0ZDNUM2N0VCNDE2QkE1Mjk0MEFBRkVBRkI5NDg4RDE1QUI3NQpB +Q0ZGMDA1QURDOTVFMDQ1REIzRTE2REYxM0FBRjI0MERGRDcwM0FENDk1RTZFOTEyQ0Y2RDdBN0NF +NzM4MTg2ODY0RTA2NEE4RjQ0QTQ3NQo1MTNCMDFENEQ0MzY5NkI2Q0I3NjRCREE4NkY4REYwRENF +NUE3ODU5NjQ5Q0ZCQTQ3Q0U1MkQwRkQ1RDU0N0E5RjRBMDlCQjQ1QkQ5QjREQgoyMkRCRTM3MTc4 +NTFEQTBEQTRBOEU1NEFDNzUyN0E5M0NDRDU2REYzRkU5NUVBMTJDNjQxQjFEQTFFQ0JDNzNCNDk5 +NDNGMjFFODUwOEU2NwpGNTYzQjU3NzZBREI5Q0E2NTk4RjY5QjUyQkZBRDZFNEEyREIyQUZFRTEx +OEY4REQzRTQ5MUNCQ0M4QUQxN0M3MjJFOEVEMEIyRkREQjYxMQo2MkE5MEM4M0YzM0FFQTg2MDY3 +QkE5NEEzRkUzNDE0OUIxQjJGNkFCQjVCRjYxODcyMTUxREE5RDMyNTVDMkU1MjEwMzI1MDg1QkFC +RjA5QgoxRDMyQUUxMDQ4RkREMUU3NTc3RDE1QTJFMDY5MzhDQUYwMTRBOTMzMUQwMDNCMjlERjk4 +QTQ3MjQ4RkRENDhFRDU5RjY3QkE2RDNBNjc0RAo0Njg2RTYxNTJEQzFFMkM5NzA3NTcwRjRGNDFD +ODdBNTU5RTgzODZFNzY4Qjc1RDlBNDM1NzQ4MTE2NkI2ODU3MTIxMTI1OTRCODEyN0I4MApBMDZC +QjM4MTNDMUMxODFDMzhDNjMxQjYyQkVBOTQxMTM2OUQzNzY2QjMzQUVCRDZBQjU0Mjg2RUJCRjNB +OTg2NDI0OUYyREJBNzk1NEI3NApBNTI4MjMyRjE2MEI1NUVDMzYyRUQwMTg5NUUxMUNCNkE3MTNG +MTIzRDE1Q0M3REVCRUFEMTYzQjVEOTVCNTM3Njk4MTFBMjI1NDcyQjJEMwo2MDE1OUVFQTNDQ0ZE +NkE0Njk0MTAxQUY2M0JEMkY0NkRFMjNDNzZEQzc1QzcyMzI5MjEwREE0QTk0QTFENDAwMzcyNzE5 +QUU0RDNCMjU1Nwo4QkNBQUUxMUQ4NzlBQjY0MjhBMjI0NTVCQUQ5NDE3RDRBMjk1MkQ0MDFERjg0 +NzAyMDAzQjZGQzVFNTU2QTIzMzU4QzZGNDE5QTUyOTQwQQo1Mjk0MUNGNzA5MDIyNDA5MzI1NUM5 +OTY5NEUxRkEwMjZBMEJEOUJCMkE2NzQyRDk4Qjg0OTcxRThDMUY3MTQ3OTk1MzlGMTkzRjc1NTRB +NgpBMzY1NzIzNEY1Q0Q4Njg2NTZFNDQ3NTA5MDNBOTI4MjA1NzJFODk5MERDOUQxRjY1NzlBRjkx +NzA1OTIwNzZGODA2RDQxMzc1QTI2NEI4RgowNjMzQjI2NUJBODY1ODY5MjU2RTM4QjM4NEE1MjM5 +OTI2QjVERDJFMzEyRDUwNUQ5QjcwOTJEQzc4Q0QwQ0FEQzcwRTAwRkYwMDNGNEFBQQo0Nzg3MzM1 +QTRENkE3REREODcyMkQ4MTk1ODVDNEI3QkEzMEI5NEExQzlENzg3NDRGNjQxRjUzNDFCNkQwQzQ4 +RDU1NzM2MkZCNzE2OTRDRApBRTM5RTNCNjQyNzUzODUyQ0Y0OTBCMUQwRTNFNTFEMDFDRjNBQjVD +OTkwQ0MzOENFQzg5MkUyNUI2NTk0MTcxQzcxNUIwNEE0MEM5MjdFOQo1QjQwMDM5NTU0RjUzQUJG +MURCREM1RDJFQ0E4RjgwMTI5OTc3MzIwNkRFMDg1NjEyRDEzRDBBRDVGRjJBNEQwNkNEMjRDMzk3 +MDdBNDZBNgo5Q0Q5NEJEM0MwNEMzNDJCMzk2NjI4REQwMzA3OTE1Njc4OEZBODFEMkFCMUFBREM3 +QjU1RUI3QjM1QTU4MjE1NkM4OTMwQTlEQzFGRUQxNgpEMEUyNzBGQTI0RjAyM0Y4OTZBRUQ1NzlE +NEIzNUQ4MTZCRjBFMDcwQTY2Qzk1MDhGMTMyM0UxNEFENDBGQzQ0N0VFQTQwMkEzRTQ5MzU1QwpG +Njc5NkY2REQ5MTIyRjJDOTVBQTFBNUIxMDZERUI1NzM3NUE0MkIyRTNERUFFMzk5NTY3QTgwMkE4 +QkM4MThBQ0QyOTUwMjk0QTUwMjk0QQo1MDI5NEE1MDI5NEE1MDI5NEE1MDI5NEE1MDYwOEM4QzU1 +NERBQjBERkFDOUUzQjFBNjY2REJGRjAwMEY3NUM1MzhEQzY5RUQyQ0ZCQUE5NAo3MjQyMTQ5M0JB +NzI0OTA5MjM2Q0YzQUI2RDI4MkFEMTM0ODk5MTM5QUI4RUE2OUNBQkJDQjY4RjEzMkQyOUIwODhD +QzFFRTg2RjdERkYwMAo1Mjg5MzU2ODFCMEFDRDcxNUUyRTUxRUNGNkM5MzcwOThBMjE5OEVEOTVB +QjAzMjRGNjAwNzUyNEVDM0Q2ODMxN0FCQTQ3QjNEQUE0REM2NQo5M0UxNDc0MTU5MDA2NEE4RjQ0 +ODFENDkzODAzRDZBMzM0NkRBOUY4NTZFNzI2REM3RkRBOTcyNzNERUE2NjRFNzgxNDQ2Q0Q4M0Q5 +MDMwOQpGQTEzRDZBMUEyRkJFNkE1QkM0MTg5NzQ2QzI1QUI2ODQ0RjlFRDA1MDI5NENBNTZFRDMw +N0I4NDI0RjExRUU3ODRENUU0NzJBMEFDRUFBRAozMzJCNTBEQzIxNjZFNEE4RDZENkRCNzExMjk5 +NjkzODcxRTBBQzY0MDU3RTUwNDAyMDlFNzgyN0JENThBMkM3NkEyNDY2QTNDNzZEMkRCMgpEMjQy +MUI0MjQ2MDI1MjM2MDA1NkRBNTAyOTRBNTAyOTRBNTAyOTRBNTAyOTRBNTAyOTRBNTAyOTRBNTAy +OTRBNTAyOTRBNTAyQThCQUZFRQo2QzIyRUQ2RDg3MjQxNzU5ODg5MzcxNUM3NDlERTQzQTE0MTEx +REEwM0E5NTM4QUM4RkUwQUJENTcxM0I2OEI3M0Q3NDZFRThFQzI2MTczRApBNkZDMzZFNDI5MDBB +RDI5QzkzODA3RUE3RUY0MUM1QTRFRDZFNUFBRDQwNEJFMTMzRTUyRDUyQTZBRDNCODUzQ0JERDVC +RjYxQjI0NzkyNAo1NEQ1NjAwQzU2NjgxNEE1MjgxNEE1MjgxNEE1MjgxNEE1MjgxNEE1MjgxNEE1 +MjgxNEE1MjgxNEE1MjgxNEE1MjgxNEE1MjgxNEE1MjgxNApBNTI4MTRBNTI4MTRBNTI4MTRBNTI4 +MTRBNTI4MTRBNTI4MTRBNTI4M0ZGRkQ5PC9EQVRBPgo8L1NUUkVBTT4KPC9ESUNUPgo8L0RJQ1Q+ +CjxOQU1FIEtFWT0iU3VidHlwZSIgVkFMPSJGb3JtIi8+CjxOQU1FIEtFWT0iVHlwZSIgVkFMPSJY +T2JqZWN0Ii8+CjxEQVRBIE1PREU9IkZJTFRFUkVEIiBFTkNPRElORz0iQVNDSUkiPiUgQ2hhbmdl +IGNvLW9yZGluYXRlIHN5c3RlbSB0byBsZWZ0L3RvcC4KMS4wMCAuMDAgLjAwIDEuMDAgLjAwIDEw +MC4wMCAgY20KcQovNzYwM2QzNzMtMmNkMC00YzI0LWFkY2EtNDZlNTU5NTYxNDBlIGdzCnEKMTAw +LjAwIC4wMCAuMDAgMTAwLjAwIC4wMCAtMTAwLjAwICBjbQovOThkMjUzNGYtZTRmNS00NDA3LWFh +YWItMzJlMjhlNTdhMTA2IERvClEKUQo8L0RBVEE+CjwvU1RSRUFNPgo8L0RJQ1Q+351.846893,681.585022;351.299896,621.864014;449.370911,622.684021;449.862885,680.735962Sticky note \ No newline at end of file diff --git a/MAUI/Picker/NuGet.config b/MAUI/Picker/NuGet.config new file mode 100644 index 00000000..baadb9d6 --- /dev/null +++ b/MAUI/Picker/NuGet.config @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker.sln b/MAUI/Picker/SampleBrowser.Maui.Picker.sln new file mode 100644 index 00000000..e87e309c --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31611.283 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleBrowser.Maui.Picker", "SampleBrowser.Maui.Picker\SampleBrowser.Maui.Picker.csproj", "{C1337509-1DA7-406B-9BFE-B1B8AEE04B8E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + Release-Xml|Any CPU = Release-Xml|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C1337509-1DA7-406B-9BFE-B1B8AEE04B8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C1337509-1DA7-406B-9BFE-B1B8AEE04B8E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C1337509-1DA7-406B-9BFE-B1B8AEE04B8E}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {C1337509-1DA7-406B-9BFE-B1B8AEE04B8E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C1337509-1DA7-406B-9BFE-B1B8AEE04B8E}.Release|Any CPU.Build.0 = Release|Any CPU + {C1337509-1DA7-406B-9BFE-B1B8AEE04B8E}.Release|Any CPU.Deploy.0 = Release|Any CPU + {C1337509-1DA7-406B-9BFE-B1B8AEE04B8E}.Release-Xml|Any CPU.ActiveCfg = Release-Xml|Any CPU + {C1337509-1DA7-406B-9BFE-B1B8AEE04B8E}.Release-Xml|Any CPU.Build.0 = Release-Xml|Any CPU + {C1337509-1DA7-406B-9BFE-B1B8AEE04B8E}.Release-Xml|Any CPU.Deploy.0 = Release-Xml|Any CPU + {E08DAE9C-C432-4384-A5B9-20BDBDB5D575}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E08DAE9C-C432-4384-A5B9-20BDBDB5D575}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E08DAE9C-C432-4384-A5B9-20BDBDB5D575}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E08DAE9C-C432-4384-A5B9-20BDBDB5D575}.Release|Any CPU.Build.0 = Release|Any CPU + {E08DAE9C-C432-4384-A5B9-20BDBDB5D575}.Release-Xml|Any CPU.ActiveCfg = Release-Xml|Any CPU + {E08DAE9C-C432-4384-A5B9-20BDBDB5D575}.Release-Xml|Any CPU.Build.0 = Release-Xml|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572} + EndGlobalSection +EndGlobal diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/App.xaml b/MAUI/Picker/SampleBrowser.Maui.Picker/App.xaml new file mode 100644 index 00000000..b261b119 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/App.xaml.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/App.xaml.cs new file mode 100644 index 00000000..bd3e4c59 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/App.xaml.cs @@ -0,0 +1,21 @@ +#region Copyright Syncfusion Inc. 2001-2022. +// Copyright Syncfusion Inc. 2001-2022. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using System.Reflection; + +namespace SampleBrowser.Maui.Picker; + +public partial class App : Application +{ + public App() + { + InitializeComponent(); + var appInfo = typeof(App).GetTypeInfo().Assembly; + SampleBrowser.Maui.Base.BaseConfig.IsIndividualSB = true; + MainPage = SampleBrowser.Maui.Base.BaseConfig.MainPageInit(appInfo); + } +} diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/ControlConfig.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/ControlConfig.cs new file mode 100644 index 00000000..6fe4be05 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/ControlConfig.cs @@ -0,0 +1,14 @@ +#region Copyright Syncfusion Inc. 2001-2022. +// Copyright Syncfusion Inc. 2001-2022. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.Picker +{ + // All the code in this file is included in all platforms. + public class ControlConfig + { + } +} \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/ControlList.xml b/MAUI/Picker/SampleBrowser.Maui.Picker/ControlList.xml new file mode 100644 index 00000000..f274b020 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/ControlList.xml @@ -0,0 +1,7 @@ + + + + + + diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/MauiProgram.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/MauiProgram.cs new file mode 100644 index 00000000..a49fd64e --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/MauiProgram.cs @@ -0,0 +1,29 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.Picker; +using Syncfusion.Maui.Core.Hosting; +using SampleBrowser.Maui.Base.Hosting; + +public static class MauiProgram +{ + public static MauiApp CreateMauiApp() + { + var builder = MauiApp.CreateBuilder(); + builder + .UseMauiApp() + .ConfigureSyncfusionCore() + .ConfigureFonts(fonts => + { + fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); + fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); + }); + + builder.ConfigureSampleBrowserBase(); + return builder.Build(); + } +} diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/PickerSamplesList.xml b/MAUI/Picker/SampleBrowser.Maui.Picker/PickerSamplesList.xml new file mode 100644 index 00000000..d0acc227 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/PickerSamplesList.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Android/AndroidManifest.xml b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Android/AndroidManifest.xml new file mode 100644 index 00000000..e9937ad7 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Android/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Android/MainActivity.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Android/MainActivity.cs new file mode 100644 index 00000000..760f1e71 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Android/MainActivity.cs @@ -0,0 +1,17 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Android.App; +using Android.Content.PM; +using Android.OS; + +namespace SampleBrowser.Maui.Picker; + +[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] +public class MainActivity : MauiAppCompatActivity +{ +} diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Android/MainApplication.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Android/MainApplication.cs new file mode 100644 index 00000000..3a5ee1d4 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Android/MainApplication.cs @@ -0,0 +1,22 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Android.App; +using Android.Runtime; + +namespace SampleBrowser.Maui.Picker; + +[Application] +public class MainApplication : MauiApplication +{ + public MainApplication(IntPtr handle, JniHandleOwnership ownership) + : base(handle, ownership) + { + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Android/Resources/values/colors.xml b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Android/Resources/values/colors.xml new file mode 100644 index 00000000..c04d7492 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Android/Resources/values/colors.xml @@ -0,0 +1,6 @@ + + + #512BD4 + #2B0B98 + #2B0B98 + \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/MacCatalyst/AppDelegate.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/MacCatalyst/AppDelegate.cs new file mode 100644 index 00000000..2c8a95a0 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/MacCatalyst/AppDelegate.cs @@ -0,0 +1,16 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Foundation; + +namespace SampleBrowser.Maui.Picker; + +[Register("AppDelegate")] +public class AppDelegate : MauiUIApplicationDelegate +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/MacCatalyst/Info.plist b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/MacCatalyst/Info.plist new file mode 100644 index 00000000..c96dd0a2 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/MacCatalyst/Info.plist @@ -0,0 +1,30 @@ + + + + + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/MacCatalyst/Program.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/MacCatalyst/Program.cs new file mode 100644 index 00000000..22cedb7c --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/MacCatalyst/Program.cs @@ -0,0 +1,22 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using ObjCRuntime; +using UIKit; + +namespace SampleBrowser.Maui.Picker; + +public class Program +{ + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } +} diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Tizen/Main.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Tizen/Main.cs new file mode 100644 index 00000000..36899397 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Tizen/Main.cs @@ -0,0 +1,23 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using System; +using Microsoft.Maui; +using Microsoft.Maui.Hosting; + +namespace SampleBrowser.Maui.Picker; + +class Program : MauiApplication +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + + static void Main(string[] args) + { + var app = new Program(); + app.Run(args); + } +} diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Tizen/tizen-manifest.xml b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Tizen/tizen-manifest.xml new file mode 100644 index 00000000..746ba275 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Tizen/tizen-manifest.xml @@ -0,0 +1,15 @@ + + + + + maui-application-title-placeholder + maui-appicon-placeholder + + + + + http://tizen.org/privilege/internet + + + + \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Windows/App.xaml b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Windows/App.xaml new file mode 100644 index 00000000..88baf254 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Windows/App.xaml @@ -0,0 +1,8 @@ + + + diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Windows/App.xaml.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Windows/App.xaml.cs new file mode 100644 index 00000000..02338778 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Windows/App.xaml.cs @@ -0,0 +1,31 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Microsoft.UI.Xaml; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace SampleBrowser.Maui.Picker.WinUI; + +/// +/// Provides application-specific behavior to supplement the default Application class. +/// +public partial class App : MauiWinUIApplication +{ + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} + diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Windows/Package.appxmanifest b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Windows/Package.appxmanifest new file mode 100644 index 00000000..196a6335 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Windows/Package.appxmanifest @@ -0,0 +1,46 @@ + + + + + + + + + $placeholder$ + User Name + $placeholder$.png + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Windows/app.manifest b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Windows/app.manifest new file mode 100644 index 00000000..481835f1 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/Windows/app.manifest @@ -0,0 +1,15 @@ + + + + + + + + true/PM + PerMonitorV2, PerMonitor + + + diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/iOS/AppDelegate.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/iOS/AppDelegate.cs new file mode 100644 index 00000000..2c8a95a0 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/iOS/AppDelegate.cs @@ -0,0 +1,16 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Foundation; + +namespace SampleBrowser.Maui.Picker; + +[Register("AppDelegate")] +public class AppDelegate : MauiUIApplicationDelegate +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/iOS/Info.plist b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/iOS/Info.plist new file mode 100644 index 00000000..0004a4fd --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/iOS/Info.plist @@ -0,0 +1,32 @@ + + + + + LSRequiresIPhoneOS + + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/iOS/Program.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/iOS/Program.cs new file mode 100644 index 00000000..22cedb7c --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Platforms/iOS/Program.cs @@ -0,0 +1,22 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using ObjCRuntime; +using UIKit; + +namespace SampleBrowser.Maui.Picker; + +public class Program +{ + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } +} diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Properties/launchSettings.json b/MAUI/Picker/SampleBrowser.Maui.Picker/Properties/launchSettings.json new file mode 100644 index 00000000..edf8aadc --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "Windows Machine": { + "commandName": "MsixPackage", + "nativeDebugging": false + } + } +} \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/AppIcon/appicon.svg b/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/AppIcon/appicon.svg new file mode 100644 index 00000000..232c35c5 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/AppIcon/appicon.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/AppIcon/appiconfg.svg b/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/AppIcon/appiconfg.svg new file mode 100644 index 00000000..208b00c3 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/AppIcon/appiconfg.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/Fonts/OpenSans-Regular.ttf b/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/Fonts/OpenSans-Regular.ttf new file mode 100644 index 00000000..a49f11de Binary files /dev/null and b/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/Fonts/OpenSans-Regular.ttf differ diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/Fonts/OpenSans-Semibold.ttf b/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/Fonts/OpenSans-Semibold.ttf new file mode 100644 index 00000000..23911e4e Binary files /dev/null and b/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/Fonts/OpenSans-Semibold.ttf differ diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/Fonts/Sync FontIcons.ttf b/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/Fonts/Sync FontIcons.ttf new file mode 100644 index 00000000..69f554fd Binary files /dev/null and b/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/Fonts/Sync FontIcons.ttf differ diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/Images/dotnet_bot.svg b/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/Images/dotnet_bot.svg new file mode 100644 index 00000000..abfaff26 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/Images/dotnet_bot.svg @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/Raw/AboutAssets.txt b/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/Raw/AboutAssets.txt new file mode 100644 index 00000000..15d62448 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/Raw/AboutAssets.txt @@ -0,0 +1,15 @@ +Any raw assets you want to be deployed with your application can be placed in +this directory (and child directories). Deployment of the asset to your application +is automatically handled by the following `MauiAsset` Build Action within your `.csproj`. + + + +These files will be deployed with you package and will be accessible using Essentials: + + async Task LoadMauiAsset() + { + using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt"); + using var reader = new StreamReader(stream); + + var contents = reader.ReadToEnd(); + } diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/Splash/splash.svg b/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/Splash/splash.svg new file mode 100644 index 00000000..21dfb25f --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Resources/Splash/splash.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/SampleBrowser.Maui.Picker.csproj b/MAUI/Picker/SampleBrowser.Maui.Picker/SampleBrowser.Maui.Picker.csproj new file mode 100644 index 00000000..7a6d9ec4 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/SampleBrowser.Maui.Picker.csproj @@ -0,0 +1,91 @@ + + + + net6.0-android;net6.0-ios;net6.0-maccatalyst + $(TargetFrameworks);net6.0-windows10.0.19041.0 + + + Exe + SampleBrowser.Maui.Picker + true + true + enable + enable + $(NoWarn);NU1803 + + + SampleBrowser.Maui.Picker + + + com.companyname.samplebrowser.maui.picker + 70148d94-d7ed-4c3d-a0f6-6c5b611ba6d1 + + + 1.0 + 1 + + 14.2 + 14.0 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + TRACE;DEBUG; + true + 5 + + + + TRACE;RELEASE; + true + 5 + + + + TRACE;RELEASE; + true + 5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/SampleBrowser.Maui.Picker.nuspec b/MAUI/Picker/SampleBrowser.Maui.Picker/SampleBrowser.Maui.Picker.nuspec new file mode 100644 index 00000000..e3fcc9a3 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/SampleBrowser.Maui.Picker.nuspec @@ -0,0 +1,15 @@ + + + + SampleBrowser.Maui.Picker + 20.1.0.1 + Syncfusion Inc. + Syncfusion Inc. + true + http://www.syncfusion.com/nuget/license + http://www.syncfusion.com/ + http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png + Picker component for Syncfusion .NET MAUI + Copyright 2001 - 2019 Syncfusion Inc. + + \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/SampleBrowser.Maui.Picker.props b/MAUI/Picker/SampleBrowser.Maui.Picker/SampleBrowser.Maui.Picker.props new file mode 100644 index 00000000..5032a285 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/SampleBrowser.Maui.Picker.props @@ -0,0 +1,139 @@ + + + + + Samples\Picker\FlightBooking\FlightBooking.xaml.cs + FlightBooking.xaml + + + + Samples\DatePicker\Customization\View\Customization.xaml.cs + Customization.xaml + + + + Samples\DatePicker\GettingStarted\View\GettingStarted.xaml.cs + GettingStarted.xaml + + + + Samples\DatePicker\GettingStarted\Behavior\GettingStartedBehavior.cs + + + + Samples\DateTimePicker\GettingStarted\View\GettingStarted.xaml.cs + GettingStarted.xaml + + + + Samples\DateTimePicker\GettingStarted\Behavior\GettingStartedBehavior.cs + + + + Samples\Picker\GettingStarted\View\GettingStarted.xaml.cs + GettingStarted.xaml + + + + Samples\Picker\GettingStarted\Behavior\GettingStartedBehavior.cs + + + + Samples\Picker\GettingStarted\ViewModel.cs + + + + Samples\Picker\Customization\View\Customization.xaml.cs + Customization.xaml + + + + Samples\Picker\Customization\StringValueToColorConverter.cs + + + + Samples\TimePicker\GettingStarted\View\GettingStarted.xaml.cs + GettingStarted.xaml + + + + Samples\TimePicker\GettingStarted\Behavior\GettingStartedBehavior.cs + + + + Samples\TimePicker\Customization\View\Customization.xaml.cs + Customization.xaml + + + + Samples\TimePicker\Customization\AlarmViewModel.cs + + + + Samples\TimePicker\Customization\TimeSpanConverter.cs + + + + Samples\TimePicker\Customization\AlarmTimer.cs + + + + Samples\TimePicker\Customization\AlarmTimer.cs + + + + + + + PickerSamplesList.xml + + + + + + Samples\Picker\FlightBooking\FlightBooking.xaml + + + + + + Samples\DatePicker\GettingStarted\View\GettingStarted.xaml + + + + + + Samples\DateTimePicker\GettingStarted\View\GettingStarted.xaml + + + + + + Samples\Picker\GettingStarted\View\GettingStarted.xaml + + + + + + Samples\DatePicker\Customization\View\Customization.xaml + + + + + + Samples\Picker\Customization\View\Customization.xaml + + + + + + Samples\TimePicker\GettingStarted\View\GettingStarted.xaml + + + + + + Samples\TimePicker\Customization\View\Customization.xaml + + + \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DatePicker/Customization/View/Customization.xaml b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DatePicker/Customization/View/Customization.xaml new file mode 100644 index 00000000..fd002496 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DatePicker/Customization/View/Customization.xaml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DatePicker/Customization/View/Customization.xaml.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DatePicker/Customization/View/Customization.xaml.cs new file mode 100644 index 00000000..e144c946 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DatePicker/Customization/View/Customization.xaml.cs @@ -0,0 +1,272 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; +using Syncfusion.Maui.Popup; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Globalization; + +namespace SampleBrowser.Maui.Picker.SfDatePicker; + +public partial class Customization : SampleView +{ + private ToDoDetails? toDoDetails; + public Customization() + { + InitializeComponent(); + } + + private void OnTapGestureTapped(object sender, EventArgs e) + { + this.popup.Reset(); + this.popup.IsOpen = true; + } + + private void OnItemTapGestureTapped(object sender, EventArgs e) + { + if(sender is Grid grid && grid.BindingContext != null && grid.BindingContext is ToDoDetails details) + { + this.datePicker.SelectedDate = details.Date; + this.toDoDetails = details; + } + + this.datePicker.IsOpen = true; + } + + private void OnDatePickerOkButtonClicked(object sender, EventArgs e) + { + if (sender is Syncfusion.Maui.Picker.SfDatePicker picker && this.toDoDetails != null) + { + if (this.toDoDetails.Date.Date != picker.SelectedDate.Date) + { + this.toDoDetails.Date = picker.SelectedDate.Date; + } + + this.toDoDetails = null; + } + + this.datePicker.IsOpen = false; + } + + private void OnDatePickerClosed(object sender, EventArgs e) + { + this.toDoDetails = null; + } + + private void OnDatePickerCancelButtonClicked(object sender, EventArgs e) + { + if (sender is Syncfusion.Maui.Picker.SfDatePicker picker) + { + this.toDoDetails = null; + picker.IsOpen = false; + } + } + + private void OnPopupItemCreated(object sender, EventArgs e) + { + if(this.BindingContext != null && this.BindingContext is DatePickerCustomizationViewModel bindingContext && sender is ToDoDetails details) + { + bindingContext.DataSource.Add(details); + } + } +} + +public class DatePickerCustomizationViewModel : INotifyPropertyChanged +{ + private ObservableCollection dataSource; + + public ObservableCollection DataSource + { + get + { + return dataSource; + } + set + { + dataSource = value; + RaisePropertyChanged("DataSource"); + } + } + + private void RaisePropertyChanged(string propertyName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + public DatePickerCustomizationViewModel() + { + this.dataSource = new ObservableCollection() + { + new ToDoDetails() {Subject = "Get quote from travel agent", Date= DateTime.Now.Date}, + new ToDoDetails() {Subject = "Book flight ticket", Date= DateTime.Now.Date.AddDays(2)}, + new ToDoDetails() {Subject = "Buy travel guide book", Date= DateTime.Now.Date}, + new ToDoDetails() {Subject = "Register for sky diving", Date= DateTime.Now.Date.AddDays(8)}, + }; + } + + public event PropertyChangedEventHandler? PropertyChanged; +} + +public class ToDoDetails : INotifyPropertyChanged +{ + private string subject = string.Empty; + + public string Subject + { + get + { + return subject; + } + set + { + subject = value; + RaisePropertyChanged("Subject"); + } + } + + private DateTime date = DateTime.Now.Date; + + public DateTime Date + { + get + { + return date; + } + set + { + date = value; + this.DateString = date.Date == DateTime.Now.Date ? "Due today" : date.ToString("dd-MM-yyyy", CultureInfo.InvariantCulture); + RaisePropertyChanged("Date"); + } + } + + private string dateString = "Due today"; + + public string DateString + { + get + { + return dateString; + } + set + { + dateString = value; + RaisePropertyChanged("DateString"); + } + } + + private void RaisePropertyChanged(string propertyName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + public event PropertyChangedEventHandler? PropertyChanged; +} + +public class DateTimeToColorConverter : IValueConverter +{ + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value != null && value is DateTime date) + { + if (date.Date == DateTime.Now.Date) + { + return Color.FromArgb("#6750A4"); + } + else if (date.Date < DateTime.Now.Date) + { + return Color.FromArgb("#20000000"); + } + + return Color.FromArgb("#AA000000"); + } + + return Color.FromArgb("#AA000000"); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return string.Empty; + } +} + +public class CustomPopUp : SfPopup +{ + private Syncfusion.Maui.Picker.SfDatePicker picker; + Entry entry; + + public CustomPopUp() + { + this.picker = new Syncfusion.Maui.Picker.SfDatePicker(); + StackLayout stack = new StackLayout(); + Label label = new Label(); + label.Text = "Subject"; + label.Margin = new Thickness(10, 3); + label.FontSize = 12; + stack.Add(label); + this.entry = new Entry(); + this.entry.HeightRequest = 40; + this.entry.Placeholder = "No Title"; + this.entry.Margin = new Thickness(5, 0); + stack.Add(this.entry); + Label label1 = new Label(); + label1.Text = "Select the date"; + label1.FontSize = 12; + label1.Margin = new Thickness(10, 5, 0, 0); + stack.Add(label1); + this.picker.FooterView.Height = 40; + this.picker.HeightRequest = 280; + this.picker.OkButtonClicked += OnPickerOkButtonClicked; + this.picker.CancelButtonClicked += OnPickerCancelButtonClicked; + stack.Add(this.picker); + stack.VerticalOptions = LayoutOptions.Center; + this.ContentTemplate = new DataTemplate(() => + { + return stack; + }); + + this.HeaderTemplate = new DataTemplate(() => + { + return new Label() { Text = "Add a task", FontSize = 20, HeightRequest = 40, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center}; + }); + + this.HeightRequest = 410; + this.WidthRequest = 300; + this.ShowFooter = false; + this.ShowHeader = true; + this.HeaderHeight = 40; + this.PopupStyle.CornerRadius = new CornerRadius(5); + } + + private void OnPickerCancelButtonClicked(object? sender, EventArgs e) + { + this.Reset(); + this.IsOpen = false; + } + + private void OnPickerOkButtonClicked(object? sender, EventArgs e) + { + this.OnCreated?.Invoke(new ToDoDetails() { Date = this.picker.SelectedDate, Subject = this.entry.Text == string.Empty ? "No Title" : this.entry.Text}, new EventArgs()); + this.IsOpen = false; + } + + public void Reset() + { + if (this.picker != null) + { + this.picker.SelectedDate = DateTime.Now.Date; + } + + if (this.entry != null) + { + this.entry.Text = string.Empty; + } + } + + public event EventHandler? OnCreated; +} \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DatePicker/GettingStarted/Behavior/GettingStartedBehavior.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DatePicker/GettingStarted/Behavior/GettingStartedBehavior.cs new file mode 100644 index 00000000..d89ab9ad --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DatePicker/GettingStarted/Behavior/GettingStartedBehavior.cs @@ -0,0 +1,259 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.Picker.SfDatePicker +{ + using SampleBrowser.Maui.Base; + using Syncfusion.Maui.Inputs; + using Syncfusion.Maui.Picker; + using System.Collections.ObjectModel; + + public class GettingStartedBehavior : Behavior + { + /// + /// Picker view + /// + private SfDatePicker? datePicker; + + /// + /// The show header switch + /// + private Switch? showHeaderSwitch, showColumnHeaderSwitch, showFooterSwitch; + + /// + /// The date format combo box. + /// + private SfComboBox? formatComboBox; + + /// + /// The date format to set the combo box item source. + /// + private ObservableCollection? formats; + + /// + /// Begins when the behavior attached to the view + /// + /// bindable value + protected override void OnAttachedTo(SampleView sampleView) + { + base.OnAttachedTo(sampleView); + +#if IOS || MACCATALYST + Border border = sampleView.Content.FindByName("border"); + border.IsVisible = true; + border.Stroke = Color.FromArgb("#E6E6E6"); + this.datePicker = sampleView.Content.FindByName("DatePicker1"); +#else + Frame frame = sampleView.Content.FindByName("frame"); + frame.IsVisible = true; + frame.BorderColor = Color.FromArgb("#E6E6E6"); + this.datePicker = sampleView.Content.FindByName("DatePicker"); +#endif + + this.showHeaderSwitch = sampleView.Content.FindByName("showHeaderSwitch"); + this.showColumnHeaderSwitch = sampleView.Content.FindByName("showColumnHeaderSwitch"); + this.showFooterSwitch = sampleView.Content.FindByName("showFooterSwitch"); + + formats = new ObservableCollection() + { + "dd MM", "dd MM yyyy", "dd MMM yyyy", "M d yyyy", "MM dd yyyy", "MM yyyy", "MMM yyyy", "yyyy MM dd" + }; + + this.formatComboBox = sampleView.Content.FindByName("formatComboBox"); + this.formatComboBox.ItemsSource = formats; + this.formatComboBox.SelectedIndex = 1; + this.formatComboBox.SelectionChanged += FormatComboBox_SelectionChanged; + + if (this.showHeaderSwitch != null) + { + this.showHeaderSwitch.Toggled += ShowHeaderSwitch_Toggled; + } + + if (this.showColumnHeaderSwitch != null) + { + this.showColumnHeaderSwitch.Toggled += ShowColumnHeaderSwitch_Toggled; + } + + if (this.showFooterSwitch != null) + { + this.showFooterSwitch.Toggled += ShowFooterSwitch_Toggled; + } + } + + /// + /// Method for show header switch toggle changed. + /// + /// Return the object. + /// The Event Arguments. + private void ShowHeaderSwitch_Toggled(object? sender, ToggledEventArgs e) + { + if (this.datePicker != null) + { + if (e.Value == true) + { + this.datePicker.HeaderView = new PickerHeaderView() + { + Height = 50, + Text = "Select a Date", + Background = Color.FromArgb("#6750A4"), + TextStyle = new PickerTextStyle() + { + TextColor = Colors.White, + FontSize = 15, + }, + }; + } + else if (e.Value == false) + { + this.datePicker.HeaderView = new PickerHeaderView() + { + Height = 0, + }; + } + } + } + + /// + /// Method for show column header switch toggle changed. + /// + /// Return the object. + /// The Event Arguments. + private void ShowColumnHeaderSwitch_Toggled(object? sender, ToggledEventArgs e) + { + if (this.datePicker != null) + { + if (e.Value == true) + { + this.datePicker.ColumnHeaderView = new DatePickerColumnHeaderView() + { + Height = 40, + DayHeaderText = "Day", + MonthHeaderText = "Month", + YearHeaderText = "Year", + }; + } + if (e.Value == false) + { + this.datePicker.ColumnHeaderView = new DatePickerColumnHeaderView() + { + Height = 0, + }; + } + } + } + + /// + /// Method for show footer switch toggle changed. + /// + /// Return the object. + /// The Event Arguments. + private void ShowFooterSwitch_Toggled(object? sender, ToggledEventArgs e) + { + if (this.datePicker != null) + { + if (e.Value == true) + { + this.datePicker.FooterView = new PickerFooterView() + { + Height = 40, + TextStyle = new PickerTextStyle() + { + TextColor = Color.FromArgb("#6750A4"), + FontSize = 15, + }, + }; + } + else if (e.Value == false) + { + this.datePicker.FooterView = new PickerFooterView() + { + Height = 0, + }; + } + } + } + + /// + /// The format combo box selection changed event. + /// + /// Return the object. + /// The Event Arguments. + private void FormatComboBox_SelectionChanged(object? sender, SelectionChangedEventArgs e) + { + if (this.datePicker == null || e.CurrentSelection == null || formatComboBox == null) + { + return; + } + + string? format = e.CurrentSelection[0].ToString(); + switch (format) + { + case "dd MM": + this.datePicker.Format = PickerDateFormat.dd_MM; + break; + + case "dd MM yyyy": + this.datePicker.Format = PickerDateFormat.dd_MM_yyyy; + break; + + case "dd MMM yyyy": + this.datePicker.Format = PickerDateFormat.dd_MMM_yyyy; + break; + + case "M d yyyy": + this.datePicker.Format = PickerDateFormat.M_d_yyyy; + break; + + case "MM dd yyyy": + this.datePicker.Format = PickerDateFormat.MM_dd_yyyy; + break; + + case "MM yyyy": + this.datePicker.Format = PickerDateFormat.MM_yyyy; + break; + + case "MMM yyyy": + this.datePicker.Format = PickerDateFormat.MMM_yyyy; + break; + + case "yyyy MM dd": + this.datePicker.Format = PickerDateFormat.yyyy_MM_dd; + break; + } + } + + /// + /// Begins when the behavior attached to the view + /// + /// bindable value + protected override void OnDetachingFrom(SampleView sampleView) + { + base.OnDetachingFrom(sampleView); + if (this.showHeaderSwitch != null) + { + this.showHeaderSwitch.Toggled -= ShowHeaderSwitch_Toggled; + this.showHeaderSwitch = null; + } + + if (this.showColumnHeaderSwitch != null) + { + this.showColumnHeaderSwitch.Toggled -= ShowColumnHeaderSwitch_Toggled; + this.showColumnHeaderSwitch = null; + } + + if (this.showFooterSwitch != null) + { + this.showFooterSwitch.Toggled -= ShowFooterSwitch_Toggled; + this.showFooterSwitch = null; + } + } + + public GettingStartedBehavior() + { + } + } +} \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DatePicker/GettingStarted/View/GettingStarted.xaml b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DatePicker/GettingStarted/View/GettingStarted.xaml new file mode 100644 index 00000000..7891fd49 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DatePicker/GettingStarted/View/GettingStarted.xaml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DatePicker/GettingStarted/View/GettingStarted.xaml.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DatePicker/GettingStarted/View/GettingStarted.xaml.cs new file mode 100644 index 00000000..34304f66 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DatePicker/GettingStarted/View/GettingStarted.xaml.cs @@ -0,0 +1,18 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; + +namespace SampleBrowser.Maui.Picker.SfDatePicker; + +public partial class GettingStarted : SampleView +{ + public GettingStarted() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DateTimePicker/GettingStarted/Behavior/GettingStartedBehavior.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DateTimePicker/GettingStarted/Behavior/GettingStartedBehavior.cs new file mode 100644 index 00000000..5ae0be92 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DateTimePicker/GettingStarted/Behavior/GettingStartedBehavior.cs @@ -0,0 +1,294 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.Picker.SfDateTimePicker +{ + using SampleBrowser.Maui.Base; + using Syncfusion.Maui.Inputs; + using Syncfusion.Maui.Picker; + using System.Collections.ObjectModel; + + public class GettingStartedBehavior : Behavior + { + /// + /// Picker view + /// + private SfDateTimePicker? dateTimePicker; + + /// + /// The show header switch + /// + private Switch? showHeaderSwitch, showColumnHeaderSwitch, showFooterSwitch; + + /// + /// The date format combo box. + /// + private SfComboBox? dateFormatComboBox, timeFormatComboBox; + + /// + /// The date format to set the combo box item source. + /// + private ObservableCollection? dateFormat; + + /// + /// The time format to set the combo box item source. + /// + private ObservableCollection? timeFormat; + + + /// + /// Begins when the behavior attached to the view + /// + /// bindable value + protected override void OnAttachedTo(SampleView sampleView) + { + base.OnAttachedTo(sampleView); + +#if IOS || MACCATALYST + Border border = sampleView.Content.FindByName("border"); + border.IsVisible = true; + border.Stroke = Color.FromArgb("#E6E6E6"); + this.dateTimePicker = sampleView.Content.FindByName("DateTimePicker1"); +#else + Frame frame = sampleView.Content.FindByName("frame"); + frame.IsVisible = true; + frame.BorderColor = Color.FromArgb("#E6E6E6"); + this.dateTimePicker = sampleView.Content.FindByName("DateTimePicker"); +#endif + + this.showHeaderSwitch = sampleView.Content.FindByName("showHeaderSwitch"); + this.showColumnHeaderSwitch = sampleView.Content.FindByName("showColumnHeaderSwitch"); + this.showFooterSwitch = sampleView.Content.FindByName("showFooterSwitch"); + + dateFormat = new ObservableCollection() + { + "dd MM", "dd MM yyyy", "dd MMM yyyy", "M d yyyy", "MM dd yyyy", "MM yyyy", "MMM yyyy", "yyyy MM dd" + }; + + timeFormat = new ObservableCollection() + { + "H mm", "H mm ss", "h mm ss tt", "h mm tt", "HH mm", "HH mm ss", "hh mm ss tt", "hh mm tt", "hh tt" + }; + + this.dateFormatComboBox = sampleView.Content.FindByName("dateFormatComboBox"); + this.dateFormatComboBox.ItemsSource = dateFormat; + this.dateFormatComboBox.SelectedIndex = 1; + this.dateFormatComboBox.SelectionChanged += DateFormatComboBox_SelectionChanged; + + this.timeFormatComboBox = sampleView.Content.FindByName("timeFormatComboBox"); + this.timeFormatComboBox.ItemsSource = timeFormat; + this.timeFormatComboBox.SelectedIndex = 1; + this.timeFormatComboBox.SelectionChanged += TimeFormatComboBox_SelectionChanged; + + if (this.showHeaderSwitch != null) + { + this.showHeaderSwitch.Toggled += ShowHeaderSwitch_Toggled; + } + + if (this.showColumnHeaderSwitch != null) + { + this.showColumnHeaderSwitch.Toggled += ShowColumnHeaderSwitch_Toggled; + } + + if (this.showFooterSwitch != null) + { + this.showFooterSwitch.Toggled += ShowFooterSwitch_Toggled; + } + } + + /// + /// Method for show header switch toggle changed. + /// + /// Return the object. + /// The Event Arguments. + private void ShowHeaderSwitch_Toggled(object? sender, ToggledEventArgs e) + { + if (this.dateTimePicker != null) + { + this.dateTimePicker.HeaderView.Height = e.Value == true ? 50 : 0; + } + } + + /// + /// Method for show column header switch toggle changed. + /// + /// Return the object. + /// The Event Arguments. + private void ShowColumnHeaderSwitch_Toggled(object? sender, ToggledEventArgs e) + { + if (this.dateTimePicker != null) + { + this.dateTimePicker.ColumnHeaderView.Height = e.Value == true ? 40 : 0; + } + } + + /// + /// Method for show footer switch toggle changed. + /// + /// Return the object. + /// The Event Arguments. + private void ShowFooterSwitch_Toggled(object? sender, ToggledEventArgs e) + { + if (this.dateTimePicker != null) + { + if (e.Value == true) + { + this.dateTimePicker.FooterView = new PickerFooterView() + { + Height = 40, + TextStyle = new PickerTextStyle() + { + TextColor = Color.FromArgb("#6750A4"), + FontSize = 15, + }, + }; + } + else if (e.Value == false) + { + this.dateTimePicker.FooterView = new PickerFooterView() + { + Height = 0, + }; + } + } + } + + /// + /// The format combo box selection changed event. + /// + /// Return the object. + /// The Event Arguments. + private void DateFormatComboBox_SelectionChanged(object? sender, SelectionChangedEventArgs e) + { + if (this.dateTimePicker == null || e.CurrentSelection == null || dateFormatComboBox == null) + { + return; + } + + string? format = e.CurrentSelection[0].ToString(); + switch (format) + { + case "dd MM": + this.dateTimePicker.DateFormat = PickerDateFormat.dd_MM; + break; + + case "dd MM yyyy": + this.dateTimePicker.DateFormat = PickerDateFormat.dd_MM_yyyy; + break; + + case "dd MMM yyyy": + this.dateTimePicker.DateFormat = PickerDateFormat.dd_MMM_yyyy; + break; + + case "M d yyyy": + this.dateTimePicker.DateFormat = PickerDateFormat.M_d_yyyy; + break; + + case "MM dd yyyy": + this.dateTimePicker.DateFormat = PickerDateFormat.MM_dd_yyyy; + break; + + case "MM yyyy": + this.dateTimePicker.DateFormat = PickerDateFormat.MM_yyyy; + break; + + case "MMM yyyy": + this.dateTimePicker.DateFormat = PickerDateFormat.MMM_yyyy; + break; + + case "yyyy MM dd": + this.dateTimePicker.DateFormat = PickerDateFormat.yyyy_MM_dd; + break; + } + + } + + /// + /// The format combo box selection changed event. + /// + /// Return the object. + /// The Event Arguments. + private void TimeFormatComboBox_SelectionChanged(object? sender, SelectionChangedEventArgs e) + { + if (this.dateTimePicker == null || e.CurrentSelection == null || timeFormatComboBox == null) + { + return; + } + + string? format = e.CurrentSelection[0].ToString(); + + switch (format) + { + case "H mm": + this.dateTimePicker.TimeFormat = PickerTimeFormat.H_mm; + break; + + case "H mm ss": + this.dateTimePicker.TimeFormat = PickerTimeFormat.H_mm_ss; + break; + + case "h mm ss tt": + this.dateTimePicker.TimeFormat = PickerTimeFormat.h_mm_ss_tt; + break; + + case "h mm tt": + this.dateTimePicker.TimeFormat = PickerTimeFormat.h_mm_tt; + break; + + case "HH mm": + this.dateTimePicker.TimeFormat = PickerTimeFormat.HH_mm; + break; + + case "HH mm ss": + this.dateTimePicker.TimeFormat = PickerTimeFormat.HH_mm_ss; + break; + + case "hh mm ss tt": + this.dateTimePicker.TimeFormat = PickerTimeFormat.hh_mm_ss_tt; + break; + + case "hh mm tt": + this.dateTimePicker.TimeFormat = PickerTimeFormat.hh_mm_tt; + break; + + case "hh tt": + this.dateTimePicker.TimeFormat = PickerTimeFormat.hh_tt; + break; + } + } + + /// + /// Begins when the behavior attached to the view + /// + /// bindable value + protected override void OnDetachingFrom(SampleView sampleView) + { + base.OnDetachingFrom(sampleView); + if (this.showHeaderSwitch != null) + { + this.showHeaderSwitch.Toggled -= ShowHeaderSwitch_Toggled; + this.showHeaderSwitch = null; + } + + if (this.showColumnHeaderSwitch != null) + { + this.showColumnHeaderSwitch.Toggled -= ShowColumnHeaderSwitch_Toggled; + this.showColumnHeaderSwitch = null; + } + + if (this.showFooterSwitch != null) + { + this.showFooterSwitch.Toggled -= ShowFooterSwitch_Toggled; + this.showFooterSwitch = null; + } + } + + public GettingStartedBehavior() + { + } + } +} \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DateTimePicker/GettingStarted/View/GettingStarted.xaml b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DateTimePicker/GettingStarted/View/GettingStarted.xaml new file mode 100644 index 00000000..47dd4aa3 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DateTimePicker/GettingStarted/View/GettingStarted.xaml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DateTimePicker/GettingStarted/View/GettingStarted.xaml.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DateTimePicker/GettingStarted/View/GettingStarted.xaml.cs new file mode 100644 index 00000000..acd1a59c --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/DateTimePicker/GettingStarted/View/GettingStarted.xaml.cs @@ -0,0 +1,18 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; + +namespace SampleBrowser.Maui.Picker.SfDateTimePicker; + +public partial class GettingStarted : SampleView +{ + public GettingStarted() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/Customization/StringValueToColorConverter.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/Customization/StringValueToColorConverter.cs new file mode 100644 index 00000000..ed7d8622 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/Customization/StringValueToColorConverter.cs @@ -0,0 +1,62 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using System.Globalization; + +namespace SampleBrowser.Maui.Picker.SfPicker; + +public class StringValueToColorConverter : IValueConverter +{ + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + string colorName = (string)value; + Color color = Colors.Transparent; + switch (colorName) + { + case "Pink": + color = Colors.Pink; + break; + case "Green": + color = Colors.Green; + break; + case "Blue": + color = Colors.Blue; + break; + case "Yellow": + color = Colors.Yellow; + break; + case "Orange": + color = Colors.Orange; + break; + case "Purple": + color = Colors.Purple; + break; + case "SkyBlue": + color = Colors.SkyBlue; + break; + case "PaleGreen": + color = Colors.PaleGreen; + break; + case "Gray": + color = Colors.Gray; + break; + case "LiteGreen": + color = Colors.LightGreen; + break; + case "Brown": + color = Colors.Brown; + break; + } + + return color; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return string.Empty; + } +} diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/Customization/View/Customization.xaml b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/Customization/View/Customization.xaml new file mode 100644 index 00000000..d06785d2 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/Customization/View/Customization.xaml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/Customization/View/Customization.xaml.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/Customization/View/Customization.xaml.cs new file mode 100644 index 00000000..181e7570 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/Customization/View/Customization.xaml.cs @@ -0,0 +1,18 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; + +namespace SampleBrowser.Maui.Picker.SfPicker; + +public partial class Customization : SampleView +{ + public Customization() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/FlightBooking/FlightBooking.xaml b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/FlightBooking/FlightBooking.xaml new file mode 100644 index 00000000..827d12c1 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/FlightBooking/FlightBooking.xaml @@ -0,0 +1,327 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/FlightBooking/FlightBooking.xaml.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/FlightBooking/FlightBooking.xaml.cs new file mode 100644 index 00000000..4afb0f1e --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/FlightBooking/FlightBooking.xaml.cs @@ -0,0 +1,447 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.Picker.SfPicker +{ + using SampleBrowser.Maui.Base; + using System.Globalization; + + /// + /// The Flight booking sample. + /// + public partial class FlightBooking : SampleView + { + private DateTime from; + + private DateTime to; + + private List fromList; + + private List toList; + + private static List countries = new List() { "UK", "USA", "India", "UAE", "Germany" }; + + private static List ukCities = new List() { "London", "Manchester", "Cambridge", "Edinburgh", "Glasgow", "Birmingham" }; + + private static List usaCities = new List() { "New York", "Seattle", "Washington", "Chicago", "Boston", "Los Angles" }; + + private static List indiaCities = new List() { "Mumbai", "Bengaluru", "Chennai", "Pune", "Jaipur", "Delhi" }; + + private static List uaeCities = new List() { "Dubai", "Abu Dhabi", "Fujairah", "Sharjah", "Ajman", "AL Ain" }; + + private static List germanyCities = new List() { "Berlin", "Munich", "Frankfurt", "Hamburg", "Cologne", "Bonn" }; + + public FlightBooking() + { + InitializeComponent(); + + from = DateTime.Now.Date; + to = DateTime.Now.Date; + fromList = new List() { "India", "Chennai" }; + toList = new List() { "USA", "Boston" }; + Syncfusion.Maui.Picker.PickerColumn countyColumn = new Syncfusion.Maui.Picker.PickerColumn() { HeaderText = "Country", SelectedIndex = 2, ItemsSource = countries, Width = 150 }; + Syncfusion.Maui.Picker.PickerColumn countyColumn1 = new Syncfusion.Maui.Picker.PickerColumn() { HeaderText = "Country", SelectedIndex = 1, ItemsSource = countries, Width = 150 }; + Syncfusion.Maui.Picker.PickerColumn cityColumn = new Syncfusion.Maui.Picker.PickerColumn() { HeaderText = "City", SelectedIndex = 2, ItemsSource = indiaCities, Width = 150 }; + Syncfusion.Maui.Picker.PickerColumn cityColumn1 = new Syncfusion.Maui.Picker.PickerColumn() { HeaderText = "City", SelectedIndex = 4, ItemsSource = usaCities, Width = 150 }; + //// To initialize the picker based on the platform. +#if ANDROID || IOS + mobileFromPicker.Columns = new System.Collections.ObjectModel.ObservableCollection() { countyColumn, cityColumn }; + mobileToPicker.Columns = new System.Collections.ObjectModel.ObservableCollection() { countyColumn1, cityColumn1 }; + this.InitializePicker(this.mobileGrid); +#else + fromPicker.Columns = new System.Collections.ObjectModel.ObservableCollection() { countyColumn, cityColumn }; + toPicker.Columns = new System.Collections.ObjectModel.ObservableCollection() { countyColumn1, cityColumn1 }; + this.InitializePicker(this.grid); +#endif + string str = DateTime.Now.Day.ToString(); + string fromString= str + " " + CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(DateTime.Now.Month).ToString() + "," + " " + DateTime.Now.Year.ToString(); + +#if ANDROID || IOS + + mobileDepartureDatePicker.OkButtonClicked += DepartureDatePicker_OkButtonClicked; + mobileReturnDatePicker.OkButtonClicked += ReturnDatePicker_OkButtonClicked; + + mobileDepartureDatePicker.CancelButtonClicked += DepartureDatePicker_CancelButtonClicked; + mobileReturnDatePicker.CancelButtonClicked += ReturnDatePicker_CancelButtonClicked; + + mobileDepartureDatePicker.Opened += DepartureDatePicker_OnPopUpOpened; + mobileReturnDatePicker.Opened += ReturnDatePicker_OnPopUpOpened; + + mobileDepartureDateLabel.Text = fromString; + mobileReturnDateLabel.Text = fromString; + mobileReturnDatePicker.MinimumDate = mobileReturnDatePicker.SelectedDate.Date; +#else + departureDatePicker.OkButtonClicked += DepartureDatePicker_OkButtonClicked; + returnDatePicker.OkButtonClicked += ReturnDatePicker_OkButtonClicked; + + departureDatePicker.CancelButtonClicked += DepartureDatePicker_CancelButtonClicked; + returnDatePicker.CancelButtonClicked += ReturnDatePicker_CancelButtonClicked; + + departureDatePicker.Opened += DepartureDatePicker_OnPopUpOpened; + returnDatePicker.Opened += ReturnDatePicker_OnPopUpOpened; + + departureDateLabel.Text = fromString; + returnDateLabel.Text = fromString; + returnDatePicker.MinimumDate = returnDatePicker.SelectedDate.Date; +#endif + } + + /// + /// Method to initialize the picker based on the platform. + /// + /// The parent grid. + private void InitializePicker(Grid parent) + { + parent.IsVisible = true; + } + + /// + /// Method to handle the PopUpOpened event of the departure date picker. + /// + /// The sender object. + /// The event args. + private void DepartureDatePicker_OnPopUpOpened(object? sender, EventArgs e) + { +#if ANDROID || IOS + mobileDepartureDatePicker.IsOpen = true; + mobileDepartureDatePicker.SelectedDate = from; +#else + departureDatePicker.IsOpen = true; + departureDatePicker.SelectedDate = from; +#endif + } + + /// + /// Method to handle the PopUpOpened event of the return date picker. + /// + /// The sender object. + /// The event args. + private void ReturnDatePicker_OnPopUpOpened(object? sender, EventArgs e) + { +#if ANDROID || IOS + mobileReturnDatePicker.IsOpen = true; + mobileReturnDatePicker.MinimumDate = from; + mobileReturnDatePicker.SelectedDate = to; +#else + returnDatePicker.IsOpen = true; + returnDatePicker.MinimumDate = from; + returnDatePicker.SelectedDate = to; +#endif + } + + /// + /// Method to handle the ok button clicked event of the departure date picker. + /// + /// The sender object. + /// The event args. + private void DepartureDatePicker_OkButtonClicked(object? sender, EventArgs e) + { +#if ANDROID || IOS + from = mobileDepartureDatePicker.SelectedDate.Date; + mobileDepartureDateLabel.Text = from.Day.ToString() + " " + CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(from.Month).ToString() + "," + " " + from.Year.ToString(); + if (from.Date > to.Date) + { + to = from; + mobileReturnDateLabel.Text = to.Day.ToString() + " " + CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(to.Month).ToString() + "," + " " + to.Year.ToString(); + } + + mobileDepartureDatePicker.IsOpen = false; +#else + from = departureDatePicker.SelectedDate.Date; + departureDateLabel.Text = from.Day.ToString() + " " + CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(from.Month).ToString() + "," + " " + from.Year.ToString(); + if (from.Date > to.Date) + { + to = from; + returnDateLabel.Text = to.Day.ToString() + " " + CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(to.Month).ToString() + "," + " " + to.Year.ToString(); + } + + departureDatePicker.IsOpen = false; +#endif + } + + /// + /// Method to handle the ok button clicked event of the return date picker. + /// + /// The sender object. + /// The event args. + private void ReturnDatePicker_OkButtonClicked(object? sender, EventArgs e) + { +#if ANDROID || IOS + to = mobileReturnDatePicker.SelectedDate.Date; + mobileReturnDateLabel.Text = to.Day.ToString() + " " + CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(to.Month).ToString() + "," + " " + to.Year.ToString(); + mobileReturnDatePicker.IsOpen = false; +#else + to = returnDatePicker.SelectedDate.Date; + returnDateLabel.Text = to.Day.ToString() + " " + CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(to.Month).ToString() + "," + " " + to.Year.ToString(); + returnDatePicker.IsOpen = false; +#endif + } + + /// + /// Method to handle the Cancel button clicked event of the departure date picker. + /// + /// The sender object. + /// The event args. + private void DepartureDatePicker_CancelButtonClicked(object? sender, EventArgs e) + { +#if ANDROID || IOS + mobileDepartureDatePicker.IsOpen = false; +#else + departureDatePicker.IsOpen = false; +#endif + } + + /// + /// Method to handle the Cancel button clicked event of the return date picker. + /// + /// The sender object. + /// The event args. + private void ReturnDatePicker_CancelButtonClicked(object? sender, EventArgs e) + { +#if ANDROID || IOS + mobileReturnDatePicker.IsOpen = false; +#else + returnDatePicker.IsOpen = false; +#endif + } + + private void TapGestureRecognizer_Tapped(System.Object sender, System.EventArgs e) + { +#if ANDROID || IOS + mobileFromPicker.IsOpen = true; + if (mobileFromPicker.Columns[0].ItemsSource is List country) + { + int selectedIndex = country.IndexOf(fromList[0]); + List cities = this.GetCityList(countries[selectedIndex]); + int citySelectedIndex = cities.IndexOf(fromList[1]); + Syncfusion.Maui.Picker.PickerColumn cityColumn = new Syncfusion.Maui.Picker.PickerColumn() { HeaderText = "City", SelectedIndex = citySelectedIndex, ItemsSource = cities, Width = 150 }; + if (mobileFromPicker.Columns[1].ItemsSource != cities) + { + mobileFromPicker.Columns[1] = cityColumn; + } + else + { + mobileFromPicker.Columns[1].SelectedIndex = citySelectedIndex; + } + + mobileFromPicker.Columns[0].SelectedIndex = selectedIndex; + } + +#else + fromPicker.IsOpen = true; + if (fromPicker.Columns[0].ItemsSource is List country) + { + int selectedIndex = country.IndexOf(fromList[0]); + List cities = this.GetCityList(countries[selectedIndex]); + int citySelectedIndex = cities.IndexOf(fromList[1]); + Syncfusion.Maui.Picker.PickerColumn cityColumn = new Syncfusion.Maui.Picker.PickerColumn() { HeaderText = "City", SelectedIndex = citySelectedIndex, ItemsSource = cities, Width = 150 }; + if (fromPicker.Columns[1].ItemsSource != cities) + { + fromPicker.Columns[1] = cityColumn; + } + else + { + fromPicker.Columns[1].SelectedIndex = citySelectedIndex; + } + + fromPicker.Columns[0].SelectedIndex = selectedIndex; + } +#endif + } + + void TapGestureRecognizer_Tapped_1(System.Object sender, System.EventArgs e) + { +#if ANDROID || IOS + mobileToPicker.IsOpen = true; + if (mobileToPicker.Columns[0].ItemsSource is List country) + { + int selectedIndex = country.IndexOf(toList[0]); + List cities = this.GetCityList(countries[selectedIndex]); + int citySelectedIndex = cities.IndexOf(toList[1]); + Syncfusion.Maui.Picker.PickerColumn cityColumn = new Syncfusion.Maui.Picker.PickerColumn() { HeaderText = "City", SelectedIndex = citySelectedIndex, ItemsSource = cities, Width = 150 }; + if (mobileToPicker.Columns[1].ItemsSource != cities) + { + mobileToPicker.Columns[1] = cityColumn; + } + else + { + mobileToPicker.Columns[1].SelectedIndex = citySelectedIndex; + } + + mobileToPicker.Columns[0].SelectedIndex = selectedIndex; + } +#else + toPicker.IsOpen = true; + if (toPicker.Columns[0].ItemsSource is List country) + { + int selectedIndex = country.IndexOf(toList[0]); + List cities = this.GetCityList(countries[selectedIndex]); + int citySelectedIndex = cities.IndexOf(toList[1]); + Syncfusion.Maui.Picker.PickerColumn cityColumn = new Syncfusion.Maui.Picker.PickerColumn() { HeaderText = "City", SelectedIndex = citySelectedIndex, ItemsSource = cities, Width = 150 }; + if (toPicker.Columns[1].ItemsSource != cities) + { + toPicker.Columns[1] = cityColumn; + } + else + { + toPicker.Columns[1].SelectedIndex = citySelectedIndex; + } + + toPicker.Columns[0].SelectedIndex = selectedIndex; + } +#endif + } + + private void FromPicker_SelectionChanged(System.Object sender, Syncfusion.Maui.Picker.PickerSelectionChangedEventArgs e) + { + if (e.ColumnIndex == 1) + { + return; + } + + string country = countries[e.NewValue]; + List cities = this.GetCityList(country); + Syncfusion.Maui.Picker.PickerColumn cityColumn = new Syncfusion.Maui.Picker.PickerColumn() { HeaderText = "City", SelectedIndex = 0, ItemsSource = cities, Width = 150 }; + +#if ANDROID || IOS + if (mobileFromPicker.Columns[1].ItemsSource != cities) + { + mobileFromPicker.Columns[1] = cityColumn; + } +#else + if (fromPicker.Columns[1].ItemsSource != cities) + { + fromPicker.Columns[1] = cityColumn; + } +#endif + } + + private void ToPicker_SelectionChanged(System.Object sender, Syncfusion.Maui.Picker.PickerSelectionChangedEventArgs e) + { + if (e.ColumnIndex == 1) + { + return; + } + + string country = countries[e.NewValue]; + List cities = this.GetCityList(country); + Syncfusion.Maui.Picker.PickerColumn cityColumn = new Syncfusion.Maui.Picker.PickerColumn() { HeaderText = "City", SelectedIndex = 0, ItemsSource = cities, Width = 150 }; + +#if ANDROID || IOS + if (mobileToPicker.Columns[1].ItemsSource != cities) + { + mobileToPicker.Columns[1] = cityColumn; + } +#else + if (toPicker.Columns[1].ItemsSource != cities) + { + toPicker.Columns[1] = cityColumn; + } +#endif + } + + private void FromPicker_CancelButtonClicked(System.Object sender, System.EventArgs e) + { +#if ANDROID || IOS + mobileFromPicker.IsOpen = false; +#else + fromPicker.IsOpen = false; +#endif + } + + private void ToPicker_CancelButtonClicked(System.Object sender, System.EventArgs e) + { +#if ANDROID || IOS + mobileToPicker.IsOpen = false; +#else + toPicker.IsOpen = false; +#endif + } + + private void FromPicker_OkButtonClicked(System.Object sender, System.EventArgs e) + { + if (sender is Syncfusion.Maui.Picker.SfPicker picker) + { + int countryColumnIndex = picker.Columns[0].SelectedIndex; + int cityColumnIndex = picker.Columns[1].SelectedIndex; + string country = countries[countryColumnIndex]; + List cities = this.GetCityList(country); + string city = cities[cityColumnIndex]; + fromList = new List() { country, city }; +#if ANDROID || IOS + mobileFromLabel.Text = $"{city}, {country}"; + mobileFromPicker.IsOpen = false; +#else + fromLabel.Text = $"{city}, {country}"; + fromPicker.IsOpen = false; +#endif + } + } + + private void ToPicker_OkButtonClicked(System.Object sender, System.EventArgs e) + { + if (sender is Syncfusion.Maui.Picker.SfPicker picker) + { + int countryColumnIndex = picker.Columns[0].SelectedIndex; + int cityColumnIndex = picker.Columns[1].SelectedIndex; + string country = countries[countryColumnIndex]; + List cities = this.GetCityList(country); + string city = cities[cityColumnIndex]; + toList = new List() { country, city }; +#if ANDROID || IOS + mobileToLabel.Text = $"{city}, {country}"; + mobileToPicker.IsOpen = false; +#else + toLabel.Text = $"{city}, {country}"; + toPicker.IsOpen = false; +#endif + } + } + + private List GetCityList(string country) + { + if (country == "UK") + { + return ukCities; + } + else if (country == "USA") + { + return usaCities; + } + else if (country == "India") + { + return indiaCities; + } + else if (country == "UAE") + { + return uaeCities; + } + else if (country == "Germany") + { + return germanyCities; + } + + return new List(); + } + + /// + /// Method to handle the search button clicked event. + /// + /// The sender object. + /// The event args. + private void SearchButton_Clicked(object sender, EventArgs e) + { + Random randomNumber = new Random(); + int index = randomNumber.Next(0, 50); +#if ANDROID || IOS + Application.Current?.MainPage?.DisplayAlert("Results", "\n" + index + " Flights are available on that dates to depart from " + mobileFromLabel.Text.ToString(), "OK"); +#else + Application.Current?.MainPage?.DisplayAlert("Results", "\n" + index + " Flights are available on that dates to depart from " + fromLabel.Text.ToString(), "OK"); +#endif + } + } +} \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/GettingStarted/Behavior/GettingStartedBehavior.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/GettingStarted/Behavior/GettingStartedBehavior.cs new file mode 100644 index 00000000..648dedfc --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/GettingStarted/Behavior/GettingStartedBehavior.cs @@ -0,0 +1,170 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.Picker.SfPicker +{ + using SampleBrowser.Maui.Base; + using Syncfusion.Maui.Picker; + + public class GettingStartedBehavior : Behavior + { + /// + /// Picker view. + /// + private SfPicker? picker; + + /// + /// The show header switch + /// + private Switch? showHeaderSwitch, showFooterSwitch; + + /// + /// Begins when the behavior attached to the view + /// + /// bindable value + protected override void OnAttachedTo(SampleView sampleView) + { + base.OnAttachedTo(sampleView); + +#if IOS || MACCATALYST + Border border = sampleView.Content.FindByName("border"); + border.IsVisible = true; + border.Stroke = Color.FromArgb("#E6E6E6"); + this.picker = sampleView.Content.FindByName("Picker1"); +#else + Frame frame = sampleView.Content.FindByName("frame"); + frame.IsVisible = true; + frame.BorderColor = Color.FromArgb("#E6E6E6"); + this.picker = sampleView.Content.FindByName("Picker"); +#endif + + this.picker.TextStyle = new PickerTextStyle() + { + TextColor = Color.FromRgba(0, 0, 0, 128), + }; + + this.picker.SelectedTextStyle = new PickerTextStyle() + { + TextColor = Colors.Black, + }; + + this.showHeaderSwitch = sampleView.Content.FindByName("showHeaderSwitch"); + this.showFooterSwitch = sampleView.Content.FindByName("showFooterSwitch"); + + if (this.showHeaderSwitch != null) + { + this.showHeaderSwitch.Toggled += ShowHeaderSwitch_Toggled; + } + + if (this.showFooterSwitch != null) + { + this.showFooterSwitch.Toggled += ShowFooterSwitch_Toggled; + } + } + + /// + /// Method for show header switch toggle changed. + /// + /// Return the object. + /// The Event Arguments. + private void ShowHeaderSwitch_Toggled(object? sender, ToggledEventArgs e) + { + if (this.picker != null) + { + if (e.Value == true) + { + this.picker.HeaderView = new PickerHeaderView() + { + Height = 50, + Text = "Select a Country", + Background = Color.FromArgb("#6750A4"), + TextStyle = new PickerTextStyle() + { + TextColor = Colors.White, + FontSize = 15, + }, + }; + } + else if (e.Value == false) + { + this.picker.HeaderView = new PickerHeaderView() + { + Height = 0, + }; + } + } + } + + /// + /// Method for show column header switch toggle changed. + /// + /// Return the object. + /// The Event Arguments. + private void ShowColumnHeaderSwitch_Toggled(object? sender, ToggledEventArgs e) + { + if (this.picker != null) + { + this.picker.ColumnHeaderView.Height = e.Value == true ? 40 : 0; + } + } + + /// + /// Method for show footer switch toggle changed. + /// + /// Return the object. + /// The Event Arguments. + private void ShowFooterSwitch_Toggled(object? sender, ToggledEventArgs e) + { + if (this.picker != null) + { + if (e.Value == true) + { + this.picker.FooterView = new PickerFooterView() + { + Height = 40, + TextStyle = new PickerTextStyle() + { + TextColor = Color.FromArgb("#6750A4"), + FontSize = 15, + }, + }; + } + else if (e.Value == false) + { + this.picker.FooterView = new PickerFooterView() + { + Height = 0, + }; + } + } + } + + /// + /// Begins when the behavior attached to the view + /// + /// bindable value + protected override void OnDetachingFrom(SampleView sampleView) + { + base.OnDetachingFrom(sampleView); + if (this.showHeaderSwitch != null) + { + this.showHeaderSwitch.Toggled -= ShowHeaderSwitch_Toggled; + this.showHeaderSwitch = null; + } + + if (this.showFooterSwitch != null) + { + this.showFooterSwitch.Toggled -= ShowFooterSwitch_Toggled; + this.showFooterSwitch = null; + } + } + + public GettingStartedBehavior() + { + } + } +} \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/GettingStarted/View/GettingStarted.xaml b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/GettingStarted/View/GettingStarted.xaml new file mode 100644 index 00000000..d8cde594 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/GettingStarted/View/GettingStarted.xaml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/GettingStarted/View/GettingStarted.xaml.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/GettingStarted/View/GettingStarted.xaml.cs new file mode 100644 index 00000000..fc008684 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/GettingStarted/View/GettingStarted.xaml.cs @@ -0,0 +1,177 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; +using Syncfusion.Maui.Picker; + +namespace SampleBrowser.Maui.Picker.SfPicker; + +public partial class GettingStarted : SampleView +{ + public GettingStarted() + { + InitializeComponent(); +#if IOS || MACCATALYST +this.Picker1.SelectedTextStyle = new PickerTextStyle() + { + TextColor = Colors.White, + }; + this.Picker1.Columns.Add(new PickerColumn() + { + ItemsSource = new List() + { + "Australia", + "China", + "Japan", + "Germany", + "India", + "USA", + "France", + "UK", + "UAE", + "Egypt", + "Argentina", + }, + }); +#else + this.Picker.SelectedTextStyle = new PickerTextStyle() + { + TextColor = Colors.White, + }; + this.Picker.Columns.Add(new PickerColumn() + { + ItemsSource = new List() + { + "Australia", + "China", + "Japan", + "Germany", + "India", + "USA", + "France", + "UK", + "UAE", + "Egypt", + "Argentina", + }, + }); +#endif + } + + /// + /// Method to update the change log based on the selected index. + /// + /// The Sender. + /// The event args. + private void OnPickerSelectionChanged(object sender, PickerSelectionChangedEventArgs e) + { + Syncfusion.Maui.Picker.SfPicker? picker = sender as Syncfusion.Maui.Picker.SfPicker; + if (picker == null || picker.Columns == null || picker.Columns.Count == 0) + { + return; + } + +#if IOS || MACCATALYST + if (picker == this.Picker) + { + return; + } +#else + if (picker == this.Picker1) + { + return; + } +#endif + + PickerColumn selectedColumn = picker.Columns[0]; + string selectedIndex = selectedColumn.SelectedIndex.ToString(); + string countryName = "Australia"; + + switch (selectedIndex) + { + case "0": + countryName = "Australia"; + break; + case "1": + countryName = "China"; + break; + case "2": + countryName = "Japan"; + break; + case "3": + countryName = "Germany"; + break; + case "4": + countryName = "India"; + break; + case "5": + countryName = "USA"; + break; + case "6": + countryName = "France"; + break; + case "7": + countryName = "UK"; + break; + case "8": + countryName = "UAE"; + break; + case "9": + countryName = "Egypt"; + break; + case "10": + countryName = "Argentina"; + break; + } + + if (labelStack == null) + { + return; + } + + string labelText = countryName + " has been selected"; + bool isNeedToAdd = true; + if (labelStack.Children.Count > 0) + { + var view = labelStack.Children[labelStack.Children.Count - 1]; + if (view is Label label && label.Text == labelText) + { + isNeedToAdd = false; + } + } + + if (!isNeedToAdd) + { + return; + } + + labelStack.Add(new Label() + { + Text = labelText, + VerticalOptions = LayoutOptions.Center, + }); + + if (labelStack.Parent is ScrollView scrollView) + { + scrollView.PropertyChanged += OnScrollViewPropertyChanged; + } + } + + private void OnScrollViewPropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e) + { + if (e.PropertyName == nameof(ScrollView.ContentSize) && sender is ScrollView scrollView) + { + scrollView.PropertyChanged -= OnScrollViewPropertyChanged; + scrollView.ScrollToAsync(0, scrollView.ContentSize.Height - scrollView.Height, false); + } + } + + private void OnClearButtonClicked(object sender, EventArgs e) + { + labelStack.Children.Clear(); + } +} \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/GettingStarted/ViewModel.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/GettingStarted/ViewModel.cs new file mode 100644 index 00000000..f8429284 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/Picker/GettingStarted/ViewModel.cs @@ -0,0 +1,59 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using System.Collections.ObjectModel; +using System.ComponentModel; + +namespace SampleBrowser.Maui.Picker.SfPicker +{ + public class ViewModel : INotifyPropertyChanged + { + private ObservableCollection dataSource = new ObservableCollection() + { + "Pink", "Green", "Blue", "Yellow", "Orange", "Purple", "SkyBlue", "PaleGreen", "Gray", "LiteGreen", "Brown" + }; + + private Brush selectionColor = Colors.Orange; + + public ObservableCollection DataSource + { + get + { + return dataSource; + } + set + { + dataSource = value; + RaisePropertyChanged("DataSource"); + } + } + + public Brush SelectionColor + { + get + { + return selectionColor; + } + set + { + selectionColor = value; + RaisePropertyChanged("SelectionColor"); + } + } + + private void RaisePropertyChanged(string propertyName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + public ViewModel() + { + } + + public event PropertyChangedEventHandler? PropertyChanged; + } +} \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/Customization/AlarmPopup.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/Customization/AlarmPopup.cs new file mode 100644 index 00000000..e74bb400 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/Customization/AlarmPopup.cs @@ -0,0 +1,83 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.Picker.SfTimePicker +{ + using Syncfusion.Maui.Popup; + + public class AlarmPopup : SfPopup + { + private Syncfusion.Maui.Picker.SfTimePicker alarmTimePicker; + private Entry alarmMessageEntry; + + public event EventHandler? OnCreated; + public AlarmPopup() + { + this.alarmTimePicker = new Syncfusion.Maui.Picker.SfTimePicker(); + StackLayout stack = new StackLayout(); + Label label = new Label(); + label.Text = "Alarm Message"; + label.Margin = new Thickness(10, 3); + label.FontSize = 12; + stack.Add(label); + this.alarmMessageEntry = new Entry(); + this.alarmMessageEntry.HeightRequest = 40; + this.alarmMessageEntry.Placeholder = "Enter Alarm Message"; + this.alarmMessageEntry.Text = string.Empty; + this.alarmMessageEntry.Margin = new Thickness(5, 0); + stack.Add(this.alarmMessageEntry); + Label label1 = new Label(); + label1.Text = "Alarm Time"; + label1.FontSize = 12; + label1.Margin = new Thickness(10, 5, 0, 0); + stack.Add(label1); + this.alarmTimePicker.FooterView.Height = 40; + this.alarmTimePicker.HeightRequest = 280; + this.alarmTimePicker.Format = Syncfusion.Maui.Picker.PickerTimeFormat.h_mm_tt; + this.alarmTimePicker.OkButtonClicked += AlarmTimePicker_OkButtonClicked; + this.alarmTimePicker.CancelButtonClicked += AlarmTimePicker_CancelButtonClicked; + stack.Add(this.alarmTimePicker); + stack.VerticalOptions = LayoutOptions.Center; + this.ContentTemplate = new DataTemplate(() => + { + return stack; + }); + + this.HeaderTemplate = new DataTemplate(() => + { + return new Label() { Text = "Set Alarm", FontSize = 20, HeightRequest = 40, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center }; + }); + + this.HeightRequest = 410; + this.WidthRequest = 300; + this.ShowFooter = false; + this.ShowHeader = true; + this.HeaderHeight = 40; + this.PopupStyle.CornerRadius = new CornerRadius(5); + } + + private void AlarmTimePicker_CancelButtonClicked(object? sender, EventArgs e) + { + this.Reset(); + this.IsOpen = false; + } + + private void AlarmTimePicker_OkButtonClicked(object? sender, EventArgs e) + { + this.OnCreated?.Invoke(new AlarmDetails() { AlarmTime = this.alarmTimePicker.SelectedTime, AlarmMessage = this.alarmMessageEntry.Text == string.Empty ? "No Alarm Message" : this.alarmMessageEntry.Text, IsAlarmEnabled = true }, new EventArgs()); + this.IsOpen = false; + this.Reset(); + } + + public void Reset() + { + this.alarmTimePicker.SelectedTime = DateTime.Now.TimeOfDay; + this.alarmMessageEntry.Text = string.Empty; + this.alarmMessageEntry.Placeholder = "Enter Alarm Message"; + } + } +} diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/Customization/AlarmTimer.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/Customization/AlarmTimer.cs new file mode 100644 index 00000000..8b359cb3 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/Customization/AlarmTimer.cs @@ -0,0 +1,40 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.Picker.SfTimePicker +{ + using System.Globalization; + + public class AlarmTimer : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is TimeSpan timeSpan) + { + TimeSpan currentTime = DateTime.Now.TimeOfDay; + timeSpan = currentTime.Hours >= timeSpan.Hours ? timeSpan.Add(new TimeSpan(24, 0, 0)) : timeSpan; + var timeDifference = timeSpan.Subtract(currentTime); + if (timeDifference.Minutes == 0 && timeDifference.Hours == 0) + { + return $"Alarm in {timeDifference.Seconds} seconds"; + } + else + { + return $"Alarm in {timeDifference.Hours} hours {timeDifference.Minutes} minutes"; + } + } + + return string.Empty; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return string.Empty; + } + } + +} diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/Customization/AlarmViewModel.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/Customization/AlarmViewModel.cs new file mode 100644 index 00000000..954469f7 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/Customization/AlarmViewModel.cs @@ -0,0 +1,130 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.Picker.SfTimePicker +{ + using System.Collections.ObjectModel; + using System.ComponentModel; + + public class AlarmDetails : INotifyPropertyChanged + { + private TimeSpan alarmTime; + private string alarmMessage = string.Empty; + private bool isAlarmEnabled = true; + private Color alarmTextColor = Colors.Black; + private Color alarmSecondaryTextColor = Colors.Grey; + + public event PropertyChangedEventHandler? PropertyChanged; + + public TimeSpan AlarmTime + { + get + { + return alarmTime; + } + set + { + alarmTime = value; + RaisePropertyChanged("AlarmTime"); + } + } + + public string AlarmMessage + { + get + { + return alarmMessage; + } + set + { + alarmMessage = value; + RaisePropertyChanged("AlarmMessage"); + } + } + + public bool IsAlarmEnabled + { + get + { + return isAlarmEnabled; + } + set + { + isAlarmEnabled = value; + RaisePropertyChanged("IsAlarmEnabled"); + } + } + + public Color AlarmTextColor + { + get + { + return alarmTextColor; + } + set + { + alarmTextColor = value; + RaisePropertyChanged("AlarmTextColor"); + } + } + + public Color AlarmSecondaryTextColor + { + get + { + return alarmSecondaryTextColor; + } + set + { + alarmSecondaryTextColor = value; + RaisePropertyChanged("AlarmSecondaryTextColor"); + } + } + + + private void RaisePropertyChanged(string propertyName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + } + + public class ViewModel : INotifyPropertyChanged + { + private ObservableCollection alarmCollection; + + public event PropertyChangedEventHandler? PropertyChanged; + + public ObservableCollection AlarmCollection + { + get + { + return alarmCollection; + } + set + { + alarmCollection = value; + RaisePropertyChanged("AlarmCollection"); + } + } + + public ViewModel() + { + this.alarmCollection = new ObservableCollection() + { + new AlarmDetails() { AlarmTime = new TimeSpan(4, 0, 0), AlarmMessage = "Wake Up", IsAlarmEnabled = true, AlarmTextColor = Colors.Black, AlarmSecondaryTextColor=Colors.Gray }, + new AlarmDetails() { AlarmTime = new TimeSpan(5, 0, 0), AlarmMessage = "Morning Workout", IsAlarmEnabled = true, AlarmTextColor = Colors.Black, AlarmSecondaryTextColor=Colors.Gray }, + new AlarmDetails() { AlarmTime = new TimeSpan(13, 0, 0), AlarmMessage = "No Alarm Message", IsAlarmEnabled = false, AlarmTextColor = Colors.Gray, AlarmSecondaryTextColor=Colors.LightGray }, + }; + } + + private void RaisePropertyChanged(string propertyName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + } + +} \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/Customization/TimeSpanConverter.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/Customization/TimeSpanConverter.cs new file mode 100644 index 00000000..a0e879d0 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/Customization/TimeSpanConverter.cs @@ -0,0 +1,54 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.Picker.SfTimePicker +{ + using System.Globalization; + + public class TimeSpanConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is TimeSpan timeSpan) + { + TimeSpan twelveHrsTime = timeSpan.Hours > 12 || timeSpan.Hours == 0 ? timeSpan.Subtract(new TimeSpan(12, 0, 0)) : timeSpan; + if (timeSpan.Hours > 12) + { + twelveHrsTime = timeSpan.Subtract(new TimeSpan(12, 0, 0)); + } + else if (timeSpan.Hours == 0) + { + twelveHrsTime = new TimeSpan(12, 0, 0); + } + + if (parameter is Boolean parameterValue) + { + if (parameterValue) + { + return $"{twelveHrsTime.Hours}:{timeSpan.Minutes:D2}"; + } + else + { + return $"{((timeSpan.Hours < 12) ? " AM" : " PM")}"; + } + } + else + { + return $"{twelveHrsTime.Hours}:{timeSpan.Minutes:D2} {((timeSpan.Hours < 12) ? " AM" : " PM")}"; + } + } + + return string.Empty; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return string.Empty; + } + } + +} \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/Customization/View/Customization.xaml b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/Customization/View/Customization.xaml new file mode 100644 index 00000000..45ba3e67 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/Customization/View/Customization.xaml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/Customization/View/Customization.xaml.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/Customization/View/Customization.xaml.cs new file mode 100644 index 00000000..7301b0a3 --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/Customization/View/Customization.xaml.cs @@ -0,0 +1,84 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.Picker.SfTimePicker +{ + using SampleBrowser.Maui.Base; + + public partial class Customization : SampleView + { + private AlarmDetails? alarmDetails; + public Customization() + { + InitializeComponent(); + } + + private void OnAlarmTapped(object sender, EventArgs e) + { + if (sender is Border border && border.BindingContext != null && border.BindingContext is AlarmDetails alarmDetails) + { + if (alarmDetails.IsAlarmEnabled) + { + this.alarmEditPicker.SelectedTime = alarmDetails.AlarmTime; + this.alarmDetails = alarmDetails; + this.alarmEditPicker.IsOpen = true; + } + } + } + + private void AlarmEditPicker_OkButtonClicked(object? sender, EventArgs e) + { + if (sender is Syncfusion.Maui.Picker.SfTimePicker picker && this.alarmDetails != null) + { + if (this.alarmDetails.AlarmTime != picker.SelectedTime) + { + this.alarmDetails.AlarmTime = picker.SelectedTime; + } + + this.alarmDetails = null; + } + + this.alarmEditPicker.IsOpen = false; + } + + private void alarmEditPicker_CancelButtonClicked(object sender, EventArgs e) + { + this.alarmEditPicker.IsOpen = false; + } + + private void alarmSwitch_Toggled(object sender, ToggledEventArgs e) + { + if (sender is Switch toggleSwitch && toggleSwitch.BindingContext != null && toggleSwitch.BindingContext is AlarmDetails alarmDetails) + { + if (e.Value) + { + alarmDetails.AlarmTextColor = Colors.Black; + alarmDetails.AlarmSecondaryTextColor = Colors.Gray; + } + else + { + alarmDetails.AlarmTextColor = Colors.Gray; + alarmDetails.AlarmSecondaryTextColor = Colors.LightGray; + } + } + + } + + private void OnAddAlarmTapped(object sender, EventArgs e) + { + this.alarmPopup.IsOpen = true; + } + + private void alarmPopup_OnCreated(object sender, EventArgs e) + { + if (this.BindingContext != null && this.BindingContext is ViewModel bindingContext && sender is AlarmDetails details) + { + bindingContext.AlarmCollection.Add(details); + } + } + } +} \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/GettingStarted/Behavior/GettingStartedBehavior.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/GettingStarted/Behavior/GettingStartedBehavior.cs new file mode 100644 index 00000000..48260a4b --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/GettingStarted/Behavior/GettingStartedBehavior.cs @@ -0,0 +1,260 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.Picker.SfTimePicker +{ + using SampleBrowser.Maui.Base; + using Syncfusion.Maui.Inputs; + using Syncfusion.Maui.Picker; + using System.Collections.ObjectModel; + + public class GettingStartedBehavior : Behavior + { + /// + /// Picker view + /// + private SfTimePicker? timePicker; + + /// + /// The show header switch + /// + private Switch? showHeaderSwitch, showColumnHeaderSwitch, showFooterSwitch; + + /// + /// The date format combo box. + /// + private SfComboBox? formatComboBox; + + /// + /// The time format to set the combo box item source. + /// + private ObservableCollection? formats; + + /// + /// Begins when the behavior attached to the view + /// + /// bindable value + protected override void OnAttachedTo(SampleView bindable) + { + base.OnAttachedTo(bindable); + +#if IOS || MACCATALYST + Border border = bindable.Content.FindByName("border"); + border.IsVisible = true; + border.Stroke = Color.FromArgb("#E6E6E6"); + this.timePicker = bindable.Content.FindByName("TimePicker1"); +#else + Frame frame = bindable.Content.FindByName("frame"); + frame.IsVisible = true; + frame.BorderColor = Color.FromArgb("#E6E6E6"); + this.timePicker = bindable.Content.FindByName("TimePicker"); +#endif + + this.showHeaderSwitch = bindable.Content.FindByName("showHeaderSwitch"); + this.showColumnHeaderSwitch = bindable.Content.FindByName("showColumnHeaderSwitch"); + this.showFooterSwitch = bindable.Content.FindByName("showFooterSwitch"); + + if (this.showHeaderSwitch != null) + { + this.showHeaderSwitch.Toggled += ShowHeaderSwitch_Toggled; + } + + if (this.showColumnHeaderSwitch != null) + { + this.showColumnHeaderSwitch.Toggled += ShowColumnHeaderSwitch_Toggled; + } + + if (this.showFooterSwitch != null) + { + this.showFooterSwitch.Toggled += ShowFooterSwitch_Toggled; + } + + formats = new ObservableCollection() + { + "H mm", "H mm ss", "h mm ss tt", "h mm tt", "HH mm", "HH mm ss", "hh mm ss tt", "hh mm tt", "hh tt" + }; + + this.formatComboBox = bindable.Content.FindByName("formatComboBox"); + this.formatComboBox.ItemsSource = formats; + this.formatComboBox.SelectedIndex = 1; + this.formatComboBox.SelectionChanged += FormatComboBox_SelectionChanged; + } + + /// + /// Method for show header switch toggle changed. + /// + /// Return the object. + /// The Event Arguments. + private void ShowHeaderSwitch_Toggled(object? sender, ToggledEventArgs e) + { + if (this.timePicker != null) + { + if (e.Value == true) + { + this.timePicker.HeaderView = new PickerHeaderView() + { + Height = 50, + Text = "Select a time", + Background = Color.FromArgb("#6750A4"), + TextStyle = new PickerTextStyle() + { + TextColor = Colors.White, + FontSize = 15, + }, + }; + } + else if (e.Value == false) + { + this.timePicker.HeaderView = new PickerHeaderView() + { + Height = 0, + }; + } + } + } + + /// + /// Method for show column header switch toggle changed. + /// + /// Return the object. + /// The Event Arguments. + private void ShowColumnHeaderSwitch_Toggled(object? sender, ToggledEventArgs e) + { + if (this.timePicker != null) + { + if (e.Value == true) + { + this.timePicker.ColumnHeaderView = new TimePickerColumnHeaderView() + { + Height = 40, + }; + } + if (e.Value == false) + { + this.timePicker.ColumnHeaderView = new TimePickerColumnHeaderView() + { + Height = 0, + }; + } + } + } + + /// + /// Method for show footer switch toggle changed. + /// + /// Return the object. + /// The Event Arguments. + private void ShowFooterSwitch_Toggled(object? sender, ToggledEventArgs e) + { + if (this.timePicker != null) + { + if (e.Value == true) + { + this.timePicker.FooterView = new PickerFooterView() + { + Height = 40, + TextStyle = new PickerTextStyle() + { + TextColor = Color.FromArgb("#6750A4"), + FontSize = 15, + }, + }; + } + else if (e.Value == false) + { + this.timePicker.FooterView = new PickerFooterView() + { + Height = 0, + }; + } + } + } + + /// + /// The format combo box selection changed event. + /// + /// Return the object. + /// The Event Arguments. + private void FormatComboBox_SelectionChanged(object? sender, SelectionChangedEventArgs e) + { + if (this.timePicker == null || e.CurrentSelection == null || this.formatComboBox == null) + { + return; + } + + string? format = e.CurrentSelection[0].ToString(); + switch (format) + { + case "H mm": + this.timePicker.Format = PickerTimeFormat.H_mm; + break; + + case "H mm ss": + this.timePicker.Format = PickerTimeFormat.H_mm_ss; + break; + + case "h mm ss tt": + this.timePicker.Format = PickerTimeFormat.h_mm_ss_tt; + break; + + case "h mm tt": + this.timePicker.Format = PickerTimeFormat.h_mm_tt; + break; + + case "HH mm": + this.timePicker.Format = PickerTimeFormat.HH_mm; + break; + + case "HH mm ss": + this.timePicker.Format = PickerTimeFormat.HH_mm_ss; + break; + + case "hh mm ss tt": + this.timePicker.Format = PickerTimeFormat.hh_mm_ss_tt; + break; + + case "hh mm tt": + this.timePicker.Format = PickerTimeFormat.hh_mm_tt; + break; + + case "hh tt": + this.timePicker.Format = PickerTimeFormat.hh_tt; + break; + } + } + + /// + /// Begins when the behavior attached to the view + /// + /// bindable value + protected override void OnDetachingFrom(SampleView bindable) + { + base.OnDetachingFrom(bindable); + if (this.showHeaderSwitch != null) + { + this.showHeaderSwitch.Toggled -= ShowHeaderSwitch_Toggled; + this.showHeaderSwitch = null; + } + + if (this.showColumnHeaderSwitch != null) + { + this.showColumnHeaderSwitch.Toggled -= ShowColumnHeaderSwitch_Toggled; + this.showColumnHeaderSwitch = null; + } + + if (this.showFooterSwitch != null) + { + this.showFooterSwitch.Toggled -= ShowFooterSwitch_Toggled; + this.showFooterSwitch = null; + } + } + + public GettingStartedBehavior() + { + } + } +} \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/GettingStarted/View/GettingStarted.xaml b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/GettingStarted/View/GettingStarted.xaml new file mode 100644 index 00000000..a82f945a --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/GettingStarted/View/GettingStarted.xaml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/GettingStarted/View/GettingStarted.xaml.cs b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/GettingStarted/View/GettingStarted.xaml.cs new file mode 100644 index 00000000..d6e2c5ed --- /dev/null +++ b/MAUI/Picker/SampleBrowser.Maui.Picker/Samples/TimePicker/GettingStarted/View/GettingStarted.xaml.cs @@ -0,0 +1,18 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; + +namespace SampleBrowser.Maui.Picker.SfTimePicker; + +public partial class GettingStarted : SampleView +{ + public GettingStarted() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/MAUI/Picker/SampleBrowser.Maui.Picker/SyncfusionLicense.txt b/MAUI/Picker/SampleBrowser.Maui.Picker/SyncfusionLicense.txt new file mode 100644 index 00000000..e69de29b diff --git a/MAUI/Popup/SampleBrowser.Maui.Popup/SampleBrowser.Maui.Popup.csproj b/MAUI/Popup/SampleBrowser.Maui.Popup/SampleBrowser.Maui.Popup.csproj index b8b2d492..99355aeb 100644 --- a/MAUI/Popup/SampleBrowser.Maui.Popup/SampleBrowser.Maui.Popup.csproj +++ b/MAUI/Popup/SampleBrowser.Maui.Popup/SampleBrowser.Maui.Popup.csproj @@ -82,15 +82,15 @@ - - - - - - - - - + + + + + + + + + diff --git a/MAUI/Popup/SampleBrowser.Maui.Popup/SampleBrowser.Maui.Popup.nuspec b/MAUI/Popup/SampleBrowser.Maui.Popup/SampleBrowser.Maui.Popup.nuspec index cf74034b..110d9e89 100644 --- a/MAUI/Popup/SampleBrowser.Maui.Popup/SampleBrowser.Maui.Popup.nuspec +++ b/MAUI/Popup/SampleBrowser.Maui.Popup/SampleBrowser.Maui.Popup.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png Popup component for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MAUI/Popup/SampleBrowser.Maui.Popup/Samples/Popup/Helper/Behavior.cs b/MAUI/Popup/SampleBrowser.Maui.Popup/Samples/Popup/Helper/Behavior.cs index c88bcabe..be09edb4 100644 --- a/MAUI/Popup/SampleBrowser.Maui.Popup/Samples/Popup/Helper/Behavior.cs +++ b/MAUI/Popup/SampleBrowser.Maui.Popup/Samples/Popup/Helper/Behavior.cs @@ -46,7 +46,7 @@ namespace SampleBrowser.Maui.Popup.SfPopup ActionSheetPopup!.WidthRequest = 360; #endif #if IOS || MACCATALYST - ActionSheetPopup.Refresh(); + ActionSheetPopup.Refresh(); #endif } @@ -85,6 +85,7 @@ namespace SampleBrowser.Maui.Popup.SfPopup VerticalTextAlignment = TextAlignment.Center, FontSize = 24, + HeightRequest = 24, TextColor = Colors.Gray, FontAttributes = FontAttributes.Bold, }; @@ -103,6 +104,7 @@ namespace SampleBrowser.Maui.Popup.SfPopup #endif VerticalTextAlignment = TextAlignment.Center, FontSize = 24, + HeightRequest = 24, TextColor = Colors.Gray, }; } @@ -120,6 +122,7 @@ namespace SampleBrowser.Maui.Popup.SfPopup #endif VerticalTextAlignment = TextAlignment.Center, FontSize = 24, + HeightRequest = 24, TextColor = Colors.Gray, }; } @@ -137,6 +140,7 @@ namespace SampleBrowser.Maui.Popup.SfPopup #endif VerticalTextAlignment = TextAlignment.Center, FontSize = 24, + HeightRequest = 24, TextColor = Colors.Gray, }; } diff --git a/MAUI/Presentation/SampleBrowser.Maui.Presentation/Platforms/iOS/SaveIOS.cs b/MAUI/Presentation/SampleBrowser.Maui.Presentation/Platforms/iOS/SaveIOS.cs index 1d5a0703..7056783f 100644 --- a/MAUI/Presentation/SampleBrowser.Maui.Presentation/Platforms/iOS/SaveIOS.cs +++ b/MAUI/Presentation/SampleBrowser.Maui.Presentation/Platforms/iOS/SaveIOS.cs @@ -35,7 +35,9 @@ namespace SampleBrowser.Maui.Presentation.Services if (contentType != "application/html" || exception == string.Empty) { #pragma warning disable CA1416 //This call site is reachable on: 'iOS' 14.2 and later, 'maccatalyst' 14.2 and later. 'UIApplication.KeyWindow.get' is unsupported on: 'ios' 13.0 and later, 'maccatalyst' 13.0 and later. +#pragma warning disable CA1422 // Validate platform compatibility UIViewController? currentController = UIApplication.SharedApplication!.KeyWindow!.RootViewController; +#pragma warning disable CA1422 // Validate platform compatibility #pragma warning restore CA1416 //This call site is reachable on: 'iOS' 14.2 and later, 'maccatalyst' 14.2 and later. 'UIApplication.KeyWindow.get' is unsupported on: 'ios' 13.0 and later, 'maccatalyst' 13.0 and later. while (currentController!.PresentedViewController != null) currentController = currentController.PresentedViewController; diff --git a/MAUI/Presentation/SampleBrowser.Maui.Presentation/PresentationSamplesList.xml b/MAUI/Presentation/SampleBrowser.Maui.Presentation/PresentationSamplesList.xml index 3f1d4ea6..e0eb28ef 100644 --- a/MAUI/Presentation/SampleBrowser.Maui.Presentation/PresentationSamplesList.xml +++ b/MAUI/Presentation/SampleBrowser.Maui.Presentation/PresentationSamplesList.xml @@ -1,14 +1,14 @@ - + - + diff --git a/MAUI/Presentation/SampleBrowser.Maui.Presentation/SampleBrowser.Maui.Presentation.csproj b/MAUI/Presentation/SampleBrowser.Maui.Presentation/SampleBrowser.Maui.Presentation.csproj index ae217f30..64a54fcb 100644 --- a/MAUI/Presentation/SampleBrowser.Maui.Presentation/SampleBrowser.Maui.Presentation.csproj +++ b/MAUI/Presentation/SampleBrowser.Maui.Presentation/SampleBrowser.Maui.Presentation.csproj @@ -76,10 +76,10 @@ - - - - + + + + diff --git a/MAUI/ProgressBar/SampleBrowser.Maui.ProgressBar/SampleBrowser.Maui.ProgressBar.csproj b/MAUI/ProgressBar/SampleBrowser.Maui.ProgressBar/SampleBrowser.Maui.ProgressBar.csproj index 3c282d32..b3e84533 100644 --- a/MAUI/ProgressBar/SampleBrowser.Maui.ProgressBar/SampleBrowser.Maui.ProgressBar.csproj +++ b/MAUI/ProgressBar/SampleBrowser.Maui.ProgressBar/SampleBrowser.Maui.ProgressBar.csproj @@ -74,9 +74,9 @@ - - - - + + + + diff --git a/MAUI/ProgressBar/SampleBrowser.Maui.ProgressBar/SampleBrowser.Maui.ProgressBar.nuspec b/MAUI/ProgressBar/SampleBrowser.Maui.ProgressBar/SampleBrowser.Maui.ProgressBar.nuspec index 9e4da188..d16afc12 100644 --- a/MAUI/ProgressBar/SampleBrowser.Maui.ProgressBar/SampleBrowser.Maui.ProgressBar.nuspec +++ b/MAUI/ProgressBar/SampleBrowser.Maui.ProgressBar/SampleBrowser.Maui.ProgressBar.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png LinearProgressBar and CircularProgressBar components for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MAUI/ProgressBar/SampleBrowser.Maui.ProgressBar/Samples/CircularProgressBar/CircularProgressBar.xaml b/MAUI/ProgressBar/SampleBrowser.Maui.ProgressBar/Samples/CircularProgressBar/CircularProgressBar.xaml index d1dbe523..b9092125 100644 --- a/MAUI/ProgressBar/SampleBrowser.Maui.ProgressBar/Samples/CircularProgressBar/CircularProgressBar.xaml +++ b/MAUI/ProgressBar/SampleBrowser.Maui.ProgressBar/Samples/CircularProgressBar/CircularProgressBar.xaml @@ -87,7 +87,7 @@ IsVisible="true" Text="" FontSize="Large" - FontFamily="{OnPlatform iOS=Sync FontIcons, MacCatalyst=Sync FontIcons, Android=Sync FontIcons.ttf#, UWP=Sync FontIcons.ttf#Sync FontIcons}" + FontFamily="{OnPlatform iOS=Sync FontIcons, MacCatalyst=Sync FontIcons, Android=Sync FontIcons.ttf#, WinUI=Sync FontIcons.ttf#Sync FontIcons}" TextColor="#FF512BD4" HorizontalOptions="Center" VerticalOptions="Center" @@ -163,8 +163,8 @@ - + diff --git a/MAUI/PyramidChart/SampleBrowser.Maui.PyramidChart/SampleBrowser.Maui.PyramidChart.csproj b/MAUI/PyramidChart/SampleBrowser.Maui.PyramidChart/SampleBrowser.Maui.PyramidChart.csproj index 09947619..2819da2f 100644 --- a/MAUI/PyramidChart/SampleBrowser.Maui.PyramidChart/SampleBrowser.Maui.PyramidChart.csproj +++ b/MAUI/PyramidChart/SampleBrowser.Maui.PyramidChart/SampleBrowser.Maui.PyramidChart.csproj @@ -85,10 +85,10 @@ - - - - + + + + diff --git a/MAUI/PyramidChart/SampleBrowser.Maui.PyramidChart/SampleBrowser.Maui.PyramidChart.nuspec b/MAUI/PyramidChart/SampleBrowser.Maui.PyramidChart/SampleBrowser.Maui.PyramidChart.nuspec index 591d1898..c674cc63 100644 --- a/MAUI/PyramidChart/SampleBrowser.Maui.PyramidChart/SampleBrowser.Maui.PyramidChart.nuspec +++ b/MAUI/PyramidChart/SampleBrowser.Maui.PyramidChart/SampleBrowser.Maui.PyramidChart.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png Pyramid chart component for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/MAUI/PyramidChart/SampleBrowser.Maui.PyramidChart/Samples/PyramidChart/PyramidChartDemo/Legend.xaml b/MAUI/PyramidChart/SampleBrowser.Maui.PyramidChart/Samples/PyramidChart/PyramidChartDemo/Legend.xaml index 3b077ae7..ad09ac54 100644 --- a/MAUI/PyramidChart/SampleBrowser.Maui.PyramidChart/Samples/PyramidChart/PyramidChartDemo/Legend.xaml +++ b/MAUI/PyramidChart/SampleBrowser.Maui.PyramidChart/Samples/PyramidChart/PyramidChartDemo/Legend.xaml @@ -12,8 +12,8 @@ - - - - + + + + diff --git a/MAUI/RadialSliders/SampleBrowser.Maui.RadialSliders/SampleBrowser.Maui.RadialSliders.nuspec b/MAUI/RadialSliders/SampleBrowser.Maui.RadialSliders/SampleBrowser.Maui.RadialSliders.nuspec index 081cfd53..61bf8d00 100644 --- a/MAUI/RadialSliders/SampleBrowser.Maui.RadialSliders/SampleBrowser.Maui.RadialSliders.nuspec +++ b/MAUI/RadialSliders/SampleBrowser.Maui.RadialSliders/SampleBrowser.Maui.RadialSliders.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png RadialSlider and RadialRangeSlider samples using SfRadialGauge component of Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MAUI/RadialSliders/SampleBrowser.Maui.RadialSliders/Samples/RadialRangeSlider/Styles/StylesRadialRangeSlider.xaml b/MAUI/RadialSliders/SampleBrowser.Maui.RadialSliders/Samples/RadialRangeSlider/Styles/StylesRadialRangeSlider.xaml index dd053a08..455c8275 100644 --- a/MAUI/RadialSliders/SampleBrowser.Maui.RadialSliders/Samples/RadialRangeSlider/Styles/StylesRadialRangeSlider.xaml +++ b/MAUI/RadialSliders/SampleBrowser.Maui.RadialSliders/Samples/RadialRangeSlider/Styles/StylesRadialRangeSlider.xaml @@ -25,7 +25,7 @@ ShowLabels="False" StartAngle="270" EndAngle="270" - RadiusFactor="{OnPlatform UWP='0.6', Default='0.8', MacCatalyst='0.6'}"> + RadiusFactor="{OnPlatform WinUI='0.6', Default='0.8', MacCatalyst='0.6'}"> @@ -86,7 +86,7 @@ ShowLabels="False" StartAngle="270" EndAngle="270" - RadiusFactor="{OnPlatform UWP='0.6', Default='0.8', MacCatalyst='0.6'}"> + RadiusFactor="{OnPlatform WinUI='0.6', Default='0.8', MacCatalyst='0.6'}"> @@ -141,7 +141,7 @@ ShowLabels="False" StartAngle="270" EndAngle="270" - RadiusFactor="{OnPlatform UWP='0.6', Default='0.8', MacCatalyst='0.6'}"> + RadiusFactor="{OnPlatform WinUI='0.6', Default='0.8', MacCatalyst='0.6'}"> @@ -208,7 +208,7 @@ ShowLabels="False" StartAngle="270" EndAngle="270" - RadiusFactor="{OnPlatform UWP='0.6', Default='0.8', MacCatalyst='0.6'}"> + RadiusFactor="{OnPlatform WinUI='0.6', Default='0.8', MacCatalyst='0.6'}"> @@ -285,7 +285,7 @@ ShowLabels="False" StartAngle="270" EndAngle="270" - RadiusFactor="{OnPlatform UWP='0.6', Default='0.8', MacCatalyst='0.6'}"> + RadiusFactor="{OnPlatform WinUI='0.6', Default='0.8', MacCatalyst='0.6'}"> @@ -338,7 +338,7 @@ ShowLabels="False" StartAngle="270" EndAngle="270" - RadiusFactor="{OnPlatform UWP='0.6', Default='0.8', MacCatalyst='0.6'}"> + RadiusFactor="{OnPlatform WinUI='0.6', Default='0.8', MacCatalyst='0.6'}"> diff --git a/MAUI/RadialSliders/SampleBrowser.Maui.RadialSliders/Samples/RadialSlider/Styles/StylesRadialSlider.xaml b/MAUI/RadialSliders/SampleBrowser.Maui.RadialSliders/Samples/RadialSlider/Styles/StylesRadialSlider.xaml index 5770dbba..dd4b1c22 100644 --- a/MAUI/RadialSliders/SampleBrowser.Maui.RadialSliders/Samples/RadialSlider/Styles/StylesRadialSlider.xaml +++ b/MAUI/RadialSliders/SampleBrowser.Maui.RadialSliders/Samples/RadialSlider/Styles/StylesRadialSlider.xaml @@ -27,7 +27,7 @@ ShowLabels="False" StartAngle="270" EndAngle="270" - RadiusFactor="{OnPlatform UWP='0.6', Default='0.8', MacCatalyst='0.6'}"> + RadiusFactor="{OnPlatform WinUI='0.6', Default='0.8', MacCatalyst='0.6'}"> @@ -72,7 +72,7 @@ ShowLabels="False" StartAngle="270" EndAngle="270" - RadiusFactor="{OnPlatform UWP='0.6', Default='0.8', MacCatalyst='0.6'}"> + RadiusFactor="{OnPlatform WinUI='0.6', Default='0.8', MacCatalyst='0.6'}"> @@ -114,7 +114,7 @@ ShowLabels="False" StartAngle="270" EndAngle="270" - RadiusFactor="{OnPlatform UWP='0.6', Default='0.8', MacCatalyst='0.6'}"> + RadiusFactor="{OnPlatform WinUI='0.6', Default='0.8', MacCatalyst='0.6'}"> @@ -166,7 +166,7 @@ ShowLabels="False" StartAngle="270" EndAngle="270" - RadiusFactor="{OnPlatform UWP='0.6', Default='0.8', MacCatalyst='0.6'}"> + RadiusFactor="{OnPlatform WinUI='0.6', Default='0.8', MacCatalyst='0.6'}"> @@ -219,7 +219,7 @@ ShowLabels="False" StartAngle="270" EndAngle="270" - RadiusFactor="{OnPlatform UWP='0.6', Default='0.8', MacCatalyst='0.6'}"> + RadiusFactor="{OnPlatform WinUI='0.6', Default='0.8', MacCatalyst='0.6'}"> @@ -260,7 +260,7 @@ ShowLabels="False" StartAngle="270" EndAngle="270" - RadiusFactor="{OnPlatform UWP='0.6', Default='0.8', MacCatalyst='0.6'}"> + RadiusFactor="{OnPlatform WinUI='0.6', Default='0.8', MacCatalyst='0.6'}"> diff --git a/MAUI/Scheduler/SampleBrowser.Maui.Scheduler/SampleBrowser.Maui.Scheduler.csproj b/MAUI/Scheduler/SampleBrowser.Maui.Scheduler/SampleBrowser.Maui.Scheduler.csproj index b8175aca..441a25a6 100644 --- a/MAUI/Scheduler/SampleBrowser.Maui.Scheduler/SampleBrowser.Maui.Scheduler.csproj +++ b/MAUI/Scheduler/SampleBrowser.Maui.Scheduler/SampleBrowser.Maui.Scheduler.csproj @@ -74,10 +74,10 @@ - - - - + + + + diff --git a/MAUI/Scheduler/SampleBrowser.Maui.Scheduler/SampleBrowser.Maui.Scheduler.nuspec b/MAUI/Scheduler/SampleBrowser.Maui.Scheduler/SampleBrowser.Maui.Scheduler.nuspec index 9eebf28c..c0c39bc4 100644 --- a/MAUI/Scheduler/SampleBrowser.Maui.Scheduler/SampleBrowser.Maui.Scheduler.nuspec +++ b/MAUI/Scheduler/SampleBrowser.Maui.Scheduler/SampleBrowser.Maui.Scheduler.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png Scheduler component for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MAUI/Scheduler/SampleBrowser.Maui.Scheduler/Samples/Scheduler/AppearanceCustomization/View/AppearanceCustomization.xaml b/MAUI/Scheduler/SampleBrowser.Maui.Scheduler/Samples/Scheduler/AppearanceCustomization/View/AppearanceCustomization.xaml index 33bbda95..ad9a9d81 100644 --- a/MAUI/Scheduler/SampleBrowser.Maui.Scheduler/Samples/Scheduler/AppearanceCustomization/View/AppearanceCustomization.xaml +++ b/MAUI/Scheduler/SampleBrowser.Maui.Scheduler/Samples/Scheduler/AppearanceCustomization/View/AppearanceCustomization.xaml @@ -33,7 +33,7 @@ - + @@ -106,13 +106,13 @@ - + - + - + diff --git a/MAUI/Scheduler/SampleBrowser.Maui.Scheduler/Samples/Scheduler/ResourceView/View/ResourceView.xaml b/MAUI/Scheduler/SampleBrowser.Maui.Scheduler/Samples/Scheduler/ResourceView/View/ResourceView.xaml index 0a336021..6314a6f6 100644 --- a/MAUI/Scheduler/SampleBrowser.Maui.Scheduler/Samples/Scheduler/ResourceView/View/ResourceView.xaml +++ b/MAUI/Scheduler/SampleBrowser.Maui.Scheduler/Samples/Scheduler/ResourceView/View/ResourceView.xaml @@ -30,19 +30,19 @@ + HeightRequest="{OnPlatform WinUI= 70, MacCatalyst=70, Android=65, iOS=65}" + WidthRequest="{OnPlatform WinUI= 70, MacCatalyst=70, Android=65, iOS=65}"> - - + diff --git a/MAUI/Scheduler/SampleBrowser.Maui.Scheduler/SchedulerSamplesList.xml b/MAUI/Scheduler/SampleBrowser.Maui.Scheduler/SchedulerSamplesList.xml index 91fa3472..d6e028c3 100644 --- a/MAUI/Scheduler/SampleBrowser.Maui.Scheduler/SchedulerSamplesList.xml +++ b/MAUI/Scheduler/SampleBrowser.Maui.Scheduler/SchedulerSamplesList.xml @@ -1,12 +1,12 @@ - + - + diff --git a/MAUI/Shimmer/SampleBrowser.Maui.Shimmer/SampleBrowser.Maui.Shimmer.csproj b/MAUI/Shimmer/SampleBrowser.Maui.Shimmer/SampleBrowser.Maui.Shimmer.csproj index 02fd5712..55e12f96 100644 --- a/MAUI/Shimmer/SampleBrowser.Maui.Shimmer/SampleBrowser.Maui.Shimmer.csproj +++ b/MAUI/Shimmer/SampleBrowser.Maui.Shimmer/SampleBrowser.Maui.Shimmer.csproj @@ -1,4 +1,4 @@ - + net6.0-android;net6.0-ios;net6.0-maccatalyst @@ -75,8 +75,8 @@ - - - + + + diff --git a/MAUI/Shimmer/SampleBrowser.Maui.Shimmer/SampleBrowser.Maui.Shimmer.nuspec b/MAUI/Shimmer/SampleBrowser.Maui.Shimmer/SampleBrowser.Maui.Shimmer.nuspec index d7fb0d33..1907cc96 100644 --- a/MAUI/Shimmer/SampleBrowser.Maui.Shimmer/SampleBrowser.Maui.Shimmer.nuspec +++ b/MAUI/Shimmer/SampleBrowser.Maui.Shimmer/SampleBrowser.Maui.Shimmer.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png Shimmer component for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MAUI/Shimmer/SampleBrowser.Maui.Shimmer/ShimmerSamplesList.xml b/MAUI/Shimmer/SampleBrowser.Maui.Shimmer/ShimmerSamplesList.xml index 7a4fac88..831a8833 100644 --- a/MAUI/Shimmer/SampleBrowser.Maui.Shimmer/ShimmerSamplesList.xml +++ b/MAUI/Shimmer/SampleBrowser.Maui.Shimmer/ShimmerSamplesList.xml @@ -3,8 +3,8 @@ - - + + \ No newline at end of file diff --git a/MAUI/SignaturePad/SampleBrowser.Maui.SignaturePad/SampleBrowser.Maui.SignaturePad.csproj b/MAUI/SignaturePad/SampleBrowser.Maui.SignaturePad/SampleBrowser.Maui.SignaturePad.csproj index cf8f8ff5..3cddcaa4 100644 --- a/MAUI/SignaturePad/SampleBrowser.Maui.SignaturePad/SampleBrowser.Maui.SignaturePad.csproj +++ b/MAUI/SignaturePad/SampleBrowser.Maui.SignaturePad/SampleBrowser.Maui.SignaturePad.csproj @@ -82,10 +82,10 @@ - - - - - + + + + + - \ No newline at end of file + diff --git a/MAUI/SignaturePad/SampleBrowser.Maui.SignaturePad/SampleBrowser.Maui.SignaturePad.nuspec b/MAUI/SignaturePad/SampleBrowser.Maui.SignaturePad/SampleBrowser.Maui.SignaturePad.nuspec index 29053d61..c21d4299 100644 --- a/MAUI/SignaturePad/SampleBrowser.Maui.SignaturePad/SampleBrowser.Maui.SignaturePad.nuspec +++ b/MAUI/SignaturePad/SampleBrowser.Maui.SignaturePad/SampleBrowser.Maui.SignaturePad.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png SignaturePad component for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/MAUI/Sliders/SampleBrowser.Maui.Sliders/MauiProgram.cs b/MAUI/Sliders/SampleBrowser.Maui.Sliders/MauiProgram.cs index 9d95ce94..be30d193 100644 --- a/MAUI/Sliders/SampleBrowser.Maui.Sliders/MauiProgram.cs +++ b/MAUI/Sliders/SampleBrowser.Maui.Sliders/MauiProgram.cs @@ -24,7 +24,7 @@ public static class MauiProgram fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); }); - + builder.ConfigureSampleBrowserBase(); return builder.Build(); } } diff --git a/MAUI/Sliders/SampleBrowser.Maui.Sliders/SampleBrowser.Maui.Sliders.csproj b/MAUI/Sliders/SampleBrowser.Maui.Sliders/SampleBrowser.Maui.Sliders.csproj index fc8ac30a..31e097f3 100644 --- a/MAUI/Sliders/SampleBrowser.Maui.Sliders/SampleBrowser.Maui.Sliders.csproj +++ b/MAUI/Sliders/SampleBrowser.Maui.Sliders/SampleBrowser.Maui.Sliders.csproj @@ -82,11 +82,11 @@ - - - - - + + + + + diff --git a/MAUI/Sliders/SampleBrowser.Maui.Sliders/SampleBrowser.Maui.Sliders.nuspec b/MAUI/Sliders/SampleBrowser.Maui.Sliders/SampleBrowser.Maui.Sliders.nuspec index 1287da42..7bbe88d1 100644 --- a/MAUI/Sliders/SampleBrowser.Maui.Sliders/SampleBrowser.Maui.Sliders.nuspec +++ b/MAUI/Sliders/SampleBrowser.Maui.Sliders/SampleBrowser.Maui.Sliders.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png Sliders component for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/MAUI/Sliders/SampleBrowser.Maui.Sliders/SlidersSamplesList.xml b/MAUI/Sliders/SampleBrowser.Maui.Sliders/SlidersSamplesList.xml index ee8a257d..7b0984aa 100644 --- a/MAUI/Sliders/SampleBrowser.Maui.Sliders/SlidersSamplesList.xml +++ b/MAUI/Sliders/SampleBrowser.Maui.Sliders/SlidersSamplesList.xml @@ -8,7 +8,7 @@ Description="The horizontal slider enables you to select a date or a numeric value."> @@ -18,7 +18,7 @@ CodeViewerPath="Slider/DividerLabelTick/" /> @@ -57,7 +57,7 @@ Description="The horizontal range slider enables you to select a date or a numeric range."> @@ -67,7 +67,7 @@ CodeViewerPath="RangeSlider/DividerLabelTick/" /> @@ -110,12 +110,12 @@ Image="range_selector.png" Description="Visualize data and select a date or numeric range."> diff --git a/MAUI/TabView/SampleBrowser.Maui.TabView/SampleBrowser.Maui.TabView.csproj b/MAUI/TabView/SampleBrowser.Maui.TabView/SampleBrowser.Maui.TabView.csproj index 044c1ddc..356ecd69 100644 --- a/MAUI/TabView/SampleBrowser.Maui.TabView/SampleBrowser.Maui.TabView.csproj +++ b/MAUI/TabView/SampleBrowser.Maui.TabView/SampleBrowser.Maui.TabView.csproj @@ -81,9 +81,9 @@ - - - + + + diff --git a/MAUI/TabView/SampleBrowser.Maui.TabView/SampleBrowser.Maui.TabView.nuspec b/MAUI/TabView/SampleBrowser.Maui.TabView/SampleBrowser.Maui.TabView.nuspec index f79008f9..31175d70 100644 --- a/MAUI/TabView/SampleBrowser.Maui.TabView/SampleBrowser.Maui.TabView.nuspec +++ b/MAUI/TabView/SampleBrowser.Maui.TabView/SampleBrowser.Maui.TabView.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png TabView component for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/MAUI/TextInputLayout/SampleBrowser.Maui.TextInputLayout/SampleBrowser.Maui.TextInputLayout.csproj b/MAUI/TextInputLayout/SampleBrowser.Maui.TextInputLayout/SampleBrowser.Maui.TextInputLayout.csproj index 6746f4de..90679f0b 100644 --- a/MAUI/TextInputLayout/SampleBrowser.Maui.TextInputLayout/SampleBrowser.Maui.TextInputLayout.csproj +++ b/MAUI/TextInputLayout/SampleBrowser.Maui.TextInputLayout/SampleBrowser.Maui.TextInputLayout.csproj @@ -1,4 +1,4 @@ - + net6.0-android;net6.0-ios;net6.0-maccatalyst @@ -81,13 +81,13 @@ - - - - - - - + + + + + + + diff --git a/MAUI/TextInputLayout/SampleBrowser.Maui.TextInputLayout/SampleBrowser.Maui.TextInputLayout.nuspec b/MAUI/TextInputLayout/SampleBrowser.Maui.TextInputLayout/SampleBrowser.Maui.TextInputLayout.nuspec index 7b59e802..2c226573 100644 --- a/MAUI/TextInputLayout/SampleBrowser.Maui.TextInputLayout/SampleBrowser.Maui.TextInputLayout.nuspec +++ b/MAUI/TextInputLayout/SampleBrowser.Maui.TextInputLayout/SampleBrowser.Maui.TextInputLayout.nuspec @@ -11,22 +11,5 @@ http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png TextInputLayout component for Syncfusion .NET MAUI Copyright 2001 - 2019 Syncfusion Inc. - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MAUI/TreeView/NuGet.config b/MAUI/TreeView/NuGet.config new file mode 100644 index 00000000..2e1f0efd --- /dev/null +++ b/MAUI/TreeView/NuGet.config @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView.sln b/MAUI/TreeView/SampleBrowser.Maui.TreeView.sln new file mode 100644 index 00000000..185c6a90 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31611.283 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleBrowser.Maui.TreeView", "SampleBrowser.Maui.TreeView\SampleBrowser.Maui.TreeView.csproj", "{F3E9CC48-97B8-45FF-86EB-1A9AFFDB2162}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + Release-Xml|Any CPU = Release-Xml|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F3E9CC48-97B8-45FF-86EB-1A9AFFDB2162}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F3E9CC48-97B8-45FF-86EB-1A9AFFDB2162}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F3E9CC48-97B8-45FF-86EB-1A9AFFDB2162}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {F3E9CC48-97B8-45FF-86EB-1A9AFFDB2162}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F3E9CC48-97B8-45FF-86EB-1A9AFFDB2162}.Release|Any CPU.Build.0 = Release|Any CPU + {F3E9CC48-97B8-45FF-86EB-1A9AFFDB2162}.Release|Any CPU.Deploy.0 = Release|Any CPU + {F3E9CC48-97B8-45FF-86EB-1A9AFFDB2162}.Release-Xml|Any CPU.ActiveCfg = Release-Xml|Any CPU + {F3E9CC48-97B8-45FF-86EB-1A9AFFDB2162}.Release-Xml|Any CPU.Build.0 = Release-Xml|Any CPU + {F3E9CC48-97B8-45FF-86EB-1A9AFFDB2162}.Release-Xml|Any CPU.Deploy.0 = Release-Xml|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572} + EndGlobalSection +EndGlobal diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/App.xaml b/MAUI/TreeView/SampleBrowser.Maui.TreeView/App.xaml new file mode 100644 index 00000000..eaf53da3 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/App.xaml.cs b/MAUI/TreeView/SampleBrowser.Maui.TreeView/App.xaml.cs new file mode 100644 index 00000000..2c83a798 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/App.xaml.cs @@ -0,0 +1,22 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using System.Reflection; + +namespace SampleBrowser.Maui.TreeView; + +public partial class App : Application +{ + public App() + { + InitializeComponent(); + + var appInfo = typeof(App).GetTypeInfo().Assembly; + SampleBrowser.Maui.Base.BaseConfig.IsIndividualSB = true; + MainPage = SampleBrowser.Maui.Base.BaseConfig.MainPageInit(appInfo); + } +} diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/ControlConfig.cs b/MAUI/TreeView/SampleBrowser.Maui.TreeView/ControlConfig.cs new file mode 100644 index 00000000..58187688 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/ControlConfig.cs @@ -0,0 +1,13 @@ +#region Copyright Syncfusion Inc. 2001-2022. +// Copyright Syncfusion Inc. 2001-2022. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +namespace SampleBrowser.Maui.TreeView +{ + public class ControlConfig + { + } +} diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/ControlList.xml b/MAUI/TreeView/SampleBrowser.Maui.TreeView/ControlList.xml new file mode 100644 index 00000000..e8b18b12 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/ControlList.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/MauiProgram.cs b/MAUI/TreeView/SampleBrowser.Maui.TreeView/MauiProgram.cs new file mode 100644 index 00000000..988dfe7b --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/MauiProgram.cs @@ -0,0 +1,31 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Syncfusion.Maui.Core.Hosting; +using SampleBrowser.Maui.Base.Hosting; + +namespace SampleBrowser.Maui.TreeView; + +public static class MauiProgram +{ + public static MauiApp CreateMauiApp() + { + var builder = MauiApp.CreateBuilder(); + builder + .UseMauiApp() + .ConfigureSyncfusionCore() + .ConfigureFonts(fonts => + { + fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); + fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); + fonts.AddFont("Roboto-Medium.ttf", "Roboto-Medium"); + fonts.AddFont("Roboto-Regular.ttf", "Roboto-Regular"); + }); + builder.ConfigureSampleBrowserBase(); + return builder.Build(); + } +} diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Android/AndroidManifest.xml b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Android/AndroidManifest.xml new file mode 100644 index 00000000..e9937ad7 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Android/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Android/MainActivity.cs b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Android/MainActivity.cs new file mode 100644 index 00000000..369da1c0 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Android/MainActivity.cs @@ -0,0 +1,17 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Android.App; +using Android.Content.PM; +using Android.OS; + +namespace SampleBrowser.Maui.TreeView; + +[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] +public class MainActivity : MauiAppCompatActivity +{ +} diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Android/MainApplication.cs b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Android/MainApplication.cs new file mode 100644 index 00000000..c8402c99 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Android/MainApplication.cs @@ -0,0 +1,22 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Android.App; +using Android.Runtime; + +namespace SampleBrowser.Maui.TreeView; + +[Application] +public class MainApplication : MauiApplication +{ + public MainApplication(IntPtr handle, JniHandleOwnership ownership) + : base(handle, ownership) + { + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Android/Resources/values/colors.xml b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Android/Resources/values/colors.xml new file mode 100644 index 00000000..c04d7492 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Android/Resources/values/colors.xml @@ -0,0 +1,6 @@ + + + #512BD4 + #2B0B98 + #2B0B98 + \ No newline at end of file diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/MacCatalyst/AppDelegate.cs b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/MacCatalyst/AppDelegate.cs new file mode 100644 index 00000000..06afc6c9 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/MacCatalyst/AppDelegate.cs @@ -0,0 +1,16 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Foundation; + +namespace SampleBrowser.Maui.TreeView; + +[Register("AppDelegate")] +public class AppDelegate : MauiUIApplicationDelegate +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/MacCatalyst/Info.plist b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/MacCatalyst/Info.plist new file mode 100644 index 00000000..c96dd0a2 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/MacCatalyst/Info.plist @@ -0,0 +1,30 @@ + + + + + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/MacCatalyst/Program.cs b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/MacCatalyst/Program.cs new file mode 100644 index 00000000..5c0fa0dc --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/MacCatalyst/Program.cs @@ -0,0 +1,22 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using ObjCRuntime; +using UIKit; + +namespace SampleBrowser.Maui.TreeView; + +public class Program +{ + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } +} diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Tizen/Main.cs b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Tizen/Main.cs new file mode 100644 index 00000000..ee33fa52 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Tizen/Main.cs @@ -0,0 +1,23 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using System; +using Microsoft.Maui; +using Microsoft.Maui.Hosting; + +namespace SampleBrowser.Maui.TreeView; + +class Program : MauiApplication +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + + static void Main(string[] args) + { + var app = new Program(); + app.Run(args); + } +} diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Tizen/tizen-manifest.xml b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Tizen/tizen-manifest.xml new file mode 100644 index 00000000..6a115dc0 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Tizen/tizen-manifest.xml @@ -0,0 +1,15 @@ + + + + + maui-application-title-placeholder + maui-appicon-placeholder + + + + + http://tizen.org/privilege/internet + + + + \ No newline at end of file diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Windows/App.xaml b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Windows/App.xaml new file mode 100644 index 00000000..5ddac531 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Windows/App.xaml @@ -0,0 +1,8 @@ + + + diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Windows/App.xaml.cs b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Windows/App.xaml.cs new file mode 100644 index 00000000..1df8f8f5 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Windows/App.xaml.cs @@ -0,0 +1,31 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Microsoft.UI.Xaml; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace SampleBrowser.Maui.TreeView.WinUI; + +/// +/// Provides application-specific behavior to supplement the default Application class. +/// +public partial class App : MauiWinUIApplication +{ + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} + diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Windows/Package.appxmanifest b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Windows/Package.appxmanifest new file mode 100644 index 00000000..f23e76fe --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Windows/Package.appxmanifest @@ -0,0 +1,46 @@ + + + + + + + + + $placeholder$ + User Name + $placeholder$.png + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Windows/app.manifest b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Windows/app.manifest new file mode 100644 index 00000000..9a7734e5 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/Windows/app.manifest @@ -0,0 +1,15 @@ + + + + + + + + true/PM + PerMonitorV2, PerMonitor + + + diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/iOS/AppDelegate.cs b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/iOS/AppDelegate.cs new file mode 100644 index 00000000..06afc6c9 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/iOS/AppDelegate.cs @@ -0,0 +1,16 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Foundation; + +namespace SampleBrowser.Maui.TreeView; + +[Register("AppDelegate")] +public class AppDelegate : MauiUIApplicationDelegate +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/iOS/Info.plist b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/iOS/Info.plist new file mode 100644 index 00000000..0004a4fd --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/iOS/Info.plist @@ -0,0 +1,32 @@ + + + + + LSRequiresIPhoneOS + + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/iOS/Program.cs b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/iOS/Program.cs new file mode 100644 index 00000000..5c0fa0dc --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Platforms/iOS/Program.cs @@ -0,0 +1,22 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using ObjCRuntime; +using UIKit; + +namespace SampleBrowser.Maui.TreeView; + +public class Program +{ + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } +} diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Properties/launchSettings.json b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Properties/launchSettings.json new file mode 100644 index 00000000..edf8aadc --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "Windows Machine": { + "commandName": "MsixPackage", + "nativeDebugging": false + } + } +} \ No newline at end of file diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/AppIcon/appicon.svg b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/AppIcon/appicon.svg new file mode 100644 index 00000000..9d63b651 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/AppIcon/appicon.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/AppIcon/appiconfg.svg b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/AppIcon/appiconfg.svg new file mode 100644 index 00000000..208b00c3 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/AppIcon/appiconfg.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Fonts/OpenSans-Regular.ttf b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Fonts/OpenSans-Regular.ttf new file mode 100644 index 00000000..1e9cd854 Binary files /dev/null and b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Fonts/OpenSans-Regular.ttf differ diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Fonts/OpenSans-Semibold.ttf b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Fonts/OpenSans-Semibold.ttf new file mode 100644 index 00000000..316b3523 Binary files /dev/null and b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Fonts/OpenSans-Semibold.ttf differ diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Fonts/Roboto-Medium.ttf b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Fonts/Roboto-Medium.ttf new file mode 100644 index 00000000..e89b0b79 Binary files /dev/null and b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Fonts/Roboto-Medium.ttf differ diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Fonts/Roboto-Regular.ttf b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Fonts/Roboto-Regular.ttf new file mode 100644 index 00000000..3d6861b4 Binary files /dev/null and b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Fonts/Roboto-Regular.ttf differ diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Images/dotnet_bot.svg b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Images/dotnet_bot.svg new file mode 100644 index 00000000..abfaff26 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Images/dotnet_bot.svg @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Raw/AboutAssets.txt b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Raw/AboutAssets.txt new file mode 100644 index 00000000..15d62448 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Raw/AboutAssets.txt @@ -0,0 +1,15 @@ +Any raw assets you want to be deployed with your application can be placed in +this directory (and child directories). Deployment of the asset to your application +is automatically handled by the following `MauiAsset` Build Action within your `.csproj`. + + + +These files will be deployed with you package and will be accessible using Essentials: + + async Task LoadMauiAsset() + { + using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt"); + using var reader = new StreamReader(stream); + + var contents = reader.ReadToEnd(); + } diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Splash/splash.svg b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Splash/splash.svg new file mode 100644 index 00000000..938dea9a --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Splash/splash.svg @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Styles/Colors.xaml b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Styles/Colors.xaml new file mode 100644 index 00000000..245758ba --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Styles/Colors.xaml @@ -0,0 +1,44 @@ + + + + + #512BD4 + #DFD8F7 + #2B0B98 + White + Black + #E1E1E1 + #C8C8C8 + #ACACAC + #919191 + #6E6E6E + #404040 + #212121 + #141414 + + + + + + + + + + + + + + + #F7B548 + #FFD590 + #FFE5B9 + #28C2D1 + #7BDDEF + #C3F2F4 + #3E8EED + #72ACF1 + #A7CBF6 + + \ No newline at end of file diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Styles/Styles.xaml b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Styles/Styles.xaml new file mode 100644 index 00000000..1ec9d55f --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Resources/Styles/Styles.xaml @@ -0,0 +1,384 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/SampleBrowser.Maui.TreeView.csproj b/MAUI/TreeView/SampleBrowser.Maui.TreeView/SampleBrowser.Maui.TreeView.csproj new file mode 100644 index 00000000..f88aabcc --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/SampleBrowser.Maui.TreeView.csproj @@ -0,0 +1,97 @@ + + + + net6.0-android;net6.0-ios;net6.0-maccatalyst + $(TargetFrameworks);net6.0-windows10.0.19041.0 + + + Exe + SampleBrowser.Maui.TreeView + true + true + enable + true + true + latest + latest-recommended + true + enable + $(NoWarn);NU1803 + + + SampleBrowser.Maui.TreeView + + + com.companyname.samplebrowser.maui.treeview + 30324f3c-3ca3-4e44-94a8-f4a1fe6bc1e4 + + + 1.0 + 1 + + 14.2 + 14.0 + 21.0 + 10.0.18362.0 + 10.0.18362.0 + Debug;Release;Release-Xml + + + + TRACE;DEBUG; + true + 5 + + + + TRACE;RELEASE; + true + 5 + + + + TRACE;RELEASE; + true + 5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/SampleBrowser.Maui.TreeView.nuspec b/MAUI/TreeView/SampleBrowser.Maui.TreeView/SampleBrowser.Maui.TreeView.nuspec new file mode 100644 index 00000000..17fda2c1 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/SampleBrowser.Maui.TreeView.nuspec @@ -0,0 +1,15 @@ + + + + SampleBrowser.Maui.TreeView + 20.1.0.1 + Syncfusion Inc. + Syncfusion Inc. + true + http://www.syncfusion.com/nuget/license + http://www.syncfusion.com/ + http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png + TreeView component for Syncfusion .NET MAUI + Copyright 2001 - 2019 Syncfusion Inc. + + \ No newline at end of file diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/SampleBrowser.Maui.TreeView.props b/MAUI/TreeView/SampleBrowser.Maui.TreeView/SampleBrowser.Maui.TreeView.props new file mode 100644 index 00000000..3b7b48eb --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/SampleBrowser.Maui.TreeView.props @@ -0,0 +1,44 @@ + + + + + + TreeViewSamplesList.xml + + + + + + Samples\TreeView\GettingStarted\View\GettingStarted.xaml.cs + GettingStarted.xaml + + + + Samples\TreeView\GettingStarted\Model\FileManager.cs + + + + Samples\TreeView\GettingStarted\ViewModel\FileManagerViewModel.cs + + + Samples\TreeView\GettingStarted\Helper\Behavior.cs + + + Samples\TreeView\UnBoundMode\UnBoundMode.xaml.cs + UnBoundMode.xaml + + + + + + + Samples\TreeView\GettingStarted\View\GettingStarted.xaml + + + + + + Samples\TreeView\UnBoundMode\UnBoundMode.xaml + + + diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Samples/TreeView/GettingStarted/Helper/Behavior.cs b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Samples/TreeView/GettingStarted/Helper/Behavior.cs new file mode 100644 index 00000000..5b05fd71 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Samples/TreeView/GettingStarted/Helper/Behavior.cs @@ -0,0 +1,63 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SampleBrowser.Maui.TreeView +{ + public class SfTreeViewGettingStartedBehavior : Behavior + { + private Syncfusion.Maui.TreeView.SfTreeView? treeView; + private Syncfusion.Maui.Inputs.SfComboBox? comboBox; + + + protected override void OnAttachedTo(SampleView bindable) + { + treeView = bindable.FindByName("treeView"); + comboBox = bindable.FindByName("comboBox"); + + comboBox.SelectionChanged += PositionChangedPicker_SelectionChanged; + base.OnAttachedTo(bindable); + } + + protected override void OnDetachingFrom(SampleView bindable) + { + comboBox!.SelectionChanged -= PositionChangedPicker_SelectionChanged; + treeView = null; + comboBox = null; + base.OnDetachingFrom(bindable); + } + + private void PositionChangedPicker_SelectionChanged(object? sender, Syncfusion.Maui.Inputs.SelectionChangedEventArgs e) + { + switch (this.comboBox!.SelectedIndex) + { + case 0: + ExpanderPositionChanged(Syncfusion.Maui.TreeView.TreeViewExpanderPosition.Start); + break; + case 1: + ExpanderPositionChanged(Syncfusion.Maui.TreeView.TreeViewExpanderPosition.End); + break; + } + + } + + private void ExpanderPositionChanged(Syncfusion.Maui.TreeView.TreeViewExpanderPosition expanderPosition) + { + if (this.treeView!.ExpanderPosition != expanderPosition) + { + this.treeView!.ExpanderPosition = expanderPosition; + + } + } + } +} diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Samples/TreeView/GettingStarted/Model/FileManager.cs b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Samples/TreeView/GettingStarted/Model/FileManager.cs new file mode 100644 index 00000000..d5a50ce4 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Samples/TreeView/GettingStarted/Model/FileManager.cs @@ -0,0 +1,180 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using System.Collections.ObjectModel; +using System.ComponentModel; + +namespace SampleBrowser.Maui.TreeView +{ + public class Folder:INotifyPropertyChanged + { + private string? folderName; + private string? imageIcon; + private ObservableCollection? filesInfo; + + public Folder() + { + + } + + public string? FolderName + { + get + { + return folderName; + } + + set + { + folderName = value; + RaisedOnPropertyChanged("FolderName"); + } + } + + public string? ImageIcon + { + get + { + return imageIcon; + } + + set + { + imageIcon = value; + RaisedOnPropertyChanged("Icon"); + } + } + + public ObservableCollection? FilesInfo + { + get + { + return filesInfo; + } + set + { + filesInfo = value; + RaisedOnPropertyChanged("FilesInfo"); + + } + } + + private void RaisedOnPropertyChanged(string propertyName) + { + if(PropertyChanged != null) + { + PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + + public event PropertyChangedEventHandler? PropertyChanged; + } + public class File : INotifyPropertyChanged + { + private string? folderName; + private string? imageIcon; + private ObservableCollection? subFiles; + + public string? FolderName + { + get + { + return folderName; + } + + set + { + folderName = value; + RaiseOnPropertyChanged("FolderName"); + + } + } + public string? ImageIcon + { + get + { + return imageIcon; + } + + set + { + imageIcon = value; + RaiseOnPropertyChanged("Icon"); + } + } + public ObservableCollection? SubFiles + { + get + { + return subFiles; + } + + set + { + subFiles = value; + RaiseOnPropertyChanged("SubFiles"); + + } + } + + private void RaiseOnPropertyChanged(string propertyName) + { + if (PropertyChanged != null) + { + PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + public event PropertyChangedEventHandler? PropertyChanged; + } + + public class SubFiles : INotifyPropertyChanged + { + private string? folderName; + private string? imageIcon; + public SubFiles() + { + } + + public string? FolderName + { + get + { + return folderName; + } + + set + { + folderName = value; + RaiseOnPropertyChanged("FolderName"); + + } + } + public string? ImageIcon + { + get + { + return imageIcon; + } + + set + { + imageIcon = value; + RaiseOnPropertyChanged("Icon"); + } + } + + private void RaiseOnPropertyChanged(string propertyName) + { + if(PropertyChanged != null) + { + PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + + public event PropertyChangedEventHandler? PropertyChanged; + } +} \ No newline at end of file diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Samples/TreeView/GettingStarted/View/GettingStarted.xaml b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Samples/TreeView/GettingStarted/View/GettingStarted.xaml new file mode 100644 index 00000000..ea7d2c56 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Samples/TreeView/GettingStarted/View/GettingStarted.xaml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Start + End + + + + + Start + + + + + + \ No newline at end of file diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Samples/TreeView/GettingStarted/View/GettingStarted.xaml.cs b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Samples/TreeView/GettingStarted/View/GettingStarted.xaml.cs new file mode 100644 index 00000000..01806e00 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Samples/TreeView/GettingStarted/View/GettingStarted.xaml.cs @@ -0,0 +1,18 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; + +namespace SampleBrowser.Maui.TreeView.SfTreeView; + +public partial class GettingStarted : SampleView +{ + public GettingStarted() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Samples/TreeView/GettingStarted/ViewModel/FileManagerViewModel.cs b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Samples/TreeView/GettingStarted/ViewModel/FileManagerViewModel.cs new file mode 100644 index 00000000..8d7c3e5d --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Samples/TreeView/GettingStarted/ViewModel/FileManagerViewModel.cs @@ -0,0 +1,92 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.TreeView.SfTreeView; +using System.Collections.ObjectModel; +using System.Reflection; + +namespace SampleBrowser.Maui.TreeView +{ + internal class FileManagerViewModel + { + public ObservableCollection Folders { get;set; } + + public FileManagerViewModel() + { + this.Folders = GenerateItem(); + } + + private ObservableCollection GenerateItem() + { + + var doc = new Folder() { FolderName = "Documents", ImageIcon = "folder.png" }; + var download = new Folder() { FolderName = "Downloads", ImageIcon = "folder.png" }; + var music = new Folder() { FolderName = "Music", ImageIcon = "folder.png" }; + var picture = new Folder() { FolderName = "Pictures", ImageIcon = "folder.png" }; + var videos = new Folder() { FolderName = "Videos", ImageIcon = "folder.png" }; + + var pollution = new File() { FolderName = "Environmental Pollution.docx", ImageIcon = "Word.png" }; + var global = new File { FolderName = "Gloabal Warming.ppt", ImageIcon = "ppt.png" }; + var sanitation = new File() { FolderName = "Sanitation.docx", ImageIcon = "Word.png" }; + var socialNetwork = new File { FolderName = "Social Networks.ppt", ImageIcon = "ppt.png" }; + var youthEmpowerment = new File { FolderName = "Youth Empowerment.pdf", ImageIcon = "pdfimage.png" }; + + var tutorials = new File() { FolderName = "Tutorials.zip", ImageIcon = "zip.png" }; + var typeScript = new File() { FolderName = "TypeScript.7z", ImageIcon = "zip.png" }; + var uiGuide = new File() { FolderName = "UI-Guide.pdf", ImageIcon = "pdfimage.png" }; + + var song = new File() { FolderName = "Gouttes", ImageIcon = "Audio.png" }; + + var camera = new File() { FolderName = "Camera Roll", ImageIcon = "folder.png"}; + var stone = new File() { FolderName = "Stone.jpg", ImageIcon = "image.png" }; + var wind = new File() { FolderName = "Wind.jpg", ImageIcon = "image.png" }; + + var pic1 = new SubFiles() { FolderName = "WIN_20160726_094117.JPG", ImageIcon = "people_circle23.png" }; + var pic2 = new SubFiles() { FolderName = "WIN_20160726.Png", ImageIcon = "people_circle2.png" }; + + var video1 = new File() { FolderName = "Naturals.mp4", ImageIcon = "video.png" }; + var video2 = new File() { FolderName = "Wild.mpeg", ImageIcon = "video.png"}; + + doc.FilesInfo = new ObservableCollection(); + doc.FilesInfo.Add(pollution); + doc.FilesInfo.Add(global); + doc.FilesInfo.Add(sanitation); + doc.FilesInfo.Add(socialNetwork); + doc.FilesInfo.Add(youthEmpowerment); + + download.FilesInfo = new ObservableCollection(); + download.FilesInfo.Add(tutorials); + download.FilesInfo.Add(typeScript); + download.FilesInfo.Add(uiGuide); + + music.FilesInfo = new ObservableCollection(); + music.FilesInfo.Add(song); + + picture.FilesInfo = new ObservableCollection(); + picture.FilesInfo.Add(camera); + picture.FilesInfo.Add(stone); + picture.FilesInfo.Add(wind); + + videos.FilesInfo= new ObservableCollection(); + videos.FilesInfo.Add(video1); + videos.FilesInfo.Add(video2); + + camera.SubFiles = new ObservableCollection(); + camera.SubFiles.Add(pic1); + camera.SubFiles.Add(pic2); + + var deviceList=new ObservableCollection(); + deviceList.Add(doc); + deviceList.Add(download); + deviceList.Add(music); + deviceList.Add(picture); + deviceList.Add(videos); + + return deviceList; + } + } +} diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Samples/TreeView/UnBoundMode/UnBoundMode.xaml b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Samples/TreeView/UnBoundMode/UnBoundMode.xaml new file mode 100644 index 00000000..9f0629c9 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Samples/TreeView/UnBoundMode/UnBoundMode.xaml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/Samples/TreeView/UnBoundMode/UnBoundMode.xaml.cs b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Samples/TreeView/UnBoundMode/UnBoundMode.xaml.cs new file mode 100644 index 00000000..1b45c6c4 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/Samples/TreeView/UnBoundMode/UnBoundMode.xaml.cs @@ -0,0 +1,18 @@ +#region Copyright Syncfusion Inc. 2001-2023. +// Copyright Syncfusion Inc. 2001-2023. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using SampleBrowser.Maui.Base; + +namespace SampleBrowser.Maui.TreeView.SfTreeView; + +public partial class UnBoundMode : SampleView +{ + public UnBoundMode() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/SyncfusionLicense.txt b/MAUI/TreeView/SampleBrowser.Maui.TreeView/SyncfusionLicense.txt new file mode 100644 index 00000000..e69de29b diff --git a/MAUI/TreeView/SampleBrowser.Maui.TreeView/TreeViewSamplesList.xml b/MAUI/TreeView/SampleBrowser.Maui.TreeView/TreeViewSamplesList.xml new file mode 100644 index 00000000..dba795c3 --- /dev/null +++ b/MAUI/TreeView/SampleBrowser.Maui.TreeView/TreeViewSamplesList.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/MauiProgram.cs b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/MauiProgram.cs index 32fabdec..f328ac3d 100644 --- a/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/MauiProgram.cs +++ b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/MauiProgram.cs @@ -8,6 +8,7 @@ namespace SampleBrowser.Maui.XlsIO; using Syncfusion.Maui.Core.Hosting; +using SampleBrowser.Maui.Base.Hosting; public static class MauiProgram { public static MauiApp CreateMauiApp() @@ -21,7 +22,7 @@ public static class MauiProgram fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); }); - + builder.ConfigureSampleBrowserBase(); return builder.Build(); } } diff --git a/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Platforms/iOS/SaveIOS.cs b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Platforms/iOS/SaveIOS.cs index c8faa354..00d83c79 100644 --- a/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Platforms/iOS/SaveIOS.cs +++ b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Platforms/iOS/SaveIOS.cs @@ -35,7 +35,9 @@ namespace SampleBrowser.Maui.Services if (contentType != "application/html" || exception == string.Empty) { #pragma warning disable CA1416 //This call site is reachable on: 'iOS' 14.2 and later, 'maccatalyst' 14.2 and later. 'UIApplication.KeyWindow.get' is unsupported on: 'ios' 13.0 and later, 'maccatalyst' 13.0 and later. +#pragma warning disable CA1422 // Validate platform compatibility UIViewController? currentController = UIApplication.SharedApplication!.KeyWindow!.RootViewController; +#pragma warning disable CA1422 // Validate platform compatibility #pragma warning restore CA1416 //This call site is reachable on: 'iOS' 14.2 and later, 'maccatalyst' 14.2 and later. 'UIApplication.KeyWindow.get' is unsupported on: 'ios' 13.0 and later, 'maccatalyst' 13.0 and later. while (currentController!.PresentedViewController != null) currentController = currentController.PresentedViewController; diff --git a/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Resources/XlsIO/CommentsTemplate.xlsx b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Resources/XlsIO/CommentsTemplate.xlsx new file mode 100644 index 00000000..57dd3984 Binary files /dev/null and b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Resources/XlsIO/CommentsTemplate.xlsx differ diff --git a/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Resources/XlsIO/WhatIfAnalysisTemplate.xlsx b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Resources/XlsIO/WhatIfAnalysisTemplate.xlsx new file mode 100644 index 00000000..df5aa45c Binary files /dev/null and b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Resources/XlsIO/WhatIfAnalysisTemplate.xlsx differ diff --git a/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/SampleBrowser.Maui.XlsIO.csproj b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/SampleBrowser.Maui.XlsIO.csproj index 23d5d7c8..7ea0c1be 100644 --- a/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/SampleBrowser.Maui.XlsIO.csproj +++ b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/SampleBrowser.Maui.XlsIO.csproj @@ -119,11 +119,11 @@ - - - - - + + + + + @@ -139,6 +139,8 @@ + + diff --git a/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/SampleBrowser.Maui.XlsIO.props b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/SampleBrowser.Maui.XlsIO.props index 78f02be6..9d2a8d12 100644 --- a/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/SampleBrowser.Maui.XlsIO.props +++ b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/SampleBrowser.Maui.XlsIO.props @@ -60,6 +60,16 @@ Slicer.xaml + + Samples\XlsIO\WhatIfAnalysis\WhatIfAnalysis.xaml.cs + WhatIfAnalysis.xaml + + + + Samples\XlsIO\Comments\Comments.xaml.cs + Comments.xaml + + Services\Customer.cs @@ -131,6 +141,16 @@ Samples\XlsIO\Slicer\Slicer.xaml + + + Samples\XlsIO\WhatIfAnalysis\WhatIfAnalysis.xaml + + + + + Samples\XlsIO\Comments\Comments.xaml + + Resources\XlsIO\CLRObjects.xml @@ -155,6 +175,12 @@ Resources\XlsIO\TableSlicer.xlsx + + + Resources\XlsIO\WhatIfAnalysisTemplate.xlsx + + + Resources\XlsIO\CommentsTemplate.xlsx Resources\XlsIO\Template_Marker_Images\Man1.jpg diff --git a/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Samples/XlsIO/Comments/Comments.xaml b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Samples/XlsIO/Comments/Comments.xaml new file mode 100644 index 00000000..b5f20548 --- /dev/null +++ b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Samples/XlsIO/Comments/Comments.xaml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Samples/XlsIO/Comments/Comments.xaml.cs b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Samples/XlsIO/Comments/Comments.xaml.cs new file mode 100644 index 00000000..1a15d7ec --- /dev/null +++ b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Samples/XlsIO/Comments/Comments.xaml.cs @@ -0,0 +1,174 @@ +#region Copyright Syncfusion Inc. 2001-2019. +// Copyright Syncfusion Inc. 2001-2019. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Microsoft.Maui.Controls; +using SampleBrowser.Maui.Base; +using SampleBrowser.Maui.Services; +using Syncfusion.Pdf; +using Syncfusion.XlsIO; +using Syncfusion.XlsIORenderer; +using System; +using System.IO; +using System.Reflection; + +namespace SampleBrowser.Maui.XlsIO.XlsIO +{ + /// + /// Interaction logic for Comments.xaml + /// + public partial class Comments : SampleView + { + #region Constructor + /// + /// Comments constructor + /// + public Comments() + { + this.InitializeComponent(); +#if ANDROID || IOS + this.stkLayout.HorizontalOptions = Microsoft.Maui.Controls.LayoutOptions.Center; + this.btnInput.HorizontalOptions = Microsoft.Maui.Controls.LayoutOptions.Center; + this.btnCreate.HorizontalOptions = Microsoft.Maui.Controls.LayoutOptions.Center; + this.btnConvert.HorizontalOptions = Microsoft.Maui.Controls.LayoutOptions.Center; +#endif + } + #endregion + + #region Events + /// + /// Loads the input template + /// + /// contains a reference to the control/object that raised the event + /// contains the event data + private void btnInput_Click(object sender, EventArgs e) + { + string inputPath = "SampleBrowser.Maui.Resources.XlsIO.CommentsTemplate.xlsx"; + if (BaseConfig.IsIndividualSB) + inputPath = "SampleBrowser.Maui.XlsIO.Resources.XlsIO.CommentsTemplate.xlsx"; + Assembly? assembly = typeof(Comments).GetTypeInfo().Assembly; + Stream? input = assembly.GetManifestResourceStream(inputPath); + + if (input != null) + { + MemoryStream stream = new(); + input.CopyTo(stream); + + stream.Position = 0; + SaveService saveService = new(); + saveService.SaveAndView("CommentsTemplate.xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", stream); + + input.Dispose(); + } + } + + /// + /// Create Excel + /// + /// contains a reference to the control/object that raised the event + /// contains the event data + private void btnCreate_Click(object sender, EventArgs e) + { + //Initialize ExcelEngine + using (ExcelEngine excelEngine = new ExcelEngine()) + { + //Initialize IApplication and set the default application version + Syncfusion.XlsIO.IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + + //Load the Excel template into IWorkbook and get the worksheet into IWorksheet + string inputPath = "SampleBrowser.Maui.Resources.XlsIO.CommentsTemplate.xlsx"; + if (BaseConfig.IsIndividualSB) + inputPath = "SampleBrowser.Maui.XlsIO.Resources.XlsIO.CommentsTemplate.xlsx"; + Assembly? assembly = typeof(Comments).GetTypeInfo().Assembly; + Stream? input = assembly.GetManifestResourceStream(inputPath); + if (input != null) + { + IWorkbook workbook = application.Workbooks.Open(input); + IWorksheet worksheet = workbook.Worksheets[0]; + + //Add Comments + AddComments(worksheet); + + //Save the Excel file + MemoryStream stream = new MemoryStream(); + workbook.SaveAs(stream); + stream.Position = 0; + SaveService saveService = new SaveService(); + saveService.SaveAndView("ExcelComments.xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", stream); + + #region Close and Dispose + input.Dispose(); + stream.Dispose(); + #endregion + } + } + } + + /// + /// Convert To PDF + /// + /// contains a reference to the control/object that raised the event + /// contains the event data + private void btnConvert_Click(object sender, EventArgs e) + { + //Initialize ExcelEngine + using (ExcelEngine excelEngine = new ExcelEngine()) + { + //Initialize IApplication and set the default application version + Syncfusion.XlsIO.IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + + //Load the Excel template into IWorkbook and get the worksheet into IWorksheet + string inputPath = "SampleBrowser.Maui.Resources.XlsIO.CommentsTemplate.xlsx"; + if (BaseConfig.IsIndividualSB) + inputPath = "SampleBrowser.Maui.XlsIO.Resources.XlsIO.CommentsTemplate.xlsx"; + Assembly? assembly = typeof(Comments).GetTypeInfo().Assembly; + Stream? input = assembly.GetManifestResourceStream(inputPath); + if (input != null) + { + IWorkbook workbook = application.Workbooks.Open(input); + IWorksheet worksheet = workbook.Worksheets[0]; + + //Add Comments + AddComments(worksheet); + + //Set print location of comments + worksheet.PageSetup.PrintComments = ExcelPrintLocation.PrintSheetEnd; + + //Initialize XlsIORenderer and convert the Excel document to PDF + XlsIORenderer renderer = new XlsIORenderer(); + PdfDocument document = renderer.ConvertToPDF(workbook); + + //Save the Excel file + MemoryStream stream = new MemoryStream(); + document.Save(stream); + stream.Position = 0; + SaveService saveService = new SaveService(); + saveService.SaveAndView("ExcelComments.pdf", "application/pdf", stream); + + #region Close and Dispose + input.Dispose(); + stream.Dispose(); + #endregion + } + } + } + private void AddComments(IWorksheet worksheet) + { + //Add Comments (Notes) + IComment comment = worksheet.Range["H1"].AddComment(); + comment.Text = "This Total column comment will be printed at the end of sheet."; + comment.IsVisible = true; + + //Add Threaded Comments + IThreadedComment threadedComment = worksheet.Range["H16"].AddThreadedComment("What is the reason for the higher total amount of \"desk\" in the west region?", "User1", DateTime.Now); + threadedComment.AddReply("The unit cost of desk is higher compared to other items in the west region. As a result, the total amount is elevated.", "User2", DateTime.Now); + threadedComment.AddReply("Additionally, Wilson sold 31 desks in the west region, which is also a contributing factor to the increased total amount.", "User3", DateTime.Now); + } + #endregion + } +} \ No newline at end of file diff --git a/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Samples/XlsIO/WhatIfAnalysis/WhatIfAnalysis.xaml b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Samples/XlsIO/WhatIfAnalysis/WhatIfAnalysis.xaml new file mode 100644 index 00000000..67a18e7d --- /dev/null +++ b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Samples/XlsIO/WhatIfAnalysis/WhatIfAnalysis.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Samples/XlsIO/WhatIfAnalysis/WhatIfAnalysis.xaml.cs b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Samples/XlsIO/WhatIfAnalysis/WhatIfAnalysis.xaml.cs new file mode 100644 index 00000000..9f415956 --- /dev/null +++ b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/Samples/XlsIO/WhatIfAnalysis/WhatIfAnalysis.xaml.cs @@ -0,0 +1,130 @@ +#region Copyright Syncfusion Inc. 2001-2019. +// Copyright Syncfusion Inc. 2001-2019. All rights reserved. +// Use of this code is subject to the terms of our license. +// A copy of the current license can be obtained at any time by e-mailing +// licensing@syncfusion.com. Any infringement will be prosecuted under +// applicable laws. +#endregion +using Microsoft.Maui.Controls; +using SampleBrowser.Maui.Base; +using SampleBrowser.Maui.Services; +using Syncfusion.Pdf; +using Syncfusion.XlsIO; +using Syncfusion.XlsIORenderer; +using System; +using System.IO; +using System.Reflection; + +namespace SampleBrowser.Maui.XlsIO.XlsIO +{ + /// + /// Interaction logic for WhatIfAnalysis.xaml + /// + public partial class WhatIfAnalysis : SampleView + { + #region Constructor + /// + /// WhatIfAnalysis constructor + /// + public WhatIfAnalysis() + { + this.InitializeComponent(); +#if ANDROID || IOS + this.stkLayout.HorizontalOptions = Microsoft.Maui.Controls.LayoutOptions.Center; + this.btnInput.HorizontalOptions = Microsoft.Maui.Controls.LayoutOptions.Center; + this.btnCreate.HorizontalOptions = Microsoft.Maui.Controls.LayoutOptions.Center; +#endif + } + #endregion + + #region Events + /// + /// Loads the input template + /// + /// contains a reference to the control/object that raised the event + /// contains the event data + private void btnInput_Click(object sender, EventArgs e) + { + string inputPath = "SampleBrowser.Maui.Resources.XlsIO.WhatIfAnalysisTemplate.xlsx"; + if (BaseConfig.IsIndividualSB) + inputPath = "SampleBrowser.Maui.XlsIO.Resources.XlsIO.WhatIfAnalysisTemplate.xlsx"; + Assembly? assembly = typeof(WhatIfAnalysis).GetTypeInfo().Assembly; + Stream? input = assembly.GetManifestResourceStream(inputPath); + + if (input != null) + { + MemoryStream stream = new(); + input.CopyTo(stream); + + stream.Position = 0; + SaveService saveService = new(); + saveService.SaveAndView("WhatIfAnalysisTemplate.xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", stream); + + input.Dispose(); + } + } + + /// + /// Create Excel + /// + /// contains a reference to the control/object that raised the event + /// contains the event data + private void btnCreate_Click(object sender, EventArgs e) + { + //Initialize ExcelEngine + using (ExcelEngine excelEngine = new ExcelEngine()) + { + //Initialize IApplication and set the default application version + Syncfusion.XlsIO.IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + + //Load the Excel template into IWorkbook and get the worksheet into IWorksheet + string inputPath = "SampleBrowser.Maui.Resources.XlsIO.WhatIfAnalysisTemplate.xlsx"; + if (BaseConfig.IsIndividualSB) + inputPath = "SampleBrowser.Maui.XlsIO.Resources.XlsIO.WhatIfAnalysisTemplate.xlsx"; + Assembly? assembly = typeof(WhatIfAnalysis).GetTypeInfo().Assembly; + Stream? input = assembly.GetManifestResourceStream(inputPath); + if (input != null) + { + IWorkbook workbook = application.Workbooks.Open(input); + IWorksheet worksheet = workbook.Worksheets[0]; + + //Initailize list objects with different values for scenarios + List currentChange_Values = new List { 0.23, 0.8, 1.1, 0.5, 0.35, 0.2, 0.4, 0.37, 1.1, 1, 0.94, 0.75 }; + List increasedChange_Values = new List { 0.45, 0.56, 0.9, 0.5, 0.58, 0.43, 0.39, 0.89, 1.45, 1.2, 0.99, 0.8 }; + List decreasedChange_Values = new List { 0.3, 0.2, 0.5, 0.3, 0.5, 0.23, 0.2, 0.3, 0.8, 0.6, 0.87, 0.4 }; + + List currentQuantity_Values = new List { 1500, 3000, 5000, 4000, 500, 4000, 1200, 1500, 750, 750, 1200, 7900 }; + List increasedQuantity_Values = new List { 1000, 5000, 4500, 3900, 10000, 8900, 8000, 3500, 15000, 5500, 4500, 4200 }; + List decreasedQuantity_Values = new List { 1000, 2000, 3000, 3000, 300, 4000, 1200, 1000, 550, 650, 800, 6900 }; + + //Add scenarios in the worksheet + IScenarios scenarios = worksheet.Scenarios; + scenarios.Add("Current % of Change", worksheet.Range["F5:F16"], currentChange_Values); + scenarios.Add("Increased % of Change", worksheet.Range["F5:F16"], increasedChange_Values); + scenarios.Add("Decreased % of Change", worksheet.Range["F5:F16"], decreasedChange_Values); + + scenarios.Add("Current Quantity", worksheet.Range["D5:D16"], currentQuantity_Values); + scenarios.Add("Increased Quantity", worksheet.Range["D5:D16"], increasedQuantity_Values); + scenarios.Add("Decreased Quantity", worksheet.Range["D5:D16"], decreasedQuantity_Values); + + //Create Summary + worksheet.Scenarios.CreateSummary(worksheet.Range["L7"]); + + //Save the Excel file + MemoryStream stream = new MemoryStream(); + workbook.SaveAs(stream); + stream.Position = 0; + SaveService saveService = new SaveService(); + saveService.SaveAndView("WhatIfAnalysis.xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", stream); + + #region Close and Dispose + input.Dispose(); + stream.Dispose(); + #endregion + } + } + } + #endregion + } +} \ No newline at end of file diff --git a/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/XlsIOSamplesList.xml b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/XlsIOSamplesList.xml index 60e2cd7d..bba3ca16 100644 --- a/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/XlsIOSamplesList.xml +++ b/MAUI/XlsIO/SampleBrowser.Maui.XlsIO/XlsIOSamplesList.xml @@ -13,10 +13,14 @@ + + - - - + + + + + diff --git a/README.md b/README.md index 176cfd18..d6830dc2 100644 --- a/README.md +++ b/README.md @@ -536,4 +536,4 @@ Platforms supported by each .NET MAUI file-format library are listed below. * To renew the subscription, click [here](https://www.syncfusion.com/sales/products?utm_source=github&utm_medium=listing) or contact our sales team at . -Copyright © 2001-2023 Syncfusion, Inc. Updated on 2023-07-28 at precisely 13:11:18 EST. +Copyright © 2001-2023 Syncfusion, Inc. Updated on 2023-09-15 at precisely 16:34:44 EST.
Syncfusion
Sticky note
Copyright © 2001-2023 Syncfusion, Inc. Updated on 2023-07-28 at precisely 13:11:18 EST.
Copyright © 2001-2023 Syncfusion, Inc. Updated on 2023-09-15 at precisely 16:34:44 EST.