Skip to content

Commit

Permalink
fix: Ensure proper error reporting when a WinAppSDK project reference…
Browse files Browse the repository at this point in the history
…s Uno
  • Loading branch information
jeromelaban committed Oct 19, 2022
1 parent 46c1796 commit d92eb5f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build/uno.winui.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@
<Import Project="uno.winui.single-project.targets" />
<Import Project="uno.winui.runtime-replace.targets" Condition="'$(WindowsAppSDKWinUI)'!='true'" />

<Target Name="_WinAppSDKNotSupported"
BeforeTargets="BeforeBuild"
Condition="'$(WindowsAppSDKWinUI)'=='True'">
<Error Code="UNOB0002"
Text="Using Uno.WinUI in a WinAppSDK head project is not supported. You may be including a package that references Uno.WinUI indirectly and it must be removed. See https://aka.platform.uno/UNOB0002 for more details." />
</Target>
</Project>
3 changes: 3 additions & 0 deletions doc/articles/features/VisibleBoundsPadding.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ The `ApplicationView.VisibleBounds` is the rectangular area of the screen which

In some cases it's acceptable for visible content to be partially obscured (a page background for example) and it should extend to fill the entire window. Other types of content should be restricted to the visible bounds (for instance readable text, or interactive controls). VisibleBoundsPadding enables this kind of fine-grained control over responsiveness to the visible bounds.

> [!IMPORTANT]
> The [`SafeArea`](../external/uno.toolkit.ui/doc/controls/SafeArea.md) control is now preferred to `VisibleBoundsPadding`.
## Using the behavior
The behavior can be placed on any control that provides a Padding property (e.g. Grid, StackPanel, ListView, ScrollViewer, Control, ContentPresenter or Border), and will be automatically adjusted based on the control's absolute position inside the `ApplicationView.VisibleBounds` rectangle.

Expand Down
3 changes: 3 additions & 0 deletions doc/articles/get-started-wizard.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,6 @@ This issue is caused by visual studio enforcing https connections for local cont
In general, this error happens when the XAML parser detects a syntax error. Fixing the error generally fixes the build.

This error may happen occasionally without any explicit error message, rebuilding the project may fix the issue.

#### Error UNOB0002: Using Uno.WinUI in a WinAppSDK head project is not supported
This This issue can arise when Uno.WinUI packages are included in a `.Windows` head project, which is not supported. You can fix this by removing the Uno.WinUI or the packages that transitively reference it. For example, including a reference to `Uno.CommunityToolkit.WinUI.*` will transitively include a reference to `Uno.WinUI`, and [the official community toolkit packages](uno-community-toolkit.md) must be used instead.

0 comments on commit d92eb5f

Please sign in to comment.