Skip to content

Commit

Permalink
Merge branch 'main' into niels9001/titlebar-experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
niels9001 authored Feb 20, 2024
2 parents 91a032c + ecf8343 commit c4d5b38
Show file tree
Hide file tree
Showing 92 changed files with 4,575 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"uno.check": {
"version": "1.16.1",
"version": "1.18.1",
"commands": [
"uno-check"
]
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ jobs:
- name: Restore dotnet tools
run: dotnet tool restore

# Pinning Manifest for 1.18 version of Uno.Check at the moment to unblock build, see https://github.com/CommunityToolkit/Windows/pull/320
- name: Run Uno Check to Install Dependencies
run: >
dotnet tool run uno-check
Expand All @@ -116,6 +117,7 @@ jobs:
--skip androidemulator
--skip vswinworkloads
--verbose
--manifest https://raw.githubusercontent.com/unoplatform/uno.check/1660eba219684491362704c75153b40ce6ef7a35/manifests/uno.ui.manifest.json
- name: Add msbuild to PATH
uses: microsoft/[email protected]
Expand Down
Binary file modified components/CanvasLayout/samples/Assets/CanvasLayout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified components/CanvasView/samples/Assets/CanvasView.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions components/CanvasView/src/Dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
<Project>
<!-- WinUI 2 / UWP -->
<ItemGroup Condition="'$(IsUwp)' == 'true'">
<PackageReference Include="CommunityToolkit.Uwp.Helpers" Version="8.0.230801-preview"/>
<PackageReference Include="CommunityToolkit.Uwp.Helpers" Version="8.0.230907"/>
</ItemGroup>

<!-- WinUI 2 / Uno -->
<ItemGroup Condition="'$(IsUno)' == 'true' AND '$(WinUIMajorVersion)' == '2'">
<PackageReference Include="CommunityToolkit.Uwp.Helpers" Version="8.0.230801-preview"/>
<PackageReference Include="CommunityToolkit.Uwp.Helpers" Version="8.0.230907"/>
</ItemGroup>

<!-- WinUI 3 / WinAppSdk -->
<ItemGroup Condition="'$(IsWinAppSdk)' == 'true'">
<PackageReference Include="CommunityToolkit.WinUI.Helpers" Version="8.0.230801-preview"/>
<PackageReference Include="CommunityToolkit.WinUI.Helpers" Version="8.0.230907"/>
</ItemGroup>

<!-- WinUI 3 / Uno -->
<ItemGroup Condition="'$(IsUno)' == 'true' AND '$(WinUIMajorVersion)' == '3'">
<PackageReference Include="CommunityToolkit.WinUI.Helpers" Version="8.0.230801-preview"/>
<PackageReference Include="CommunityToolkit.WinUI.Helpers" Version="8.0.230907"/>
</ItemGroup>
</Project>
Binary file modified components/DataTable/samples/Assets/DataTable.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions components/DataTable/samples/Dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
<Project>
<!-- WinUI 2 / UWP / Uno -->
<ItemGroup Condition="'$(IsUwp)' == 'true' OR ('$(IsUno)' == 'true' AND '$(WinUIMajorVersion)' == '2')">
<PackageReference Include="CommunityToolkit.Uwp.Behaviors" Version="8.0.230801-preview"/>
<PackageReference Include="CommunityToolkit.Uwp.Controls.HeaderedControls" Version="8.0.230801-preview"/>
<PackageReference Include="CommunityToolkit.Uwp.Behaviors" Version="8.0.230907"/>
<PackageReference Include="CommunityToolkit.Uwp.Controls.HeaderedControls" Version="8.0.230907"/>
</ItemGroup>

<!-- WinUI 3 / WinAppSdk / Uno -->
<ItemGroup Condition="'$(IsWinAppSdk)' == 'true' OR ('$(IsUno)' == 'true' AND '$(WinUIMajorVersion)' == '3')">
<PackageReference Include="CommunityToolkit.WinUI.Behaviors" Version="8.0.230801-preview"/>
<PackageReference Include="CommunityToolkit.WinUI.Controls.HeaderedControls" Version="8.0.230801-preview"/>
<PackageReference Include="CommunityToolkit.WinUI.Behaviors" Version="8.0.230907"/>
<PackageReference Include="CommunityToolkit.WinUI.Controls.HeaderedControls" Version="8.0.230907"/>
</ItemGroup>

<!-- WinUI 2 / UWP -->
Expand Down
4 changes: 2 additions & 2 deletions components/DataTable/src/DataTable/DataColumn.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
Expand Down Expand Up @@ -38,11 +38,11 @@
Width="8"
MinWidth="4"
Margin="0"
Padding="0"
Background="Transparent"
Foreground="{ThemeResource ControlStrokeColorSecondaryBrush}"
Visibility="{Binding CanResize, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource DataColumnBoolToVisibilityConverter}}">
<controls:ContentSizer.Resources>
<Thickness x:Key="SizerBaseThumbMargin">0</Thickness>
<x:Double x:Key="SizerBaseThumbWidth">2</x:Double>
<x:Double x:Key="SizerBaseThumbHeight">16</x:Double>
</controls:ContentSizer.Resources>
Expand Down
12 changes: 6 additions & 6 deletions components/DataTable/src/Dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

<!-- WinUI 2 / UWP / Uno -->
<ItemGroup Condition="'$(IsUwp)' == 'true' OR ('$(IsUno)' == 'true' AND '$(WinUIMajorVersion)' == '2')">
<PackageReference Include="CommunityToolkit.Uwp.Converters" Version="8.0.230801-preview"/>
<PackageReference Include="CommunityToolkit.Uwp.Extensions" Version="8.0.230801-preview"/>
<PackageReference Include="CommunityToolkit.Uwp.Controls.Sizers" Version="8.0.230801-preview"/>
<PackageReference Include="CommunityToolkit.Uwp.Converters" Version="8.0.230907"/>
<PackageReference Include="CommunityToolkit.Uwp.Extensions" Version="8.0.230907"/>
<PackageReference Include="CommunityToolkit.Uwp.Controls.Sizers" Version="8.0.230907"/>
</ItemGroup>

<!-- WinUI 3 / WinAppSdk / Uno -->
<ItemGroup Condition="'$(IsWinAppSdk)' == 'true' OR ('$(IsUno)' == 'true' AND '$(WinUIMajorVersion)' == '3')">
<PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.0.230801-preview"/>
<PackageReference Include="CommunityToolkit.WinUI.Extensions" Version="8.0.230801-preview"/>
<PackageReference Include="CommunityToolkit.WinUI.Controls.Sizers" Version="8.0.230801-preview"/>
<PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.0.230907"/>
<PackageReference Include="CommunityToolkit.WinUI.Extensions" Version="8.0.230907"/>
<PackageReference Include="CommunityToolkit.WinUI.Controls.Sizers" Version="8.0.230907"/>
</ItemGroup>
</Project>
3 changes: 3 additions & 0 deletions components/MarkdownTextBlock/OpenSolution.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@ECHO OFF

powershell ..\..\tooling\ProjectHeads\GenerateSingleSampleHeads.ps1 -componentPath %CD% %*
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions components/MarkdownTextBlock/samples/Dependencies.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!--
WinUI 2 under UWP uses TargetFramework uap10.0.*
WinUI 3 under WinAppSdk uses TargetFramework net6.0-windows10.*
However, under Uno-powered platforms, both WinUI 2 and 3 can share the same TargetFramework.
MSBuild doesn't play nicely with this out of the box, so we've made it easy for you.
For .NET Standard packages, you can use the Nuget Package Manager in Visual Studio.
For UWP / WinAppSDK / Uno packages, place the package references here.
-->
<Project>
<!-- WinUI 2 / UWP -->
<ItemGroup Condition="'$(IsUwp)' == 'true'">
<!-- <PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls.Primitives" Version="7.1.2"/> -->
</ItemGroup>

<!-- WinUI 2 / Uno -->
<ItemGroup Condition="'$(IsUno)' == 'true' AND '$(WinUIMajorVersion)' == '2'">
<!-- <PackageReference Include="Uno.Microsoft.Toolkit.Uwp.UI.Controls.Primitives" Version="7.1.11"/> -->
</ItemGroup>

<!-- WinUI 3 / WinAppSdk -->
<ItemGroup Condition="'$(IsWinAppSdk)' == 'true'">
<!-- <PackageReference Include="CommunityToolkit.WinUI.UI.Controls.Primitives" Version="7.1.2"/> -->
</ItemGroup>

<!-- WinUI 3 / Uno -->
<ItemGroup Condition="'$(IsUno)' == 'true' AND '$(WinUIMajorVersion)' == '3'">
<!-- <PackageReference Include="Uno.CommunityToolkit.WinUI.UI.Controls.Primitives" Version="7.1.100-dev.15.g12261e2626"/> -->
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="MSBuild.Sdk.Extras/3.0.23">
<PropertyGroup>
<ToolkitComponentName>MarkdownTextBlock</ToolkitComponentName>
</PropertyGroup>

<!-- Sets this up as a toolkit component's sample project -->
<Import Project="$(ToolingDirectory)\ToolkitComponent.SampleProject.props" />
<ItemGroup>
<None Remove="Assets\MarkdownTextBlock.png" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\MarkdownTextBlock.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>
34 changes: 34 additions & 0 deletions components/MarkdownTextBlock/samples/MarkdownTextBlock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: MarkdownTextBlock
author: nerocui
description: A control for displaying markdown natively.
keywords: MarkdownTextBlock, Control, Layout
dev_langs:
- csharp
category: Controls
subcategory: StatusAndInfo
experimental: true
discussion-id: 0
issue-id: 0
icon: Assets/MarkdownTextBlock.png
---

<!-- To know about all the available Markdown syntax, Check out https://docs.microsoft.com/contribute/markdown-reference -->
<!-- Ensure you remove all comments before submission, to ensure that there are no formatting issues when displaying this page. -->
<!-- It is recommended to check how the Documentation will look in the sample app, before Merging a PR -->
<!-- **Note:** All links to other docs.microsoft.com pages should be relative without locale, i.e. for the one above would be /contribute/markdown-reference -->
<!-- Included images should be optimized for size and not include any Intellectual Property references. -->

<!-- Be sure to update the discussion/issue numbers above with your Labs discussion/issue id numbers in order for UI links to them from the sample app to work. -->

# MarkdownTextBlock

MarkdownTextBlock is a evolution of the existing MarkdownTextBlock in the community toolkit. This new implementation uses the popular [Markdig](https://github.com/xoofx/markdig) library for parsing. This solves some long standing bugs and feature gaps in our existing implementation.

## Templated Controls

The Toolkit is built with templated controls. This provides developers a flexible way to restyle components
easily while still inheriting the general functionality a control provides. The examples below show
how a component can use a default style and then get overridden by the end developer.

> [!Sample MarkdownTextBlockCustomSample]
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
<Page x:Class="MarkdownTextBlockExperiment.Samples.MarkdownTextBlockCustomSample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:CommunityToolkit.Labs.WinUI.MarkdownTextBlock"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:MarkdownTextBlockExperiment.Samples"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
Margin="0,0,0,12"
FontSize="16"
FontWeight="Bold"
Text="Try it live!" />
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<controls:MarkdownTextBlock Grid.Column="0"
Config="{x:Bind LiveMarkdownConfig, Mode=OneTime}"
Text="{x:Bind MarkdownTextBox.Text, Mode=OneWay}" />
<TextBox x:Name="MarkdownTextBox"
Grid.Column="1"
AcceptsReturn="True" />
</Grid>
<TextBlock Grid.Row="2"
Margin="0,0,0,12"
FontSize="16"
FontWeight="Bold"
Text="Built-in Sample" />
<controls:MarkdownTextBlock Grid.Row="3"
Config="{x:Bind MarkdownConfig, Mode=OneTime}"
Text="{x:Bind Text, Mode=OneTime}" />
</Grid>
</Page>
Loading

0 comments on commit c4d5b38

Please sign in to comment.