Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c3be868
update the sample
LogishaSelvarajSF4525 Dec 29, 2025
f5675c0
updated sample
LogishaSelvarajSF4525 Jan 20, 2026
5f40188
added the test cases
LogishaSelvarajSF4525 Feb 3, 2026
ebf86ed
updated the test cases
LogishaSelvarajSF4525 Feb 4, 2026
0ab81f3
added the test cases
LogishaSelvarajSF4525 Feb 6, 2026
48aaf0b
updated the test cases
LogishaSelvarajSF4525 Feb 13, 2026
e909374
updated the sample
LogishaSelvarajSF4525 Feb 13, 2026
2d3ed19
updated the Slider test cases
LogishaSelvarajSF4525 Feb 14, 2026
90b32af
updated the button test cases
LogishaSelvarajSF4525 Feb 15, 2026
efa5659
Updated the checkbox test cases
LogishaSelvarajSF4525 Feb 15, 2026
957ef0b
updated the switch test cases
LogishaSelvarajSF4525 Feb 15, 2026
c38ec6e
updated the label test cases
LogishaSelvarajSF4525 Feb 15, 2026
fc6af09
updated the Entry test cases
LogishaSelvarajSF4525 Feb 16, 2026
a3ce49b
updated the CV tests
LogishaSelvarajSF4525 Feb 16, 2026
1d33b59
added the snapshots for android
LogishaSelvarajSF4525 Feb 17, 2026
fd27d41
Updated the test cases
LogishaSelvarajSF4525 Feb 17, 2026
5578025
renamed the test cases
LogishaSelvarajSF4525 Feb 17, 2026
f16f083
updated the sample
LogishaSelvarajSF4525 Feb 19, 2026
6ca930e
updated the values
LogishaSelvarajSF4525 Feb 19, 2026
abd1648
updated the snapshot
LogishaSelvarajSF4525 Feb 20, 2026
9d0661a
updated the AI review concern
LogishaSelvarajSF4525 Feb 20, 2026
667fe12
updated the base images
LogishaSelvarajSF4525 Feb 20, 2026
a3455c9
updated the test cases
LogishaSelvarajSF4525 Feb 23, 2026
4179493
update the AI review concern
LogishaSelvarajSF4525 Feb 25, 2026
03028dc
updated the snapshot
LogishaSelvarajSF4525 Feb 26, 2026
f080a0b
Merge branch 'inflight/current' into logi-vsm-feature
kubaflo Mar 5, 2026
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
2 changes: 1 addition & 1 deletion eng/pipelines/common/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ parameters:
- 'SoftInput,Stepper,Switch,SwipeView'
- 'Shell'
- 'TabbedPage,TableView,TimePicker,TitleView,ToolbarItem'
- 'ViewBaseTests,Window'
- 'ViewBaseTests,VisualStateManager,Window'
- 'WebView'

projects:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public override string ToString()
new GalleryPageFactory(() => new IndicatorViewControlPage(), "IndicatorView Feature Matrix"),
new GalleryPageFactory(() => new GridControlPage(), "Grid Feature Matrix"),
new GalleryPageFactory(() => new LayoutFeaturePage(), "ScrollView With LayoutOptions Feature Matrix"),
new GalleryPageFactory(() => new VisualStateManagerFeaturePage(), "VisualStateManager Feature Matrix"),
new GalleryPageFactory(() => new ShellFeaturePage(), "Shell Feature Matrix"),
new GalleryPageFactory(() => new BrushesControlPage(), "Brushes Feature Matrix"),
new GalleryPageFactory(() => new BindableLayoutControlPage(), "BindableLayout Feature Matrix")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.VisualStateManagerButtonPage"
Title="VisualStateManagerButtonPage">
<ContentPage.Resources>
<!-- Button VSM demo -->
<Style TargetType="Button"
x:Key="VsmButtonStyle">
<Setter Property="Padding"
Value="14,10"/>
<Setter Property="BackgroundColor"
Value="#4A4A4A"/>
<Setter Property="TextColor"
Value="White"/>
<Setter Property="CornerRadius"
Value="8"/>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor"
Value="Blue"/>
<Setter Property="TextColor"
Value="White"/>
<Setter Property="Opacity"
Value="1"/>
<Setter Property="TranslationY"
Value="0"/>
<Setter Property="Scale"
Value="1.0"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Pressed">
<VisualState.Setters>
<Setter Property="BackgroundColor"
Value="Red"/>
<Setter Property="TextColor"
Value="White"/>
<Setter Property="Scale"
Value="1.5"/>
<Setter Property="TranslationY"
Value="1.4"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="BackgroundColor"
Value="#FFE1770C"/>
<Setter Property="TextColor"
Value="Black"/>
<Setter Property="Scale"
Value="1.3"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="BackgroundColor"
Value="#FFB4B3B3"/>
<Setter Property="TextColor"
Value="#FF65676D"/>
<Setter Property="Opacity"
Value="0.6"/>
<Setter Property="Scale"
Value="1.0"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Focused">
<VisualState.Setters>
<Setter Property="Scale"
Value="1.5"/>
<Setter Property="BackgroundColor"
Value="Green"/>
<Setter Property="TextColor"
Value="White"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
</ContentPage.Resources>

