Skip to content

[housekeeping] Automated PR to fix formatting errors on inflight/current #30184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static partial class WebViewHelpers
public static async Task WaitForWebViewReady(WebView2 wv2)
{
CoreWebView2 coreWebView2 = null;

// Ensure that the WebView2 runtime is installed and initialized and has a CoreWebView2 instance.
if (wv2?.CoreWebView2 == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,10 @@ protected bool IsBackButtonVisible(IElementHandler handler)
protected void AssertTranslationMatches(Android.Views.View nativeView, double expectedTranslationX, double expectedTranslationY)
{
var context = nativeView?.Context ?? throw new InvalidOperationException("Context cannot be null.");

var expectedXInPixels = context.ToPixels(expectedTranslationX);
Assert.Equal(expectedXInPixels, nativeView.TranslationX, precision: 1);

var expectedYInPixels = context.ToPixels(expectedTranslationY);
Assert.Equal(expectedYInPixels, nativeView.TranslationY, precision: 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Task<bool> GetPlatformIsVisible(ShapeViewHandler boxViewViewHandler)
return nativeView.Visibility == Android.Views.ViewStates.Visible;
});
}

//src/Compatibility/Core/tests/Android/TranslationTests.cs
[Fact]
[Description("The Translation property of a BoxView should match with native Translation")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Task<bool> GetPlatformIsVisible(CheckBoxHandler checkBoxHandler)
return nativeView.Visibility == Android.Views.ViewStates.Visible;
});
}

//src/Compatibility/Core/tests/Android/TranslationTests.cs
[Fact]
[Description("The Translation property of a CheckBox should match with native Translation")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
namespace Maui.Controls.Sample;

public class ImageViewModel : INotifyPropertyChanged
Expand Down Expand Up @@ -117,40 +117,40 @@ private void UpdateFontImageSource()
}
}

public bool HasShadow
{
get => _hasShadow;
set
{
if (_hasShadow != value)
{
_hasShadow = value;
ImageShadow = value
? new Shadow
{
Radius = 10,
Opacity = 1.0f,
Brush = Colors.Black.AsPaint(),
Offset = new Point(5, 5)
}
: null;
OnPropertyChanged(nameof(HasShadow));
}
}
}

public Shadow ImageShadow
{
get => _imageShadow;
private set
{
if (_imageShadow != value)
{
_imageShadow = value;
OnPropertyChanged(nameof(ImageShadow));
}
}
}
public bool HasShadow
{
get => _hasShadow;
set
{
if (_hasShadow != value)
{
_hasShadow = value;
ImageShadow = value
? new Shadow
{
Radius = 10,
Opacity = 1.0f,
Brush = Colors.Black.AsPaint(),
Offset = new Point(5, 5)
}
: null;
OnPropertyChanged(nameof(HasShadow));
}
}
}

public Shadow ImageShadow
{
get => _imageShadow;
private set
{
if (_imageShadow != value)
{
_imageShadow = value;
OnPropertyChanged(nameof(ImageShadow));
}
}
}

public event PropertyChangedEventHandler PropertyChanged;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ private void OnImageButtonClicked(object sender, EventArgs e)
{
_viewModel.ClickTotal++;
_viewModel.IsButtonClicked = true;
}
}

private void OnImageButtonPressed(object sender, EventArgs e)
{
_viewModel.PressedTotal++;
_viewModel.IsButtonClicked = true;
}
}

private void OnImageButtonReleased(object sender, EventArgs e)
{
_viewModel.ReleasedTotal++;
_viewModel.IsButtonClicked = true;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ private void OnCornerRadiusChanged(object sender, TextChangedEventArgs e)
int.TryParse(parts[2], out int bottomLeft) &&
int.TryParse(parts[3], out int bottomRight))
{
_viewModel.CornerRadius = topLeft;
_viewModel.CornerRadius = topLeft;
}
else if (parts.Length == 1 && int.TryParse(parts[0], out int uniform))
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Controls;
using System.Windows.Input;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;

