Skip to content
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

Merge main into net8.0 #17419

Merged
merged 17 commits into from
Sep 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
fa4dafc
Removed references to GraphicsTester.Skia.Tizen from Maui-dev and Mau…
dustin-wojciechowski Sep 13, 2023
96073eb
Enable requesting the full preview size on iOS drag shadow & iOS and …
tj-devel709 Sep 13, 2023
64d964a
Wait for parent to get set before realizing titleview (#17360)
PureWeen Sep 14, 2023
e348ed4
[create-pull-request] automated change (#17362)
github-actions[bot] Sep 14, 2023
b26f515
Make the taps work on all platforms (#17325)
hartez Sep 14, 2023
fb88a50
Added integration test for maui blazor maccatalyst codesign verificat…
dustin-wojciechowski Sep 14, 2023
76d80c8
[C] Replace value with same specificity (#17365)
StephaneDelcroix Sep 14, 2023
8ab6da9
Enable Mac Catalyst Controls Device Tests in CI (#17229)
jfversluis Sep 14, 2023
aad88d6
[C] Port the specificity concept to Bindings (#17215)
StephaneDelcroix Sep 14, 2023
1825d26
Revert changes to setting context and add tests (#17348)
PureWeen Sep 14, 2023
bf9c127
Remove macOS as that is not installed by default (#17379)
mattleibow Sep 14, 2023
db17cb8
Increase timeouts to 4 hours (#17386)
mattleibow Sep 15, 2023
42a9d5f
Bump the aspnetcore group with 7 updates (#17345)
dependabot[bot] Sep 15, 2023
ff140e5
[create-pull-request] automated change (#17388)
github-actions[bot] Sep 15, 2023
671bf15
[X] fix CollectionItems enumeration (#17364)
StephaneDelcroix Sep 15, 2023
8144b8b
passing test for #16960 (#17397)
StephaneDelcroix Sep 15, 2023
2fa8665
Merge branch 'main' into dev/main-into-net8.0
mattleibow Sep 15, 2023
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
7 changes: 0 additions & 7 deletions Microsoft.Maui-dev.sln
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphicsTester.Skia.Console
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphicsTester.Skia.Mac", "src\Graphics\samples\GraphicsTester.Skia.Mac\GraphicsTester.Skia.Mac.csproj", "{5E8D70F3-990D-4B40-8B13-AA818F21E8A0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphicsTester.Skia.Tizen", "src\Graphics\samples\GraphicsTester.Skia.Tizen\GraphicsTester.Skia.Tizen.csproj", "{20756558-1284-42D6-AB7B-3E59DF8A6B34}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphicsTester.Skia.Windows", "src\Graphics\samples\GraphicsTester.Skia.Windows\GraphicsTester.Skia.Windows.csproj", "{8441FA70-9041-4727-91B9-2F39881CC0EE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphicsTester.WinUI.Desktop", "src\Graphics\samples\GraphicsTester.WinUI.Desktop\GraphicsTester.WinUI.Desktop.csproj", "{4BF0AF30-6E18-47D8-B90C-E99C1917BEF5}"
Expand Down Expand Up @@ -499,10 +497,6 @@ Global
{5E8D70F3-990D-4B40-8B13-AA818F21E8A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5E8D70F3-990D-4B40-8B13-AA818F21E8A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5E8D70F3-990D-4B40-8B13-AA818F21E8A0}.Release|Any CPU.Build.0 = Release|Any CPU
{20756558-1284-42D6-AB7B-3E59DF8A6B34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20756558-1284-42D6-AB7B-3E59DF8A6B34}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20756558-1284-42D6-AB7B-3E59DF8A6B34}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20756558-1284-42D6-AB7B-3E59DF8A6B34}.Release|Any CPU.Build.0 = Release|Any CPU
{8441FA70-9041-4727-91B9-2F39881CC0EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8441FA70-9041-4727-91B9-2F39881CC0EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8441FA70-9041-4727-91B9-2F39881CC0EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -691,7 +685,6 @@ Global
{546614BB-07AA-4E8E-B6AE-EBDC183C4DAB} = {1BA0121E-0B83-4C8F-81BE-C293E7E35DCE}
{EF6ACA06-D4DF-4C21-9F65-FBFEC6325094} = {1BA0121E-0B83-4C8F-81BE-C293E7E35DCE}
{5E8D70F3-990D-4B40-8B13-AA818F21E8A0} = {1BA0121E-0B83-4C8F-81BE-C293E7E35DCE}
{20756558-1284-42D6-AB7B-3E59DF8A6B34} = {1BA0121E-0B83-4C8F-81BE-C293E7E35DCE}
{8441FA70-9041-4727-91B9-2F39881CC0EE} = {1BA0121E-0B83-4C8F-81BE-C293E7E35DCE}
{4BF0AF30-6E18-47D8-B90C-E99C1917BEF5} = {1BA0121E-0B83-4C8F-81BE-C293E7E35DCE}
{AFD9D653-08C4-456C-AA1B-F5C9F621D655} = {42AB9AE1-631D-4AD4-85B7-910FF0940BDB}
Expand Down
21 changes: 0 additions & 21 deletions Microsoft.Maui-vscode.sln
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphicsTester.Android", "s
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphicsTester.iOS", "src\Graphics\samples\GraphicsTester.iOS\GraphicsTester.iOS.csproj", "{0F1BC26B-5041-4D64-B533-2959287D8197}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphicsTester.Mac", "src\Graphics\samples\GraphicsTester.Mac\GraphicsTester.Mac.csproj", "{0A44978B-81FD-4565-9997-3E7218C66596}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphicsTester.MacCatalyst", "src\Graphics\samples\GraphicsTester.MacCatalyst\GraphicsTester.MacCatalyst.csproj", "{B3DD0741-2EC3-4A54-82B7-73923DE4CF48}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphicsTester.Portable", "src\Graphics\samples\GraphicsTester.Portable\GraphicsTester.Portable.csproj", "{546614BB-07AA-4E8E-B6AE-EBDC183C4DAB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphicsTester.Skia.Console", "src\Graphics\samples\GraphicsTester.Skia.Console\GraphicsTester.Skia.Console.csproj", "{EF6ACA06-D4DF-4C21-9F65-FBFEC6325094}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphicsTester.Skia.Mac", "src\Graphics\samples\GraphicsTester.Skia.Mac\GraphicsTester.Skia.Mac.csproj", "{5E8D70F3-990D-4B40-8B13-AA818F21E8A0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphicsTester.Skia.Tizen", "src\Graphics\samples\GraphicsTester.Skia.Tizen\GraphicsTester.Skia.Tizen.csproj", "{20756558-1284-42D6-AB7B-3E59DF8A6B34}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Graphics.Skia.GtkSharp", "src\Graphics\src\Graphics.Skia.GtkSharp\Graphics.Skia.GtkSharp.csproj", "{AFD9D653-08C4-456C-AA1B-F5C9F621D655}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphicsTester.Skia.Gtk", "src\Graphics\samples\GraphicsTester.Skia.Gtk\GraphicsTester.Skia.Gtk.csproj", "{F351A992-18E4-473C-8ADD-2BA0BAA7B5A2}"
Expand Down Expand Up @@ -439,10 +433,6 @@ Global
{0F1BC26B-5041-4D64-B533-2959287D8197}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F1BC26B-5041-4D64-B533-2959287D8197}.Release|Any CPU.Build.0 = Release|Any CPU
{0F1BC26B-5041-4D64-B533-2959287D8197}.Release|Any CPU.Deploy.0 = Release|Any CPU
{0A44978B-81FD-4565-9997-3E7218C66596}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0A44978B-81FD-4565-9997-3E7218C66596}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0A44978B-81FD-4565-9997-3E7218C66596}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0A44978B-81FD-4565-9997-3E7218C66596}.Release|Any CPU.Build.0 = Release|Any CPU
{B3DD0741-2EC3-4A54-82B7-73923DE4CF48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B3DD0741-2EC3-4A54-82B7-73923DE4CF48}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B3DD0741-2EC3-4A54-82B7-73923DE4CF48}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -455,14 +445,6 @@ Global
{EF6ACA06-D4DF-4C21-9F65-FBFEC6325094}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF6ACA06-D4DF-4C21-9F65-FBFEC6325094}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF6ACA06-D4DF-4C21-9F65-FBFEC6325094}.Release|Any CPU.Build.0 = Release|Any CPU
{5E8D70F3-990D-4B40-8B13-AA818F21E8A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5E8D70F3-990D-4B40-8B13-AA818F21E8A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5E8D70F3-990D-4B40-8B13-AA818F21E8A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5E8D70F3-990D-4B40-8B13-AA818F21E8A0}.Release|Any CPU.Build.0 = Release|Any CPU
{20756558-1284-42D6-AB7B-3E59DF8A6B34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20756558-1284-42D6-AB7B-3E59DF8A6B34}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20756558-1284-42D6-AB7B-3E59DF8A6B34}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20756558-1284-42D6-AB7B-3E59DF8A6B34}.Release|Any CPU.Build.0 = Release|Any CPU
{AFD9D653-08C4-456C-AA1B-F5C9F621D655}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AFD9D653-08C4-456C-AA1B-F5C9F621D655}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AFD9D653-08C4-456C-AA1B-F5C9F621D655}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -617,12 +599,9 @@ Global
{56DF52FC-A48C-4757-8130-A412050CEBB8} = {936C47A9-A7EA-4FBD-8733-CED1D4100E69}
{2B02595C-BB82-44F2-8FB7-423EF2DE3A73} = {1BA0121E-0B83-4C8F-81BE-C293E7E35DCE}
{0F1BC26B-5041-4D64-B533-2959287D8197} = {1BA0121E-0B83-4C8F-81BE-C293E7E35DCE}
{0A44978B-81FD-4565-9997-3E7218C66596} = {1BA0121E-0B83-4C8F-81BE-C293E7E35DCE}
{B3DD0741-2EC3-4A54-82B7-73923DE4CF48} = {1BA0121E-0B83-4C8F-81BE-C293E7E35DCE}
{546614BB-07AA-4E8E-B6AE-EBDC183C4DAB} = {1BA0121E-0B83-4C8F-81BE-C293E7E35DCE}
{EF6ACA06-D4DF-4C21-9F65-FBFEC6325094} = {1BA0121E-0B83-4C8F-81BE-C293E7E35DCE}
{5E8D70F3-990D-4B40-8B13-AA818F21E8A0} = {1BA0121E-0B83-4C8F-81BE-C293E7E35DCE}
{20756558-1284-42D6-AB7B-3E59DF8A6B34} = {1BA0121E-0B83-4C8F-81BE-C293E7E35DCE}
{AFD9D653-08C4-456C-AA1B-F5C9F621D655} = {42AB9AE1-631D-4AD4-85B7-910FF0940BDB}
{F351A992-18E4-473C-8ADD-2BA0BAA7B5A2} = {1BA0121E-0B83-4C8F-81BE-C293E7E35DCE}
{F68932B0-81A2-4CC3-A4F7-28091EE91B23} = {25D0D27A-C5FE-443D-8B65-D6C987F4A80E}
Expand Down
8 changes: 4 additions & 4 deletions eng/pipelines/common/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ stages:
- ${{ each api in parameters.androidApiLevels }}:
- ${{ if not(containsValue(project.androidApiLevelsExclude, api)) }}:
- job: android_ui_tests_${{ project.name }}_${{ api }}
timeoutInMinutes: 120 # how long to run the job before automatically cancelling
timeoutInMinutes: 240 # how long to run the job before automatically cancelling
workspace:
clean: all
displayName: ${{ coalesce(project.desc, project.name) }} (API ${{ api }})
Expand Down Expand Up @@ -64,7 +64,7 @@ stages:
- ${{ each version in parameters.iosVersions }}:
- ${{ if not(containsValue(project.iosVersionsExclude, version)) }}:
- job: ios_ui_tests_${{ project.name }}_${{ replace(version, '.', '_') }}
timeoutInMinutes: 120 # how long to run the job before automatically cancelling
timeoutInMinutes: 240 # how long to run the job before automatically cancelling
workspace:
clean: all
displayName: ${{ coalesce(project.desc, project.name) }} (v${{ version }})
Expand Down Expand Up @@ -95,7 +95,7 @@ stages:
- ${{ each project in parameters.projects }}:
- ${{ if ne(project.winui, '') }}:
- job: winui_ui_tests_${{ project.name }}
timeoutInMinutes: 120 # how long to run the job before automatically cancelling
timeoutInMinutes: 240 # how long to run the job before automatically cancelling
workspace:
clean: all
displayName: ${{ coalesce(project.desc, project.name) }}
Expand All @@ -118,7 +118,7 @@ stages:
- ${{ each project in parameters.projects }}:
- ${{ if ne(project.mac, '') }}:
- job: mac_ui_tests_${{ project.name }}
timeoutInMinutes: 120 # how long to run the job before automatically cancelling
timeoutInMinutes: 240 # how long to run the job before automatically cancelling
workspace:
clean: all
displayName: ${{ coalesce(project.desc, project.name) }}
Expand Down
3 changes: 1 addition & 2 deletions eng/pipelines/device-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ stages:
windowsPackageId: 'com.microsoft.maui.controls.devicetests'
android: $(System.DefaultWorkingDirectory)/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj
ios: $(System.DefaultWorkingDirectory)/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj
# Skip this one for Mac Catalyst for now, it's crashing
catalyst: #$(System.DefaultWorkingDirectory)/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj
catalyst: $(System.DefaultWorkingDirectory)/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj
# Skip this one for Windows for now, it's crashing
windows: #$(System.DefaultWorkingDirectory)/src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj
- name: blazorwebview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ public DoubleTapGallery()
{
HeightRequest = 200,
WidthRequest = 200,
BackgroundColor = Microsoft.Maui.Graphics.Colors.AliceBlue,
AutomationId = "DoubleTapSurface"
BackgroundColor = Microsoft.Maui.Graphics.Colors.AliceBlue
};

var dtLabel = new Label { Text = "DoubleTapSurface", AutomationId = "DoubleTapSurface" };
tapSurface.Add(dtLabel);

var doubleTapRecognizer = new TapGestureRecognizer() { NumberOfTapsRequired = 2 };
doubleTapRecognizer.Tapped += (sender, args) => { result.Text = "Success"; };

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using Microsoft.Maui.Controls;

namespace Maui.Controls.Sample.Issues
{
[Issue(IssueTracker.Github, 16787, "CollectionView runtime binding errors when loading the ItemSource asynchronously", PlatformAffected.UWP)]
public class Issue16787 : TestContentPage
{
protected override void OnBindingContextChanged()
{
base.OnBindingContextChanged();
}
protected override void Init()
{
var cv = new CollectionView();
cv.BindingContextChanged += Cv_BindingContextChanged;
this.BindingContext = this;
cv.ItemTemplate = new DataTemplate(() =>
{
int bindingContextChanges = 0;
var label = new Label();
label.BindingContextChanged += (_, _) =>
{
bindingContextChanges++;
label.Text = bindingContextChanges.ToString();
};
label.AutomationId = "LabelBindingCount";
return label;
});

cv.ItemsSource = new[] { "random" };


var layout = new VerticalStackLayout()
{
new Label()
{
Text = "The value below this label should be a 1. That's how many times the BindingContext has changed on the Templated element"
}
};

Content = cv;
}

private void Cv_BindingContextChanged(object sender, System.EventArgs e)
{
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
using System;
using Microsoft.Maui.Controls;

namespace Maui.Controls.Sample.Issues
{
[Issue(IssueTracker.Github, 17347, "Setting a new TitleView on an already created page crashes iOS", PlatformAffected.iOS)]
public class Issue17347 : TestContentPage
{
protected override void Init()
{
var navPage = new NavigationPage(new MainPage());
NavigatedTo += Issue16499_NavigatedTo;

async void Issue16499_NavigatedTo(object sender, NavigatedToEventArgs e)
{
NavigatedTo -= Issue16499_NavigatedTo;

await Navigation.PushModalAsync(navPage);
await navPage.Navigation.PushAsync(new MainPage());
await navPage.Navigation.PushAsync(new MainPage());
await navPage.Navigation.PopAsync();
await navPage.Navigation.PopAsync();
}
}

public partial class MainPage : ContentPage
{
Label TopView;
static int i = 0;
protected override void OnAppearing()
{
Content = new VerticalStackLayout()
{
new Button()
{
AutomationId = "PopMeButton",
Command = new Command(async () =>
{
if (Navigation.NavigationStack.Count == 1)
await Navigation.PopModalAsync();
else
await Navigation.PopAsync();
}),
Text = "Click to Pop This Page If Needed"
}
};

var increment = $"{i++}";
TopView = new()
{
AutomationId = "TitleViewLabel" + increment
};

TopView.SetBinding(Label.TextProperty, "AutomationId");
TopView.BindingContext = TopView;

TopView.WidthRequest = App.Current.Windows[0].Page.Width / 2;
NavigationPage.SetTitleView(this, TopView);
NavigationPage.SetHasNavigationBar(this, true);
NavigationPage.SetHasBackButton(this, false);
base.OnAppearing();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
x:Class="Maui.Controls.Sample.Issues.Issue16561">
<StackLayout>

<Grid x:Name="TapArea"
AutomationId="TapArea"
BackgroundColor="LightBlue"
<Grid BackgroundColor="LightBlue"
Margin="10"
x:Name="TapArea"
HeightRequest="300">
<Label HorizontalOptions="Center"
VerticalOptions="Center"
<Label HorizontalOptions="Start" VerticalOptions="Start"
TextColor="Black"
Text="Tap In This Grid" />
AutomationId="TapArea"
Text="Tap In This Grid. This label needs to be long so the Windows test will work." />
</Grid>

<Label HeightRequest="100"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?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.Pages.WindowsDragAndDropCustomization"
Title="Drag and Drop Windows Platform-Specific">
<Grid Margin="20" RowDefinitions="290,*">

<Border Margin="15" Grid.Row="0">
<StackLayout>
<Label Text="Drag and Drop the items below" FontSize="Large" FontAttributes="Bold"/>
<CollectionView x:Name="CollectionView1">
<CollectionView.ItemTemplate>
<DataTemplate>
<Label Text="{Binding Name}" Background="LightGray" HeightRequest="30" HorizontalOptions="Fill" Margin="3">
<Label.GestureRecognizers>
<DragGestureRecognizer />
</Label.GestureRecognizers>
</Label>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</StackLayout>
</Border>

<TableView Intent="Settings" Grid.Row="1" >
<TableRoot>
<TableSection Title="Drag Customization">

<ViewCell>
<Grid ColumnDefinitions="3*,*" VerticalOptions="Center" Margin="10,0,5,0">
<Label Text="Show Glyph" VerticalTextAlignment="Center" Grid.Column="0"/>
<Switch HorizontalOptions="End" x:Name="ShowGlyphSwitch" IsToggled="True" Grid.Column="1"/>
</Grid>
</ViewCell>

<ViewCell>
<Grid ColumnDefinitions="3*,*" VerticalOptions="Center" Margin="10,0,5,0">
<Label Text="Custom Caption" VerticalTextAlignment="Center" Grid.Column="0"/>
<Entry HorizontalOptions="End" WidthRequest="300" Placeholder="Copy" x:Name="CustomCaptionEntry" Grid.Column="1"/>
</Grid>
</ViewCell>

<ViewCell>
<Grid ColumnDefinitions="3*,*" VerticalOptions="Center" Margin="10,0,5,0">
<Label Text="Show Caption" VerticalTextAlignment="Center" Grid.Column="0"/>
<Switch HorizontalOptions="End" x:Name="ShowCaptionSwitch" IsToggled="True" Grid.Column="1"/>
</Grid>
</ViewCell>

<ViewCell>
<Grid ColumnDefinitions="3*,*" VerticalOptions="Center" Margin="10,0,5,0">
<Label Text="Show Content" VerticalTextAlignment="Center" Grid.Column="0"/>
<Switch HorizontalOptions="End" x:Name="ShowContentSwitch" Grid.Column="1" IsToggled="True"/>
</Grid>
</ViewCell>
</TableSection>

</TableRoot>
</TableView>
<Grid.GestureRecognizers>
<DropGestureRecognizer DragOver="DropGestureRecognizer_DragOver" />
</Grid.GestureRecognizers>
</Grid>
</ContentPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using System;
using Maui.Controls.Sample.ViewModels;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.PlatformConfiguration;
using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;

namespace Maui.Controls.Sample.Pages
{
public partial class WindowsDragAndDropCustomization : ContentPage
{
public WindowsDragAndDropCustomization()
{
InitializeComponent();

CollectionView1.ItemsSource = new NameObject[]
{
new NameObject ("First Item"),
new NameObject ("Second Item"),
new NameObject ("Third Item"),
new NameObject ("Fourth Item"),
new NameObject ("Fifth Item"),
new NameObject ("Sixth Item"),
};
}

void DropGestureRecognizer_DragOver(System.Object sender, Microsoft.Maui.Controls.DragEventArgs e)
{
#if WINDOWS
var dragUI = e.PlatformArgs.DragEventArgs.DragUIOverride;
dragUI.IsCaptionVisible = ShowCaptionSwitch.IsToggled;
dragUI.IsGlyphVisible = ShowGlyphSwitch.IsToggled;
dragUI.IsContentVisible = ShowContentSwitch.IsToggled;

dragUI.Caption = string.IsNullOrEmpty (CustomCaptionEntry.Text) ? "Copy" : CustomCaptionEntry.Text;
#endif
}

public class NameObject
{
public NameObject(string name)
{
Name = name;
}

public string Name { get; set; }
}
}
}
Loading