Skip to content
Draft
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
45 changes: 19 additions & 26 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET MAUI",
"type": "maui",
"request": "launch",
"preLaunchTask": "maui: Build"
},
{
"name": "Attach to Process",
"type": "coreclr",
"request": "attach",
"processId": "${input:processid}"
}
],
"inputs": [
{
"id": "processid",
"type": "promptString",
"default": "0",
"description": "Enter dotnet build process id reported when setting the env var MSBUILDDEBUGONSTART=2",
}
]
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [


{
"name": "Launch Controls.Sample",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build.Controls.Sample",
"program": "${workspaceRoot}/src/Controls/samples/Controls.Sample/bin/Debug/net8.0-gtk/Maui.Controls.Sample.dll",
"args": [ "--framework net8.0-gtk" ],
"cwd": "${workspaceRoot}/src/Controls/samples/Controls.Sample",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
}
]
}
92 changes: 9 additions & 83 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,91 +1,17 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Build",
"label": "build.Controls.Sample",
"command": "dotnet build ${workspaceRoot}/src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj",
"type": "shell",
"windows":{ "command": ".\\build.cmd"},
"linux":{"command": "./build.sh"},
"osx":{"command": "./build.sh"},
"group": {
"kind": "build",
"isDefault": true
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": ["$msCompile", "$func-java-watch"]
},
{
"label": "Build Platform Sample",
"type": "shell",
"command": "${input:debugbuildtasks} ./bin/dotnet/dotnet build ${input:project} -c ${input:configuration}",
"group": {
"kind": "build",
"isDefault": true
},
// "dependsOn":[ "Build" ],
"problemMatcher": ["$msCompile"]
},
{
"label": "Run Sample",
"type": "shell",
"command": "./bin/dotnet/dotnet build ${input:project} -t:Run -f ${input:framework} -c ${input:configuration} -p:AndroidAttachDebugger=${input:attach}",
"group": {
"kind": "none",
"isDefault": false
},
//"dependsOn":[ "Build" ],
"problemMatcher": ["$msCompile"]
"problemMatcher": "$msCompile"
}
],
"inputs": [
{
// Add additional projects here. They will be available in the drop down
// in vscode.
"id": "project",
"type": "pickString",
"default": "src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj",
"description": "Pick the Project you want to build.",
"options": [
"src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj",
]
},
{
// Add additional projects here. They will be available in the drop down
// in vscode.
"id": "framework",
"type": "pickString",
"default": "net7.0-android",
"description": "Pick the framework you want to target.",
"options": [
"net7.0-android",
"net7.0-ios",
]
},
{
"id": "debugbuildtasks",
"type": "pickString",
"default": "",
"description": "Debug Build Tasks?",
"options": [
"",
"MSBUILDDEBUGONSTART=2"
]
},
{
"id": "attach",
"type": "pickString",
"default": "Build",
"description": "Attach Debugger?",
"options": [
"true",
"false",
]
},
{
"id": "configuration",
"type": "pickString",
"default": "Debug",
"description": "The Build Configuration",
"options": [ "Debug", "Release"]
},
]
}
}
2 changes: 1 addition & 1 deletion Directory.Build.Override.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<_IncludeWindows></_IncludeWindows>
<_IncludeTizen></_IncludeTizen>
<_IncludeGtk>true</_IncludeGtk>
<_IncludeAndroid>true</_IncludeAndroid>
<_IncludeAndroid>false</_IncludeAndroid>
<_IncludeIos></_IncludeIos>
<_IncludeMacCatalyst></_IncludeMacCatalyst>
<_IncludeMacOS></_IncludeMacOS>
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
<_MauiBuildTasksLocation Condition="'$(_MauiBuildTasksLocation)' == ''">$(MSBuildThisFileDirectory).buildtasks\</_MauiBuildTasksLocation>
<_MauiAOTProfileLocation>$(MauiSrcDirectory)Controls\src\Build.Tasks\nuget\buildTransitive\netstandard2.0\</_MauiAOTProfileLocation>
<StrongNamerKeyFile>$(MauiRootDirectory)eng/microsoft.maui.controls.snk</StrongNamerKeyFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<DebugType>portable</DebugType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
Expand Down
3 changes: 3 additions & 0 deletions Microsoft.Maui.Gtk.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
"src\\BlazorWebView\\src\\Gtk\\Microsoft.AspNetCore.Components.WebView.Gtk.csproj",
"src\\BlazorWebView\\src\\Maui\\Microsoft.AspNetCore.Components.WebView.Maui.csproj",
"src\\Compatibility\\Core\\src\\Compatibility.csproj",
"src\\Controls\\Foldable\\src\\Controls.Foldable.csproj",
"src\\Controls\\Maps\\src\\Controls.Maps.csproj",
"src\\Controls\\samples\\Controls.Sample.Gtk\\Controls.Sample.Gtk.csproj",
"src\\Controls\\samples\\Controls.Sample\\Maui.Controls.Sample.csproj",
"src\\Controls\\src\\Build.Tasks\\Controls.Build.Tasks.csproj",
"src\\Controls\\src\\Core\\Controls.Core.csproj",
"src\\Controls\\src\\Xaml\\Controls.Xaml.csproj",
"src\\Core\\maps\\src\\Maps.csproj",
"src\\Core\\src\\Core.csproj",
"src\\Essentials\\src\\Essentials.csproj",
"src\\Graphics\\samples\\GraphicsTester.Gtk\\GraphicsTester.Gtk.csproj",
Expand Down
1 change: 1 addition & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" protocolVersion="3" />
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" protocolVersion="3" />
<add key="benchmark-dotnet-prerelease" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/benchmark-dotnet-prerelease/nuget/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<MicrosoftAspNetCoreMetadataPackageVersion>8.0.0</MicrosoftAspNetCoreMetadataPackageVersion>
<MicrosoftJSInteropPackageVersion>8.0.0</MicrosoftJSInteropPackageVersion>
<!-- Other packages -->
<MicrosoftCodeAnalysisNetAnalyzersVersion>8.0.0</MicrosoftCodeAnalysisNetAnalyzersVersion>
<MicrosoftCodeAnalysisNetAnalyzersVersion>9.0.0</MicrosoftCodeAnalysisNetAnalyzersVersion>
<MicrosoftCodeAnalysisPublicApiAnalyzersVersion>3.3.4</MicrosoftCodeAnalysisPublicApiAnalyzersVersion>
<MicrosoftCodeAnalysisBannedApiAnalyzersVersion>3.3.4</MicrosoftCodeAnalysisBannedApiAnalyzersVersion>
<SystemNumericsVectorsVersion>4.5.0</SystemNumericsVectorsVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(_MauiDotNetTfm);$(MauiPlatforms)</TargetFrameworks>
<TargetFrameworks>$(_MauiDotNetTfm)</TargetFrameworks>
<Nullable>enable</Nullable>
<DefineConstants>$(DefineConstants);WEBVIEW2_MAUI</DefineConstants>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"profiles": {
"Controls.Sample.Gtk": {
"commandName": "Project"
},
"WSL": {
"commandName": "WSL2",
"distributionName": ""
}
}
}
14 changes: 7 additions & 7 deletions src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,24 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<!--<PackageReference Include="Microsoft.Maui.Graphics.Skia" />-->
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.1.0" />
</ItemGroup>

