Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
05235c3
Added sample for GraphicsView
nivetha-nagalingam Jun 3, 2025
a700379
Added the feature matrix code
nivetha-nagalingam Jun 5, 2025
bb00fb2
Added the test cases for the GraphicsView
nivetha-nagalingam Jul 16, 2025
aaaf0fa
Updated the GraphicsViewFeaturetests
nivetha-nagalingam Jul 17, 2025
fd14226
Updated the GraphicsViewViewModel
nivetha-nagalingam Jul 22, 2025
de53d8b
Addressed the feedbacks
nivetha-nagalingam Jul 23, 2025
c63daa7
Added the snapshots for Mac and Windows
nivetha-nagalingam Jul 24, 2025
c4304b1
Remove .NET 8 specific code for templates (#30342)
jfversluis Jul 1, 2025
5f0562f
[Catalyst] Fix Scrollbar does not align with FlowDirection change in …
devanathan-vaithiyanathan Jul 1, 2025
2ef0c29
[Android] Fix for OnSizeAllocated is not reported for Android AppShel…
BagavathiPerumal Jul 1, 2025
ee49d49
Permissions (BT & WiFi): don't add AccessFineLocation to required per…
janusw Jul 1, 2025
cf37f69
Fixed the RealParent Warning shown issue (#30156)
Ahamed-Ali Jul 2, 2025
1fbc55b
[iOS/MacCatalyst] Fix: Setting SelectedItem Programmatically and Then…
bhavanesh2001 Jul 2, 2025
d2958ab
[Windows] Fixed StackLayout crashes on Windows with HeightRequest as …
Dhivya-SF4094 Jul 3, 2025
3f7e0c7
[Windows] Fixed CanvasDrawingSession Exception on Clipping Image (#30…
SubhikshaSf4851 Jul 3, 2025
2829771
[Testing] Feature matrix UITest Cases for ScrollView Control (#30188)
NafeelaNazhir Jul 3, 2025
7139d79
[Testing] Feature Matrix UITest Cases for TimePicker Control (#30271)
TamilarasanSF4853 Jul 3, 2025
298026e
[Catalyst] Adding and Removing ContextMenus currently does not work -…
kubaflo Jul 3, 2025
035511a
Fix for TapGestureRecognizer ButtonMask always return 0 (#30372)
HarishwaranVijayakumar Jul 3, 2025
3e88551
fix extention typo (#30461)
SimonCropp Jul 10, 2025
d15e9f3
fix some incorrect casting using `as` (#30459)
SimonCropp Jul 10, 2025
ba55986
[Testing] Feature Matrix UITest Cases for SearchBar Control (#30398)
TamilarasanSF4853 Jul 10, 2025
4865e69
[Testing] Feature Matrix UITest Cases for DatePicker Control (#30159)
TamilarasanSF4853 Jul 10, 2025
891f48d
[create-pull-request] automated change (#30591)
github-actions[bot] Jul 14, 2025
cb9600c
[Testing] Add UITest for Issue30147 on iOS (#30506)
devanathan-vaithiyanathan Jul 17, 2025
18f7dd5
[Android] Fix for Search Handler visual and functional bug in subtabs…
BagavathiPerumal Jul 17, 2025
e05fd26
[Windows] Fixed the Pasted Password Becomes Visible When IsPassword I…
Ahamed-Ali Jul 17, 2025
c72d8ac
[create-pull-request] automated change (#30700)
github-actions[bot] Jul 18, 2025
ad5a9ab
Fixed GraphicsView event handlers are triggered even when IsEnabled i…
Dhivya-SF4094 Jul 25, 2025
ae0f900
Merge branch 'inflight/current' into nivetha-nagalingam-GraphicsView
PureWeen Jul 25, 2025
b22d957
Fix duplicate app icon resizing (#30920)
jeremy-visionaid Jul 31, 2025
da2be4c
Addressed the feedbacks
nivetha-nagalingam Jul 31, 2025
a591bd1
Merge branch 'nivetha-nagalingam-GraphicsView' of https://github.com/…
nivetha-nagalingam Jul 31, 2025
1c8d546
Added sample for GraphicsView
nivetha-nagalingam Jun 3, 2025
d8893aa
Added the feature matrix code
nivetha-nagalingam Jun 5, 2025
65d3ab6
Added the test cases for the GraphicsView
nivetha-nagalingam Jul 16, 2025
166d4d9
Updated the GraphicsViewFeaturetests
nivetha-nagalingam Jul 17, 2025
7514fdf
Updated the GraphicsViewViewModel
nivetha-nagalingam Jul 22, 2025
8472a5f
Addressed the feedbacks
nivetha-nagalingam Jul 23, 2025
37494d5
Added the snapshots for Mac and Windows
nivetha-nagalingam Jul 24, 2025
2b78e6e
Addressed the feedbacks
nivetha-nagalingam Jul 31, 2025
d38e812
Merge branch 'nivetha-nagalingam-GraphicsView' of https://github.com/…
nivetha-nagalingam Jul 31, 2025
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
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 @@ -97,6 +97,7 @@ public override string ToString()
new GalleryPageFactory(() => new BoxViewControlPage(), "BoxView Feature Matrix"),
new GalleryPageFactory(() => new HybridWebViewControlPage(), "HybridWebView Feature Matrix"),
new GalleryPageFactory(() => new ScrollViewControlPage(), "ScrollView Feature Matrix"),
new GalleryPageFactory(() => new GraphicsViewControlPage(), "GraphicsView Feature Matrix"),
};

public CorePageView(Page rootPage)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?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"
xmlns:local="clr-namespace:Maui.Controls.Sample"
x:Class="Maui.Controls.Sample.GraphicsViewControlMainPage"
Title="GraphicsViewFeature">

<ContentPage.ToolbarItems>
<ToolbarItem Text="Options"
Clicked="NavigateToOptionsPage_Clicked"
AutomationId="Options"/>
</ContentPage.ToolbarItems>

<Grid Padding="20"
RowDefinitions="Auto, Auto, Auto, Auto, Auto, Auto, Auto, Auto"
ColumnDefinitions="0.5*, 0.5*"
RowSpacing="10">
<!-- GraphicsView Control -->
<GraphicsView x:Name="graphicsView"
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="2"
Drawable="{Binding Drawable}"
IsVisible="{Binding IsVisible}"
IsEnabled="{Binding IsEnabled}"
FlowDirection="{Binding FlowDirection}"
Shadow="{Binding Shadow}"
HeightRequest="{Binding HeightRequest}"
WidthRequest="{Binding WidthRequest}"
StartHoverInteraction="OnStartHoverInteraction"
MoveHoverInteraction="OnMoveHoverInteraction"
EndHoverInteraction="OnEndHoverInteraction"
StartInteraction="OnStartInteraction"
DragInteraction="OnDragInteraction"
EndInteraction="OnEndInteraction"
CancelInteraction="OnCancelInteraction"
Margin="0,100,0,100"
AutomationId="GraphicsViewControl"/>

<!-- Drawable Type -->
<Label Grid.Row="1"
Grid.Column="0"
Text="Drawable Type:"
FontSize="16"
VerticalTextAlignment="Start"
HorizontalTextAlignment="Start"
Margin="80,0,10,10"/>
<Label Grid.Row="1"
Grid.Column="1"
Text="{Binding DrawableTypeLabel}"
FontSize="16"
VerticalTextAlignment="Start"
HorizontalTextAlignment="Start"
AutomationId="DrawableTypeLabel"/>

<Label Grid.Row="2"
Grid.Column="0"
FontSize="16"
Text="Triggered Events:"
IsVisible="{Binding IsEventStatusLabelVisible}"
VerticalTextAlignment="Start"
HorizontalTextAlignment="Start"
Margin="80,0,10,10"/>

<Label Grid.Row="2"
Grid.Column="1"
Text="{Binding InteractionEvent}"
FontSize="14"
VerticalTextAlignment="Start"
HorizontalTextAlignment="Start"
Margin="0,0,10,10"
LineBreakMode="WordWrap"
MaxLines="10"
AutomationId="InteractionEventLabel"/>

<Label Grid.Row="3" Grid.Column="0" Text="Drawable Dimensions:" FontSize="16" VerticalTextAlignment="Start" HorizontalTextAlignment="Start" Margin="80,0,10,10" />
<Label Grid.Row="3" Grid.Column="1" Text="{Binding DrawableDimensions}" FontSize="16" VerticalTextAlignment="Start" HorizontalTextAlignment="Start" AutomationId="DrawableDimensionsLabel" />

<!-- Clear Events Button -->
<Button Grid.Row="4"
Grid.Column="0"
Text="Clear Events"
Clicked="OnClearEventsClicked"
BackgroundColor="LightCoral"
TextColor="White"
FontSize="14"
Margin="80,5,10,5"
AutomationId="ClearEventsButton"/>

<!-- Invalidate Button -->
<Button Grid.Row="4"
Grid.Column="1"
Text="Invalidate GraphicsView"
Clicked="OnInvalidateClicked"
BackgroundColor="LightBlue"
TextColor="DarkBlue"
FontSize="14"
Margin="10,5,80,5"
AutomationId="InvalidateButton"/>

</Grid>
</ContentPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
using System;
using System.ComponentModel;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
using System.Diagnostics;

namespace Maui.Controls.Sample;

public class GraphicsViewControlPage : NavigationPage
{
private GraphicsViewViewModel _viewModel;

public GraphicsViewControlPage()
{
_viewModel = new GraphicsViewViewModel();
PushAsync(new GraphicsViewControlMainPage(_viewModel));
}
}

public partial class GraphicsViewControlMainPage : ContentPage
{
private GraphicsViewViewModel _viewModel;

public GraphicsViewControlMainPage(GraphicsViewViewModel viewModel)
{
InitializeComponent();
_viewModel = viewModel;
BindingContext = _viewModel;

// Ensure GraphicsView invalidates when drawable changes
_viewModel.RequestInvalidate = () => graphicsView.Invalidate();

// Set default drawable
_viewModel.SelectedDrawable = DrawableType.Square;
}

private async void NavigateToOptionsPage_Clicked(object sender, EventArgs e)
{
BindingContext = _viewModel = new GraphicsViewViewModel(); // Ensure the ViewModel is set for the options page
await Navigation.PushAsync(new GraphicsViewOptionsPage(_viewModel));
}

private void OnStartHoverInteraction(object sender, TouchEventArgs e)
{
_viewModel.AddInteractionEvent("StartHoverInteraction");
}

private void OnMoveHoverInteraction(object sender, TouchEventArgs e)
{
_viewModel.AddInteractionEvent("MoveHoverInteraction");
}

private void OnEndHoverInteraction(object sender, EventArgs e)
{
_viewModel.AddInteractionEvent("EndHoverInteraction");
}

private void OnStartInteraction(object sender, TouchEventArgs e)
{
_viewModel.AddInteractionEvent("StartInteraction");
}

private void OnDragInteraction(object sender, TouchEventArgs e)
{
_viewModel.AddInteractionEvent("DragInteraction");
}

private void OnEndInteraction(object sender, EventArgs e)
{
_viewModel.AddInteractionEvent("EndInteraction");
}

private void OnCancelInteraction(object sender, EventArgs e)
{
_viewModel.AddInteractionEvent("CancelInteraction");
}

private void OnInvalidateClicked(object sender, EventArgs e)
{
// Use a constant color for consistent screenshot testing
_viewModel.CurrentDrawColor = Colors.Green;

// Call Invalidate on the GraphicsView to force a redraw
graphicsView.Invalidate();

// Add the invalidate event to the history with color information
_viewModel.AddInteractionEvent($"Invalidate() called - Color changed to {_viewModel.CurrentDrawColor}");
}

private void OnClearEventsClicked(object sender, EventArgs e)
{
// Clear the interaction event history
_viewModel.ClearInteractionHistory();
}

private void DisplayStoredDimensions()
{
var dimensions = _viewModel.GetDrawableDimensions(_viewModel.SelectedDrawable);
if (dimensions.HasValue)
{
Debug.WriteLine($"Stored Dimensions for {_viewModel.SelectedDrawable}: Width = {dimensions.Value.Width}, Height = {dimensions.Value.Height}");
}
else
{
Debug.WriteLine($"No stored dimensions found for {_viewModel.SelectedDrawable}.");
}
}

protected override void OnAppearing()
{
base.OnAppearing();
DisplayStoredDimensions();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<?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"
xmlns:local="clr-namespace:Maui.Controls.Sample"
x:Class="Maui.Controls.Sample.GraphicsViewOptionsPage"
Title="GraphicsViewFeature">
<ContentPage.ToolbarItems>
<ToolbarItem Text="Apply"
Clicked="ApplyButton_Clicked"
AutomationId="Apply"/>
</ContentPage.ToolbarItems>

<Grid Padding="10"
ColumnDefinitions="*, *"
RowDefinitions="Auto, Auto, Auto, Auto, Auto, Auto, Auto, Auto"
ColumnSpacing="15">
<!-- Left Column -->
<StackLayout Grid.Column="0"
Padding="10"
Spacing="8">

<Label Text="Drawable Type:"
FontSize="15"/>
<StackLayout Orientation="Vertical">
<RadioButton x:Name="DrawableSquare"
AutomationId="Square"
GroupName="DrawableType"
Content="Square"
IsChecked="True"
CheckedChanged="OnDrawableChanged"/>
<RadioButton x:Name="DrawableTriangle"
AutomationId="Triangle"
GroupName="DrawableType"
Content="Triangle"
CheckedChanged="OnDrawableChanged"/>
<RadioButton x:Name="DrawableEllipse"
AutomationId="Ellipse"
GroupName="DrawableType"
Content="Ellipse"
CheckedChanged="OnDrawableChanged"/>
<RadioButton x:Name="DrawableLine"
AutomationId="Line"
GroupName="DrawableType"
Content="Line"
CheckedChanged="OnDrawableChanged"/>
<RadioButton x:Name="DrawableString"
AutomationId="String"
GroupName="DrawableType"
Content="String"
CheckedChanged="OnDrawableChanged"/>
<RadioButton x:Name="DrawableImage"
AutomationId="Image"
GroupName="DrawableType"
Content="Image"
CheckedChanged="OnDrawableChanged"/>
<RadioButton x:Name="DrawableTransparentEllipse"
AutomationId="TransparentEllipse"
GroupName="DrawableType"
Content="TransparentEllipse"
CheckedChanged="OnDrawableChanged"/>
</StackLayout>

<!-- Is Enabled -->
<Label Text="Is Enabled:"
FontSize="15"/>
<StackLayout Orientation="Horizontal">
<RadioButton x:Name="IsEnabledTrueRadio"
AutomationId="IsEnabledTrueRadio"
GroupName="IsEnabled"
Content="True"
IsChecked="True"
FontSize="14"
CheckedChanged="OnIsEnabledCheckedChanged"/>
<RadioButton x:Name="IsEnabledFalseRadio"
AutomationId="IsEnabledFalseRadio"
GroupName="IsEnabled"
Content="False"
FontSize="14"
CheckedChanged="OnIsEnabledCheckedChanged"/>
</StackLayout>

<!-- Is Visible -->
<Label Text="Is Visible:"
FontSize="15"/>
<StackLayout Orientation="Horizontal">
<RadioButton x:Name="IsVisibleTrueRadio"
AutomationId="IsVisibleTrueRadio"
GroupName="IsVisible"
Content="True"
IsChecked="True"
FontSize="14"
CheckedChanged="OnIsVisibleCheckedChanged"/>
<RadioButton x:Name="IsVisibleFalseRadio"
AutomationId="IsVisibleFalseRadio"
GroupName="IsVisible"
Content="False"
FontSize="14"
CheckedChanged="OnIsVisibleCheckedChanged"/>
</StackLayout>

<!-- Shadow Properties -->
<Label Text="Shadow (OffsetX,OffsetY,Radius,Opacity):"
FontSize="15"/>
<Entry x:Name="ShadowInputEntry"
Text=""
Keyboard="Text"
AutomationId="ShadowInputEntry"
TextChanged="OnShadowInputChanged"/>
</StackLayout>

<StackLayout Grid.Column="1"
Padding="10"
Spacing="12">
<!-- GraphicsView Height -->
<Label Text="GraphicsView Height:"
FontSize="15"/>
<StackLayout Orientation="Horizontal"
Spacing="5">
<Entry x:Name="HeightRequestEntry"
Text="{Binding HeightRequest}"
Keyboard="Numeric"
AutomationId="HeightRequestEntry"/>
</StackLayout>

<!-- GraphicsView Width -->
<Label Text="GraphicsView Width:"
FontSize="15"/>
<StackLayout Orientation="Horizontal"
Spacing="5">
<Entry x:Name="WidthRequestEntry"
Text="{Binding WidthRequest}"
Keyboard="Numeric"
AutomationId="WidthRequestEntry"/>
</StackLayout>

</StackLayout>
</Grid>
</ContentPage>
Loading