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

[pull] master from unoplatform:master #145

Merged
merged 121 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
763a898
fix(textbox): don't change TextBlock selection when inside TextBox
ramezgerges Feb 1, 2024
2f91c83
fix: Fix SV HR tests
dr1rrb Feb 2, 2024
d3a3e88
chore: Fix logging issues for HR testing
dr1rrb Feb 2, 2024
2ec7b0a
fix: Include HR element handlers on windows (C# markup only)
dr1rrb Feb 2, 2024
390e110
chore: IDE0055
dr1rrb Feb 6, 2024
c7f8c91
chore: Fix UWP build
dr1rrb Feb 7, 2024
906db12
ci: Update GitVersion_SemVer
Youssef1313 Feb 8, 2024
66e41a5
chore: Add comment
Youssef1313 Feb 8, 2024
129e5b2
Merge pull request #15403 from unoplatform/Youssef1313/ci-test
jeromelaban Feb 8, 2024
501b64d
chore: Fix CI build
dr1rrb Feb 7, 2024
3887af4
refactor: Move border-related properties into a IBorderInfoProvider
MartinZikmund Feb 2, 2024
ceafe8b
refactor: Simplify BorderLayerRenderer on Skia
MartinZikmund Feb 2, 2024
cde9057
chore: Make the refactored implementation Skia-only
MartinZikmund Feb 2, 2024
05c3dfb
chore: iOS adjustments for new namespace
MartinZikmund Feb 5, 2024
93f0709
chore: Android adjustments to namespace change
MartinZikmund Feb 5, 2024
65bafd8
chore: Adjustments for namespace change for the remaining platforms
MartinZikmund Feb 5, 2024
54c6209
chore: Avoid code duplication for CalendarViewBaseItem
MartinZikmund Feb 5, 2024
ffdbc03
chore: Adjust for macOS
MartinZikmund Feb 5, 2024
6a32079
chore: Adjust Gtk
MartinZikmund Feb 6, 2024
0845300
chore: Avoid reacting to CompositionBrushProperty changes
MartinZikmund Feb 6, 2024
bd09142
chore: Do not generalize listening to brushes
MartinZikmund Feb 7, 2024
84f8575
fix: Background image should not adjust area
MartinZikmund Feb 7, 2024
ea2d134
fix: Playground is not always loading correctly
MartinZikmund Feb 6, 2024
eddcd6e
chore: Add link to issue
MartinZikmund Feb 6, 2024
32890fd
chore: Adjust OnLoaded
MartinZikmund Feb 6, 2024
fd47edc
chore: Adjust namespace
jeromelaban Feb 7, 2024
69718ef
fix: Make it possible to retrieve instance of ApplicationView earlier
MartinZikmund Feb 6, 2024
24b28ff
chore: Adjust Android reference
MartinZikmund Feb 7, 2024
94c574a
chore: Remove wrong comment
Youssef1313 Feb 8, 2024
3801b2a
Merge pull request #15375 from unoplatform/dev/mazi/playground-mainpage
jeromelaban Feb 8, 2024
9f852ee
Merge pull request #15333 from unoplatform/dev/dr/hrEltHandlers
dr1rrb Feb 8, 2024
744f6eb
perf: Avoid interpreter transition in SetTargetValueSafe
jeromelaban Feb 8, 2024
ebee122
perf: Move to non-generic cache keys for BindingPropertyHelper
jeromelaban Feb 8, 2024
2363bf7
perf: Avoid using Loaded/Unloaded events that uses Delegate.Combine
jeromelaban Feb 8, 2024
71bfb23
chore: Remove unused struct
jeromelaban Feb 8, 2024
a2e1aab
perf: Improve Control focus performance
jeromelaban Feb 8, 2024
00a78ac
perf: Don't use Lazy<T> for Wasm DisplayInformation
jeromelaban Feb 8, 2024
3af66ec
chore: Adjust sealed, same-ref equals, nullable hash value
jeromelaban Feb 8, 2024
d676364
chore: Adjust OnLoaded for effectiveviewport
jeromelaban Feb 8, 2024
9b34b63
chore: Adjust DisplayInformation initialization
jeromelaban Feb 8, 2024
33d34f3
chore: Adjust for readonly
jeromelaban Feb 8, 2024
5a6656c
fix(reg): Fix VirtualKey regression on Linux
Youssef1313 Feb 8, 2024
d33471c
Merge pull request #15376 from unoplatform/dev/mazi/applicationview-e…
jeromelaban Feb 8, 2024
09fe6a2
chore: Adjust effectiveviewport generation
jeromelaban Feb 8, 2024
2ee46d4
Merge pull request #15332 from unoplatform/dev/mazi/borderlayer-unstatic
MartinZikmund Feb 8, 2024
d2740eb
chore: Adjust ts for removed structure
jeromelaban Feb 9, 2024
c147dc1
Merge pull request #15415 from unoplatform/dev/jela/perf-update4
jeromelaban Feb 9, 2024
605adef
Merge pull request #15412 from Youssef1313/virtualkey
jeromelaban Feb 9, 2024
50c1e6c
perf: Move Loaded/Unloaded to use OnLoaded/OnUnloaded to avoid delega…
jeromelaban Feb 8, 2024
bd908a7
chore: Adjust for partial loaded/unloaded
jeromelaban Feb 9, 2024
5ee44db
chore: Adjust for duplicate base call
jeromelaban Feb 8, 2024
795d63c
Merge pull request #15410 from unoplatform/Youssef1313/remove-comment
jeromelaban Feb 9, 2024
c989141
chore: Adjust partial for unit tests
jeromelaban Feb 9, 2024
cb728ac
perf(combobox): Avoid materializing EditableText unnecessarily
Youssef1313 Feb 9, 2024
a97867a
refactor: Remove unused BorderLayerRenderer on Reference and Unit Tests
MartinZikmund Feb 6, 2024
8c1bad9
chore: Start adjusting BorderLayerRenderer on WASM
MartinZikmund Feb 7, 2024
86d4bf6
refactor: Unify Panel crossruntime panel
MartinZikmund Feb 9, 2024
6eae81a
refactor: Unify crossruntime Page
MartinZikmund Feb 9, 2024
9303ccd
refactor: Unify crossruntime ContentPresenter
MartinZikmund Feb 9, 2024
c7895ba
refactor: Unify crossruntime Border
MartinZikmund Feb 9, 2024
5025795
chore: Additional cleanup
MartinZikmund Feb 9, 2024
98a96a2
chore: Cleanup
MartinZikmund Feb 9, 2024
13ded46
chore: Adjusting ElevatedView, unknowns
MartinZikmund Feb 9, 2024
837332e
fix: TimePickerFlyout is not visible if not opened from TimePicker
MartinZikmund Feb 9, 2024
4783eb2
test: Opening Date and Time picker flyouts from a Button
MartinZikmund Feb 9, 2024
035cd18
chore: Adjust popup closing
MartinZikmund Feb 9, 2024
c5bf39f
chore: Add missing partial
MartinZikmund Feb 9, 2024
c78eb07
chore: Fix build on WinAppSdk
Youssef1313 Feb 9, 2024
a53fbc1
chore: Adjust scrollviewer partials
jeromelaban Feb 9, 2024
f6044a2
fix: Fix TreeView not selecting items properly
Youssef1313 Feb 9, 2024
d0f327e
fix: Properly handle `{x:Null}` in an attached DP
Youssef1313 Feb 9, 2024
e595dbb
Merge pull request #15407 from unoplatform/dev/jela/perf-updates
jeromelaban Feb 9, 2024
f660e9c
chore: Make ClearBorder method partial on all targets
MartinZikmund Feb 9, 2024
633a837
chore: Fix for UWP builds
Youssef1313 Feb 9, 2024
9732c0b
Merge pull request #15419 from unoplatform/dev/mazi/timepickerflyout-…
MartinZikmund Feb 9, 2024
84c9266
Merge pull request #15418 from Youssef1313/issues/15406
jeromelaban Feb 9, 2024
67e809d
perf: Make `_childrenBinable` lazy and avoid unnecessary insertions
Youssef1313 Feb 9, 2024
5e34b55
Merge pull request #15417 from Youssef1313/issues/15416
Youssef1313 Feb 9, 2024
0c8b4c5
Merge pull request #15408 from unoplatform/dev/jela/perf-sv
jeromelaban Feb 9, 2024
13462f0
refactor: Simplify OS checks
Youssef1313 Feb 9, 2024
f6c5ddd
fix: Adjust CompositionObject.SetProperty equality
Youssef1313 Feb 9, 2024
2723190
Merge pull request #15426 from Youssef1313/os-checks
jeromelaban Feb 10, 2024
f2d21d0
chore: Small fix
Youssef1313 Feb 10, 2024
47f8f7f
chore: One more small fix
Youssef1313 Feb 10, 2024
c675268
chore: Avoid redundant type check
Youssef1313 Feb 10, 2024
ea949b1
fix(droid): FileOpenPicker to suggest native media app
ajpinedam Feb 7, 2024
038330f
chore: update validation to pattern matching
ajpinedam Feb 7, 2024
6e1b6df
chore: fix typo in comments
ajpinedam Feb 7, 2024
41b5c7b
docs: update docs with FileOpenPicker changes for droid
ajpinedam Feb 11, 2024
f78887a
docs: fix some typos and grammar errors
ajpinedam Feb 11, 2024
7bd7c47
build: Fix build incrementality
Youssef1313 Feb 11, 2024
367f83a
chore: Adjust initialize
MartinZikmund Feb 12, 2024
e587087
chore: Ensure BOM is produced in the file
Youssef1313 Feb 11, 2024
84434c3
chore: Adjust for build failures
MartinZikmund Feb 12, 2024
095d213
Merge pull request #15424 from Youssef1313/children-bindable
jeromelaban Feb 12, 2024
e421284
perf: Early returns for inherited DP propagation
Youssef1313 Feb 12, 2024
434b31e
chore: Remove unused extension
Youssef1313 Feb 12, 2024
a0494d4
Merge pull request #15432 from unoplatform/dev/youssef/fix-build-incr…
jeromelaban Feb 12, 2024
50f4dac
Merge pull request #15420 from Youssef1313/issues/15214
Youssef1313 Feb 12, 2024
91b010e
chore: Remove unnecessary override
MartinZikmund Feb 12, 2024
a0871d5
Merge pull request #15391 from ajpinedam/fix/droid.fileopenpicker
jeromelaban Feb 12, 2024
c1a4c69
chore: Avoid warning
MartinZikmund Feb 13, 2024
acca9f9
Merge pull request #15402 from unoplatform/dev/mazi/borderlayer-refs
MartinZikmund Feb 13, 2024
998199c
docs: Update nuget upgrade steps
jeromelaban Feb 13, 2024
20f6ee7
Merge pull request #15427 from Youssef1313/issues/15392
Youssef1313 Feb 13, 2024
99a4fb2
Merge pull request #15438 from Youssef1313/perf-store
jeromelaban Feb 13, 2024
e8c6b46
chore: Adjust formatting
jeromelaban Feb 13, 2024
0f1cc5a
docs: Apply suggestions from code review
jeromelaban Feb 13, 2024
b7d419f
Merge pull request #15305 from ramezgerges/textbox_delete_caret_moves
ramezgerges Feb 13, 2024
872a604
build: Allow `crosstargeting_override` import to work with command-li…
Youssef1313 Feb 13, 2024
3b2cffb
Merge pull request #15447 from unoplatform/dev/jela/nuget-update
jeromelaban Feb 13, 2024
4bfa1cf
test: Fix TimePicker tests crash for 24h clock
Youssef1313 Feb 13, 2024
3a09e15
test: Disable `When_MediaPlayerElement_SetSource_Check_Play`
Youssef1313 Feb 14, 2024
5e5d7ca
chore: Add url
Youssef1313 Feb 14, 2024
f7b5123
Merge pull request #15472 from unoplatform/Youssef1313/disable-test
jeromelaban Feb 14, 2024
1d5158a
Merge pull request #15461 from Youssef1313/issues/15459
jeromelaban Feb 14, 2024
6fddcde
docs: Update to latest uno.check
jeromelaban Feb 14, 2024
da44a00
Merge pull request #15479 from unoplatform/dev/jela/uno-check-docs
jeromelaban Feb 14, 2024
67fc575
Merge pull request #15455 from unoplatform/Youssef1313/cmd-build-cros…
jeromelaban Feb 15, 2024
cdbf0c2
fix: Ensure license is recognized by GitHub
MartinZikmund Feb 15, 2024
f58c96e
Merge pull request #15490 from unoplatform/dev/mazi/license
MartinZikmund Feb 15, 2024
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
12 changes: 6 additions & 6 deletions License.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# Uno Platform

Copyright (c) Uno Platform Inc.

All rights reserved.

# Apache 2.0 License

Apache License
Expand Down Expand Up @@ -207,3 +201,9 @@ All rights reserved.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

# Uno Platform

Copyright (c) Uno Platform Inc.

All rights reserved.
4 changes: 4 additions & 0 deletions build/ci/templates/gitversion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ steps:
## jobs creating packages, and update pushed to the main branch.
echo "Updating PR Version from [$(GITVERSION.SemVer)] to [$PR_VERSION]"
echo "##vso[task.setvariable variable=GITVERSION.SemVer]$PR_VERSION"
## Uno.UI.Build.csproj uses GITVERSION_SemVer, so we update it.
## Previously, we didn't have this line and Uno.UI.Build.csproj used to work
## But, it's no longer working (probably due to an update in agents)
echo "##vso[task.setvariable variable=GITVERSION_SemVer]$PR_VERSION"

condition: eq(variables['Build.Reason'], 'PullRequest')
displayName: Update GITVERSION.SemVer for PullRequests
Expand Down
25 changes: 14 additions & 11 deletions doc/articles/features/windows-storage-pickers.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,19 @@ On some platforms, you can further customize the file-picking experience by util
| Feature | UWP | WebAssembly | Android | iOS | macOS | WPF | GTK |
|-------------------------|------|-------------|---------|-------|-------|-----|-----|
| SuggestedFileName | ✔ | ✔ | ✖ | ✖ | ✔ | ✔ | ✔ |
| SuggestedStartLocation | ✔ | ✔ (1) | 💬 | ✔ (3) | ✔ | ✔ | ✔ |
| SuggestedStartLocation | ✔ | ✔ (1) | 💬 (4) | ✔ (3) | ✔ | ✔ | ✔ |
| SettingsIdentifier | ✔ | ✔ (1) | ✔ | ✖ | ✖ | ✖ | ✖ |

*(1) - Only for the native file pickers - see WebAssembly section below*\
*(2) - For FileOpenPicker, VideosLibrary and PicturesLibrary are used to apply `image/*` and `video/*` filters*\
*(3) - PicturesLibrary opens the picture library with the image picker controller*
*(3) - PicturesLibrary opens the picture library with the image picker controller*\
*(4) - See Android section below*

On platforms where the additional features are not supported yet, setting them will not have any effect.

## Uno.WinUI-specific Initialization

If you are using Uno.WinUI (Windows App SDK-based form of Uno Platform), you need to make sure the pickers are initialized for the current window, otherwise the code would fail on Windows. This is done using `WinRT.Interop` and is required for all file and folder pickers. For example, in case of `FileOpenPicker`:
If you are using Uno.WinUI (Windows App SDK-based form of Uno Platform), you need to make sure the pickers are initialized for the current window, otherwise the code would fail on Windows. This is done using `WinRT.Interop` and it is required for all file and folder pickers. For example, in the case of `FileOpenPicker`:

```csharp
var picker = new FileOpenPicker();
Expand Down Expand Up @@ -208,7 +209,7 @@ For iOS and macOS, `UTType` is utilized for the same purpose. Here you can provi
Uno.WinRTFeatureConfiguration.FileTypes.FileTypeToUTTypeMapping.Add(".myextension", "my.custom.UTType");
```

Custom Uniform Type Identifiers must be declared in the `info.plist` of your iOS and macOS application. See a full example of this in [Uniform Type Identifiers Overview from Apple documentation](https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_declare/understand_utis_declare.html).
Custom Uniform Type Identifiers must be declared in the `info.plist` of your iOS and macOS applications. See a full example of this in [Uniform Type Identifiers Overview from Apple documentation](https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_declare/understand_utis_declare.html).

## WebAssembly

Expand All @@ -226,15 +227,15 @@ The most powerful picker implementation on WebAssembly uses the <a href="https:/

File System Access API pickers allow direct access to the picked files and folders. This means that any modifications the user does to the files are persisted on the target file system.

However, writing to the target file system is limited, so when a write-stream is opened for a file, Uno Platform creates a copy of the file in temporary storage and your changes are applied to this temporary file instead. When your file stream is then flushed, closed, or disposed of, the changes are written to the source file and the temporary file is discarded.
However, writing to the target file system is limited, so when a write-stream is opened for a file, Uno Platform creates a copy of the file in temporary storage, and your changes are applied to this temporary file instead. When your file stream is then flushed, closed, or disposed of, the changes are written to the source file, and the temporary file is discarded.

### Download/upload pickers

In case the **File System Access API** is not available in the browser, Uno Platform also offers a fallback to "download" and "upload" experiences.

For the upload picker, the browser triggers a file picker dialog and Uno Platform then copies the selected files into temporary storage of the app. The `StorageFile` instance you receive is private for your application and the changes are not reflected in the original file. To save the changes, you need to trigger the "download picker".

For the download picker, the experience requires the use of [`CachedFileManager`](https://learn.microsoft.com/uwp/api/Windows.Storage.CachedFileManager). Triggering `PickSaveFileAsync` does not actually show the download picker to the user. Instead, only a temporary file is created to allow you to write any content. Afterwards, calling `CompleteUpdatesAsync` opens the download dialog which allows the user to save the file.
For the download picker, the experience requires the use of [`CachedFileManager`](https://learn.microsoft.com/uwp/api/Windows.Storage.CachedFileManager). Triggering `PickSaveFileAsync` does not actually show the download picker to the user. Instead, only a temporary file is created to allow you to write any content. Afterward, calling `CompleteUpdatesAsync` opens the download dialog, which allows the user to save the file.

The `CachedFileManager` class works transparently with both the **Download picker** and the **File System Access API**, which means you can write a single snippet of code that handles both scenarios correctly:

Expand Down Expand Up @@ -338,19 +339,21 @@ Browsers generally treat file opening/saving operations as sensitive operations,
SecurityError: Failed to execute 'showSaveFilePicker' on 'Window': Must be handling a user gesture to show a file picker.
```

This generally means that the Uno file picking APIs have been invoked without an explicit user interaction, or have been rescheduled from the original user interaction callback (e.g. using `DispatcherQueue.TryRun()` inside a `Button.Click` handler to open a picker).
This generally means that the Uno file picking APIs have been invoked without explicit user interaction or have been rescheduled from the original user interaction callback (e.g., using `DispatcherQueue.TryRun()` inside a `Button.Click` handler to open a picker).

## Android

Files picked from file pickers on Android are provided by the *Storage Access Framework API*. Due to its limitations, it is not possible to write to existing file in-place. Instead, Uno Platform creates a copy of the file in temporary storage and your changes are applied to this temporary file instead. When your file stream is then flushed, closed, or disposed of, the changes are written to the source file and the temporary file is discarded.
Files picked from file pickers on Android are provided by the *Storage Access Framework API*. Due to its limitations, it is not possible to write to existing file in-place. Instead, Uno Platform creates a copy of the file in temporary storage and your changes are applied to this temporary file instead. When your file stream is then flushed, closed, or disposed of, the changes are written to the source file, and the temporary file is discarded.

The `FileSavePicker` API which uses `ACTION_CREATE_DOCUMENT` on Android has various limitations. To allow for the best possible compatibility across different Android versions, you should always add your file type extension to `FileTypeChoices`, and if possible provide only one such file type. In addition, if the `SuggestedFileName` or the user-typed file name matches an existing file, the resulting file will be renamed with `(1)` in the name, e.g. `test.txt` will become `test (1).txt` and the existing file will not be overwritten. However, if the user explicitly taps an existing file in the file browser, the system will show a dialog allowing the app to overwrite the existing file. This inconsistent behavior is caused by Android itself, so there is unfortunately no way to work around it from our side. See [this issue](https://issuetracker.google.com/issues/37136466) for more information.
The `SuggestedStartLocation` property has no effect on certain Android devices, and the file picker will always open in the root directory of the internal storage. When using VideosLibrary or PicturesLibrary locations, the file picker will open the picture library with the image picker controller. Still, for those devices that do not support it, it will open the root directory of the internal storage and suggest all the applications that can handle file types.

The `FileSavePicker` API, which uses `ACTION_CREATE_DOCUMENT` on Android, has various limitations. To allow for the best possible compatibility across different Android versions, you should always add your file type extension to `FileTypeChoices`, and, if possible, provide only one such file type. In addition, if the `SuggestedFileName` or the user-typed file name matches an existing file, the resulting file will be renamed with `(1)` in the name, e.g., `test.txt` will become `test (1).txt` and the existing file will not be overwritten. However, if the user explicitly taps an existing file in the file browser, the system will show a dialog allowing the app to overwrite the existing file. This inconsistent behavior is caused by Android itself, so there is, unfortunately, no way to work around it from our side. See [this issue](https://issuetracker.google.com/issues/37136466) for more information.

## iOS

iOS does not offer a built-in `FileSavePicker` experience. Luckily it is possible to implement this functionality for example using a combination of a `FolderPicker` and `ContentDialog`.
iOS does not offer a built-in `FileSavePicker` experience. Luckily, it is possible to implement this functionality, for example, using a combination of a `FolderPicker` and `ContentDialog`.

To provide your own custom implementation, create a class that implements the `IFileSavePickerExtension` which is only available on iOS. This class must have a `public` constructor with a `object` parameter. This will actually be an instance of `FileSavePicker` when invoked later. Then implement the `PickSaveFileAsync` method:
To provide your own custom implementation, create a class that implements the `IFileSavePickerExtension`, which is only available on iOS. This class must have a `public` constructor with an `object` parameter. This will actually be an instance of `FileSavePicker` when invoked later. Then implement the `PickSaveFileAsync` method:

```csharp
#if __IOS__
Expand Down
26 changes: 21 additions & 5 deletions doc/articles/upgrading-nuget-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,28 @@ It typically looks similar to this:
```

> [!IMPORTANT]
> At this time the NuGet Manager in Visual Studio 2022 does not parse or manage Sdks provided by NuGet. If you would like to see this feature added, please be sure to provide your [feedback or upvote this issue](https://github.com/NuGet/Home/issues/13127).
> In Visual Studio 2022, once the Uno Version is updated, you'll need to close and reopen the solution or restart Visual Studio for the change to take effect.
>
> At this time, the NuGet package Manager does not parse or manage Sdks provided by NuGet. If you would like to see this feature added, please be sure to provide your [feedback or upvote this issue](https://github.com/NuGet/Home/issues/13127).

To update the version, pick the latest stable build from the [Uno.WinUI](https://www.nuget.org/packages/Uno.WinUI) package with either:
To find the version to update to, pick the latest stable build from the [Uno.WinUI](https://www.nuget.org/packages/Uno.WinUI) package with either:

- [Uno.WinUI in Nuget Package Explorer](https://nuget.info)
- When using Visual Studio 2022, use the NuGet Package Manager
- Use [`dotnet outdated`](https://github.com/dotnet-outdated/dotnet-outdated):
- Install the tool using:

```dotnetcli
dotnet tool install --global dotnet-outdated-tool
```

- Then, at the root of the solution, run the tool with:

```dotnetcli
dotnet outdated
```

- When available, the tool will provide the versions which can be updated.
- [Uno.WinUI in Nuget Package Explorer](https://nuget.info/packages/Uno.WinUI)
- [Uno.WinUI in nuget.org](https://www.nuget.org/packages/Uno.WinUI)
- The latest Uno.WinUI package in the Visual Studio 2022 NuGet Package Manager.

Once the version has been chosen, change the `global.json` line with `"Uno.Sdk"` to use the newer version of Uno Platform.
Once the version has been chosen, change the `global.json` line with `"Uno.Sdk"` to use the newer version of Uno Platform. If you're running Visual Studio 2022, make sure to close/reopen the solution or restart the IDE.
2 changes: 1 addition & 1 deletion doc/import_external_docs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $external_docs = @{
"uno.wasm.bootstrap" = "5ef2048d98df307c738186a5339eedcc4665be72"
"uno.themes" = "6ce3ce8b0f61a7a017893541e1dd901ab04c906e"
"uno.toolkit.ui" = "d7eaf4b923b81e5386a5ceb0aff4ae4014239ffa"
"uno.check" = "251e61153ef936748520ecbaa99e45e10970bab1"
"uno.check" = "0350ba1b78ee7488d88f093e8f92cc4d9cb055f5"
"uno.xamlmerge.task" = "7e8ffef206e87dfea90c53805c45e93a7d8c0b46"
"figma-docs" = "0e204b21d437478d89845b6b0edb212c3f482cbc"
"uno.resizetizer" = "3eec4aad0b7b3480ec6c2a121911ffde844fc4f8"
Expand Down
2 changes: 1 addition & 1 deletion src/AddIns/Uno.UI.MediaPlayer.Skia.Gtk/VideoView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct Native
/// </summary>
public VideoView()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
if (OperatingSystem.IsLinux())
{
#pragma warning disable CA1806 // Do not ignore method results
Native.XInitThreads();
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>

<Import Project="$(SolutionDir)\crosstargeting_override.props" Condition="exists('$(SolutionDir)\crosstargeting_override.props')" />
<Import Project="crosstargeting_override.props" Condition="exists('crosstargeting_override.props')" />

<PropertyGroup>
<DebugType>portable</DebugType>
Expand Down
2 changes: 1 addition & 1 deletion src/SamplesApp/SamplesApp.Shared/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ public static void ConfigureLogging()
builder.AddFilter("Uno.UI.RemoteControl", LogLevel.Information);

// Adjust logging when debugging the Given_HotReloadWorkspace tests
builder.AddFilter("Uno.UI.RuntimeTests.Tests.HotReload.Given_HotReloadWorkspace", LogLevel.Warning);
builder.AddFilter("Uno.UI.RuntimeTests.Tests.HotReload.Given_HotReloadWorkspace", LogLevel.Debug);

// Display Skia related information
builder.AddFilter("Uno.UI.Runtime.Skia", LogLevel.Debug);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static SampleControlUITestBase()
private static void TryInitializeSkiaSharpLoader()
{
if (AppInitializer.GetLocalPlatform() == Platform.Browser
&& !RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
&& !OperatingSystem.IsWindows())
{
#if DEBUG
Console.WriteLine("Initializing SkiaSharp loader");
Expand Down
9 changes: 1 addition & 8 deletions src/SamplesApp/UITests.Shared/Playground/Playground.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,7 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<wasm:Grid>
<monaco:CodeEditor x:Name="xamlText"
Background="Transparent"
RequestedTheme="Light"
HasGlyphMargin="True"
Text="XAML editor"
CodeLanguage="XML"
Loaded="OnXamlEditorLoaded" />
<wasm:Grid x:Name="MonacoContainer">
</wasm:Grid>
<not_wasm:Grid>
<TextBox x:Name="xamlText" AcceptsReturn="True" FontFamily="ms-appx:///Assets/Fonts/CascadiaCode-Regular.ttf" />
Expand Down
53 changes: 40 additions & 13 deletions src/SamplesApp/UITests.Shared/Playground/Playground.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,40 +1,67 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Threading.Tasks;
using Microsoft.UI;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Markup;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using MUXControlsTestApp;
using Uno.UI.Samples.Controls;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Storage;
#if __WASM__
using Monaco;
#endif

namespace UITests.Playground;

[SampleControlInfo("Playground", "Playground", ignoreInSnapshotTests: true)]
public sealed partial class Playground : UserControl
{
#if __WASM__
private CodeEditor _codeEditor;
#endif

public Playground()
{
this.InitializeComponent();
#if __WASM__
this.Loaded += OnLoaded;
#endif
#if !__WASM__
xamlText.Text = ApplicationData.Current.LocalSettings.Values["PlaygroundXaml"] as string ?? "";
#endif
}

#if __WASM__
private async void OnLoaded(object sender, RoutedEventArgs e)
{
await Task.Delay(100); // Workaround for https://github.com/unoplatform/uno/issues/15374
_codeEditor = new CodeEditor()
{
Background = new SolidColorBrush(Microsoft.UI.Colors.Transparent),
HasGlyphMargin = true,
Text = ApplicationData.Current.LocalSettings.Values["PlaygroundXaml"] as string ?? "",
CodeLanguage = "XML"
};
_codeEditor.Loaded += OnXamlEditorLoaded;
MonacoContainer.Children.Add(_codeEditor);
}

private async void OnXamlEditorLoaded(object sender, RoutedEventArgs e)
{
xamlText.CodeLanguage = "xml";
_codeEditor.CodeLanguage = "xml";
}
#endif

private string GetEditorText()
{
#if __WASM__
return _codeEditor.Text;
#else
return xamlText.Text;
#endif
}

private string GetXamlInput()
{
var ns = new[] {
Expand All @@ -57,7 +84,7 @@ private string GetXamlInput()
$@"<Grid
xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
{nsTags}>
{xamlText.Text}
{GetEditorText()}
</Grid>";

}
Expand All @@ -66,7 +93,7 @@ private void OnApply()
{
try
{
ApplicationData.Current.LocalSettings.Values["PlaygroundXaml"] = xamlText.Text;
ApplicationData.Current.LocalSettings.Values["PlaygroundXaml"] = GetEditorText();
renderSurface.Content = XamlReader.Load(GetXamlInput());
}
catch (Exception e)
Expand Down
Loading
Loading