namespace Maui.Controls.Sample;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,110 +2,110 @@ namespace Maui.Controls.Sample;

public partial class ProgressBarControlPage : ContentPage
{
private ProgressBarViewModel _viewModel;
private ProgressBar progressBar;
private ProgressBarViewModel _viewModel;
private ProgressBar progressBar;

public ProgressBarControlPage()
{
InitializeComponent();
_viewModel = new ProgressBarViewModel();
BindingContext = _viewModel;
}
public ProgressBarControlPage()
{
InitializeComponent();
_viewModel = new ProgressBarViewModel();
BindingContext = _viewModel;
}

private void ReinitializeProgressBar()
{
BindingContext = _viewModel = new ProgressBarViewModel();
ProgressBarGrid.Children.Clear();
progressBar = new ProgressBar
{
AutomationId = "ProgressBarControl",
};
private void ReinitializeProgressBar()
{
BindingContext = _viewModel = new ProgressBarViewModel();
ProgressBarGrid.Children.Clear();
progressBar = new ProgressBar
{
AutomationId = "ProgressBarControl",
};

progressBar.SetBinding(ProgressBar.BackgroundColorProperty, nameof(ProgressBarViewModel.BackgroundColor));
progressBar.SetBinding(ProgressBar.FlowDirectionProperty, nameof(ProgressBarViewModel.FlowDirection));
progressBar.SetBinding(ProgressBar.IsVisibleProperty, nameof(ProgressBarViewModel.IsVisible));
progressBar.SetBinding(ProgressBar.ProgressProperty, nameof(ProgressBarViewModel.Progress));
progressBar.SetBinding(ProgressBar.ProgressColorProperty, nameof(ProgressBarViewModel.ProgressColor));
progressBar.SetBinding(ProgressBar.ShadowProperty, nameof(ProgressBarViewModel.Shadow));
ProgressBarGrid.Children.Add(progressBar);
}
progressBar.SetBinding(ProgressBar.BackgroundColorProperty, nameof(ProgressBarViewModel.BackgroundColor));
progressBar.SetBinding(ProgressBar.FlowDirectionProperty, nameof(ProgressBarViewModel.FlowDirection));
progressBar.SetBinding(ProgressBar.IsVisibleProperty, nameof(ProgressBarViewModel.IsVisible));
progressBar.SetBinding(ProgressBar.ProgressProperty, nameof(ProgressBarViewModel.Progress));
progressBar.SetBinding(ProgressBar.ProgressColorProperty, nameof(ProgressBarViewModel.ProgressColor));
progressBar.SetBinding(ProgressBar.ShadowProperty, nameof(ProgressBarViewModel.Shadow));
ProgressBarGrid.Children.Add(progressBar);
}

private void OnProgressChanged(object sender, TextChangedEventArgs e)
{
if (double.TryParse(ProgressEntry.Text, out double progress))
{
_viewModel.Progress = progress;
}
}
private void OnProgressChanged(object sender, TextChangedEventArgs e)
{
if (double.TryParse(ProgressEntry.Text, out double progress))
{
_viewModel.Progress = progress;
}
}

private void ProgressColorButton_Clicked(object sender, EventArgs e)
{
var button = (Button)sender;
if (button.Text == "Green")
_viewModel.ProgressColor = Colors.Green;
else if (button.Text == "Red")
_viewModel.ProgressColor = Colors.Red;
}
private void ProgressColorButton_Clicked(object sender, EventArgs e)
{
var button = (Button)sender;
if (button.Text == "Green")
_viewModel.ProgressColor = Colors.Green;
else if (button.Text == "Red")
_viewModel.ProgressColor = Colors.Red;
}

private void BackgroundColorButton_Clicked(object sender, EventArgs e)
{
var button = (Button)sender;
if (button.Text == "Orange")
_viewModel.BackgroundColor = Colors.Orange;
else if (button.Text == "Light Blue")
_viewModel.BackgroundColor = Colors.LightBlue;
}
private void BackgroundColorButton_Clicked(object sender, EventArgs e)
{
var button = (Button)sender;
if (button.Text == "Orange")
_viewModel.BackgroundColor = Colors.Orange;
else if (button.Text == "Light Blue")
_viewModel.BackgroundColor = Colors.LightBlue;
}

private void OnIsVisibleCheckedChanged(object sender, CheckedChangedEventArgs e)
{
var radioButton = sender as RadioButton;
if (radioButton != null && radioButton.IsChecked)
{
_viewModel.IsVisible = false;
}
}
private void OnIsVisibleCheckedChanged(object sender, CheckedChangedEventArgs e)
{
var radioButton = sender as RadioButton;
if (radioButton != null && radioButton.IsChecked)
{
_viewModel.IsVisible = false;
}
}

private void OnFlowDirectionChanged(object sender, EventArgs e)
{
var radioButton = sender as RadioButton;
if (radioButton != null && radioButton.IsChecked)
{
_viewModel.FlowDirection = radioButton.Content.ToString() == "LTR" ? FlowDirection.LeftToRight : FlowDirection.RightToLeft;
}
}
private void OnFlowDirectionChanged(object sender, EventArgs e)
{
var radioButton = sender as RadioButton;
if (radioButton != null && radioButton.IsChecked)
{
_viewModel.FlowDirection = radioButton.Content.ToString() == "LTR" ? FlowDirection.LeftToRight : FlowDirection.RightToLeft;
}
}

private void OnShadowCheckedChanged(object sender, CheckedChangedEventArgs e)
{
var radioButton = (RadioButton)sender;
if (radioButton != null && radioButton.IsChecked)
{
_viewModel.Shadow = new Shadow { Brush = Colors.Violet, Radius = 20, Offset = new Point(0, 0), Opacity = 1f };
}
}
private void OnShadowCheckedChanged(object sender, CheckedChangedEventArgs e)
{
var radioButton = (RadioButton)sender;
if (radioButton != null && radioButton.IsChecked)
{
_viewModel.Shadow = new Shadow { Brush = Colors.Violet, Radius = 20, Offset = new Point(0, 0), Opacity = 1f };
}
}

private void ProgressToButton_Clicked(object sender, EventArgs e)
{
if (!string.IsNullOrWhiteSpace(ProgressToEntry.Text))
{
if (progressBar == null)
{
progressBarControl.ProgressTo(double.Parse(ProgressToEntry.Text), 1000, Easing.Linear);
}
else
{
progressBar.ProgressTo(double.Parse(ProgressToEntry.Text), 1000, Easing.Linear);
}
}
}
private void ProgressToButton_Clicked(object sender, EventArgs e)
{
if (!string.IsNullOrWhiteSpace(ProgressToEntry.Text))
{
if (progressBar == null)
{
progressBarControl.ProgressTo(double.Parse(ProgressToEntry.Text), 1000, Easing.Linear);
}
else
{
progressBar.ProgressTo(double.Parse(ProgressToEntry.Text), 1000, Easing.Linear);
}
}
}

private void ResetButton_Clicked(object sender, EventArgs e)
{
ProgressEntry.Text = "0.50";
ProgressToEntry.Text = "0";
IsVisibleTrueRadio.IsChecked = false;
FlowDirectionLTR.IsChecked = false;
FlowDirectionRTL.IsChecked = false;
ShadowFalseRadio.IsChecked = false;
ReinitializeProgressBar();
}
private void ResetButton_Clicked(object sender, EventArgs e)
{
ProgressEntry.Text = "0.50";
ProgressToEntry.Text = "0";
IsVisibleTrueRadio.IsChecked = false;
FlowDirectionLTR.IsChecked = false;
FlowDirectionRTL.IsChecked = false;
ShadowFalseRadio.IsChecked = false;
ReinitializeProgressBar();
}
}
Loading