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.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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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 @@ - + 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 @@ - - -