<VerticalStackLayout Padding="20"
Spacing="16">
<Label Text="VisualStateManager Feature Matrix"
FontSize="20"/>

<VerticalStackLayout Padding="12"
Spacing="8">
<Label Text="Button States (Normal / Pressed / PointerOver / Disabled)"
FontAttributes="Bold"/>
<Button x:Name="DemoButton"
AutomationId="DemoButton"
Text="Press me"
Style="{StaticResource VsmButtonStyle}"
Pressed="OnDemoButtonPressed"
Released="OnDemoButtonReleased"
Focused="OnButtonFocused">
<Button.GestureRecognizers>
<PointerGestureRecognizer PointerEntered="OnDemoButtonPointerEntered"
PointerExited="OnDemoButtonPointerExited"/>
</Button.GestureRecognizers>
</Button>

<Label x:Name="StateLabel"
AutomationId="ButtonStateLabel"
Text="State: Normal"
FontSize="14"
TextColor="#111827"/>
<HorizontalStackLayout Spacing="10">
<Button x:Name="ButtonDisableButton"
Text="Disable"
AutomationId="ButtonDisable"
Clicked="OnToggleButtonDisabled"/>
<Button Text="Reset"
AutomationId="ButtonReset"
Clicked="OnResetButtonState"/>
</HorizontalStackLayout>
</VerticalStackLayout>
</VerticalStackLayout>
</ContentPage>

Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
namespace Maui.Controls.Sample;