<ItemGroup Condition=" '$(UseMaui)' != 'true' ">
<PackageReference Include="Microsoft.Extensions.Configuration" />
<PackageReference Include="Microsoft.Extensions.Logging" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<!--<ItemGroup>
<ProjectReference
Include="..\..\..\Controls\src\Core\Controls.SourceGen.csproj"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false"/>
</ItemGroup>
</ItemGroup>-->

<ItemGroup>
<ProjectReference Include="..\..\..\BlazorWebView\samples\MauiRazorClassLibrarySample\MauiRazorClassLibrarySample.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@ async void DropGestureDrop(object? sender, DropEventArgs e)

return await LoadItemAsync(itemProvider, typeIdentifiers);
}
#elif GTK

if (e.Data is DataPackageView packageView)
{
var fileListText = await packageView.GetTextAsync();
filePaths = fileListText.Split("\n").Select(x => x.Trim()).ToList();

foreach (var item in filePaths)
{
Debug.WriteLine($"Path: {item}");
}
}
#else
await Task.CompletedTask;
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ private void HandleTapped(double x, double y)
SelectionLabel.Text = "Selected: " + string.Join(" <- ", elements!.Select(x => x.GetType().Name));
var e = elements!.FirstOrDefault() as Microsoft.Maui.Controls.View;