public partial class VisualStateManagerButtonPage : ContentPage
{
public VisualStateManagerButtonPage()
{
InitializeComponent();
VisualStateManager.GoToState(DemoButton, "Normal");
}

void OnDemoButtonPressed(object sender, EventArgs e)
{
if (!DemoButton.IsEnabled)
return;
VisualStateManager.GoToState(DemoButton, "Pressed");
StateLabel.Text = "State: Pressed";
DemoButton.Text = "Pressed";
}

void OnDemoButtonReleased(object sender, EventArgs e)
{
if (!DemoButton.IsEnabled)
return;
VisualStateManager.GoToState(DemoButton, "Normal");
StateLabel.Text = "State: Normal/Released";
DemoButton.Text = "Normal/Released";
}

void OnToggleButtonDisabled(object sender, EventArgs e)
{
DemoButton.IsEnabled = !DemoButton.IsEnabled;
ButtonDisableButton.Text = DemoButton.IsEnabled ? "Disable" : "Enable";
if (!DemoButton.IsEnabled)
{
VisualStateManager.GoToState(DemoButton, "Disabled");
StateLabel.Text = "State: Disabled";
DemoButton.Text = "Disabled";
}
else
{
VisualStateManager.GoToState(DemoButton, "Normal");
StateLabel.Text = "State: Normal";
DemoButton.Text = "Normal";
}
}

void OnResetButtonState(object sender, EventArgs e)
{
DemoButton.IsEnabled = true;
VisualStateManager.GoToState(DemoButton, "Normal");
ButtonDisableButton.Text = "Disable";
StateLabel.Text = "State: Normal";
DemoButton.Text = "Press Me";
}

void OnDemoButtonPointerEntered(object sender, PointerEventArgs e)
{
if (!DemoButton.IsEnabled)
return;
VisualStateManager.GoToState(DemoButton, "PointerOver");
StateLabel.Text = "State: PointerOver Enter";
DemoButton.Text = "PointerOver Enter";
}

void OnDemoButtonPointerExited(object sender, PointerEventArgs e)
{
if (!DemoButton.IsEnabled)
return;
VisualStateManager.GoToState(DemoButton, "Normal");
StateLabel.Text = "State: PointerOver Exit";
DemoButton.Text = "PointerOver Exit";
}

void OnButtonFocused(object sender, FocusEventArgs e)
{
if (!DemoButton.IsEnabled)
return;
VisualStateManager.GoToState(DemoButton, "Focused");
StateLabel.Text = "State: Focused";
DemoButton.Text = "Focused";
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.VisualStateManagerCheckBoxPage"
Title="VisualStateManagerCheckBoxPage">
<ContentPage.Resources>
<Style TargetType="CheckBox" x:Key="VsmCheckBoxStyle">
<Setter Property="Color" Value="#374151" />
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="Opacity" Value="1" />
<Setter Property="Scale" Value="1.0" />
<Setter Property="Color" Value="#FF1F64D4" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="Opacity" Value="0.6" />
<Setter Property="Scale" Value="1.0" />
<Setter Property="Color" Value="#FF9CA3AF" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="CheckStates">
<VisualState x:Name="Checked">
<VisualState.Setters>
<Setter Property="Color" Value="#FF25DF2E" />
<Setter Property="Scale" Value="1.5" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Unchecked">
<VisualState.Setters>
<Setter Property="Color" Value="#FFC9150B" />
<Setter Property="Scale" Value="1.25" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
</ContentPage.Resources>

<VerticalStackLayout Padding="20" Spacing="16">
<Label Text="VisualStateManager Feature Matrix" FontSize="20" />

<VerticalStackLayout Padding="12" Spacing="8">
<Label Text="CheckBox States (Checked / Unchecked / Disabled)" FontAttributes="Bold" />
<HorizontalStackLayout Spacing="10" VerticalOptions="Center">
<CheckBox x:Name="VSMCheckBox" AutomationId="VSMCheckBox" Style="{StaticResource VsmCheckBoxStyle}" CheckedChanged="OnCheckBoxCheckedChanged" />
<Label x:Name="CheckBoxState" AutomationId="CheckBoxState" Text="State: Unchecked" VerticalOptions="Center" />
</HorizontalStackLayout>
<HorizontalStackLayout Spacing="10">
<Button x:Name="CheckBoxDisableButton" Text="Disable" AutomationId="CheckBoxDisable" Clicked="OnToggleCheckBoxDisabled" />
<Button Text="Reset" AutomationId="CheckBoxReset" Clicked="OnResetCheckBox" />
</HorizontalStackLayout>
</VerticalStackLayout>
</VerticalStackLayout>
</ContentPage>

Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
namespace Maui.Controls.Sample;

public partial class VisualStateManagerCheckBoxPage : ContentPage
{
public VisualStateManagerCheckBoxPage()
{
InitializeComponent();
VisualStateManager.GoToState(VSMCheckBox, "Normal");
CheckBoxState.Text = "State: Normal";
}

void OnCheckBoxCheckedChanged(object sender, CheckedChangedEventArgs e)
{
if (!VSMCheckBox.IsEnabled)
{
CheckBoxState.Text = "State: Disabled";
return;
}

var state = e.Value ? "Checked" : "Unchecked";
VisualStateManager.GoToState(VSMCheckBox, state);
CheckBoxState.Text = $"State: {state}";
}

void OnToggleCheckBoxDisabled(object sender, EventArgs e)
{
VSMCheckBox.IsEnabled = !VSMCheckBox.IsEnabled;
CheckBoxDisableButton.Text = VSMCheckBox.IsEnabled ? "Disable" : "Enable";
if (!VSMCheckBox.IsEnabled)
{
VisualStateManager.GoToState(VSMCheckBox, "Disabled");
CheckBoxState.Text = "State: Disabled";
}
else
{
var state = VSMCheckBox.IsChecked ? "Checked" : "Unchecked";
VisualStateManager.GoToState(VSMCheckBox, state);
CheckBoxState.Text = $"State: {state}";
}
}

void OnResetCheckBox(object sender, EventArgs e)
{
VSMCheckBox.IsEnabled = true;
VSMCheckBox.IsChecked = false;
CheckBoxDisableButton.Text = "Disable";
VisualStateManager.GoToState(VSMCheckBox, "Normal");
CheckBoxState.Text = "State: Normal";
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System.Collections.ObjectModel;

namespace Maui.Controls.Sample;

public class VSMCollectionViewItem
{
public string Name { get; set; } = string.Empty;
}

public class VSMCollectionViewViewModel
{
public ObservableCollection<VSMCollectionViewItem> Items { get; }

public VSMCollectionViewViewModel()
{
Items = new ObservableCollection<VSMCollectionViewItem>
{
new VSMCollectionViewItem { Name = "Banana" },
new VSMCollectionViewItem { Name = "Cherry" },
new VSMCollectionViewItem { Name = "Date" },
new VSMCollectionViewItem { Name = "Elderberry" },
new VSMCollectionViewItem { Name = "Fig" },
new VSMCollectionViewItem { Name = "Grape" },
new VSMCollectionViewItem { Name = "Honeydew" }
};
}
}

Loading