e?.BackgroundColor = new Microsoft.Maui.Graphics.Color(255, 0, 0);
if(e != null){
e.BackgroundColor = new Microsoft.Maui.Graphics.Color(255, 0, 0);
}
}

// IWindowOverlayElement/IDrawable is implemented to show the rectangle selection lasso
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
"Windows Machine": {
"commandName": "MsixPackage",
"nativeDebugging": true
},
"WSL": {
"commandName": "WSL2",
"distributionName": "",
"environmentVariables": {
"DISPLAY": "127.0.0.1:0.0",
"DOTNET_ENVIRONMENT": "Development"
}
}
}
}
7 changes: 5 additions & 2 deletions src/Controls/src/Core/BindableLayout/BindableLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,11 @@ static void SetBindableLayoutController(BindableObject b, BindableLayoutControll

static void OnControllerChanged(BindableObject b, BindableLayoutController oldC, BindableLayoutController newC)
{
oldC?.ItemsSource = null;

if (oldC != null)
{
oldC.ItemsSource = null;
}

if (newC == null)
{
return;
Expand Down
30 changes: 30 additions & 0 deletions src/Controls/src/Core/DragAndDrop/PlatformDragEventArgs.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using Gtk;
namespace Microsoft.Maui.Controls;

/// <summary>
Expand Down Expand Up @@ -88,6 +89,35 @@ internal PlatformDragEventArgs(Microsoft.UI.Xaml.UIElement? sender,
DragEventArgs = dragEventArgs;
}

#elif GTK

/// <summary>
/// Gets the native view attached to the event.
/// </summary>
public object Sender { get; }

/// <summary>
/// Gets data for drag and drop events.
/// </summary>
public DragMotionArgs? DragMotionArgs { get; }

/// <summary>
/// Gets data for drag and drop events.
/// </summary>
public DragLeaveArgs? DragLeaveArgs { get; }

internal PlatformDragEventArgs(object sender, DragMotionArgs dragMotionArgs)
{
Sender = sender;
DragMotionArgs = dragMotionArgs;
}

internal PlatformDragEventArgs(object sender, DragLeaveArgs dragLeaveArgs)
{
Sender = sender;
DragLeaveArgs = dragLeaveArgs;
}

#else
internal PlatformDragEventArgs()
{
Expand Down
18 changes: 18 additions & 0 deletions src/Controls/src/Core/DragAndDrop/PlatformDragStartingEventArgs.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using Gtk;

namespace Microsoft.Maui.Controls;

Expand Down Expand Up @@ -171,6 +172,23 @@ internal PlatformDragStartingEventArgs(Microsoft.UI.Xaml.UIElement sender,
DragStartingEventArgs = dragStartingEventArgs;
}

#elif GTK
/// <summary>
/// Gets the native view attached to the event.
/// </summary>
public object Sender { get; }

/// <summary>
/// Gets data for the DragStarting event.
/// </summary>
public DragBeginArgs DragBeginArgs { get; }

internal PlatformDragStartingEventArgs(object sender, DragBeginArgs dragBeginArgs)
{
Sender = sender;
DragBeginArgs = dragBeginArgs;
}

#else
internal PlatformDragStartingEventArgs()
{
Expand Down
Loading