Skip to content

Commit 312fcc4

Browse files
committed
Merge branch 'main' into winui
# Conflicts: # CommunityToolkit.WinUI.SampleApp/SamplePages/EnumValuesExtension/AnimalToColorConverter.xaml.cs # CommunityToolkit.WinUI.SampleApp/SamplePages/MarkdownTextBlock/InitialContent.md # CommunityToolkit.WinUI.SampleApp/readme.md # CommunityToolkit.WinUI.UI.Controls.Input/ColorPicker/ColorToColorShadeConverter.cs # CommunityToolkit.WinUI.UI.Controls.Input/ColorPicker/ColorToHexConverter.cs # CommunityToolkit.WinUI.UI.Controls.Input/ColorPicker/ContrastBrushConverter.cs # CommunityToolkit.WinUI.UI/Converters/ColorToDisplayNameConverter.cs # CommunityToolkit.WinUI.UI/Converters/TaskResultConverter.cs # Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.nuspec # readme.md # version.json
2 parents 9a13bb7 + 6961808 commit 312fcc4

File tree

20 files changed

+78
-58
lines changed

20 files changed

+78
-58
lines changed

CommunityToolkit.WinUI.Notifications/CommunityToolkit.WinUI.Notifications.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
<id>CommunityToolkit.WinUI.Notifications</id>
55
<version>$version$</version>
66
<title>Windows Community Toolkit Notifications</title>
7-
<authors>CommunityToolkit.Common,dotnetfoundation</authors>
7+
<authors>Microsoft.Toolkit,dotnetfoundation</authors>
88
<requireLicenseAcceptance>true</requireLicenseAcceptance>
99
<license type="expression">MIT</license>
1010
<projectUrl>https://github.com/windows-toolkit/WindowsCommunityToolkit</projectUrl>
11-
<iconUrl>https://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/master/build/nuget.png</iconUrl>
11+
<iconUrl>https://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/main/build/nuget.png</iconUrl>
1212
<icon>images\nuget.png</icon>
1313
<description>The official way to send toast notifications on Windows 10 via code rather than XML, with the help of IntelliSense. Supports all C# app types, including WPF, UWP, WinForms, and Console, even without packaging your app as MSIX. Also supports C++ UWP apps.
1414

CommunityToolkit.WinUI.SampleApp/SamplePages/EnumValuesExtension/AnimalToColorConverter.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System;
66
using CommunityToolkit.WinUI.SampleApp.Enums;
77
using Microsoft.UI;
8+
using Microsoft.UI.Xaml;
89
using Microsoft.UI.Xaml.Data;
910

1011
namespace CommunityToolkit.WinUI.SampleApp.Converters
@@ -21,7 +22,7 @@ public object Convert(object value, Type targetType, object parameter, string la
2122
Animal.Llama => Colors.Beige,
2223
Animal.Parrot => Colors.YellowGreen,
2324
Animal.Squirrel => Colors.SaddleBrown,
24-
_ => throw new ArgumentException("Invalid value", nameof(value))
25+
_ => DependencyProperty.UnsetValue
2526
};
2627
}
2728

CommunityToolkit.WinUI.SampleApp/SamplePages/EnumValuesExtension/EnumValuesExtensionCode.bind

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public sealed class AnimalToColorConverter : IValueConverter
2020
Animal.Bunny => Colors.Green,
2121
Animal.Parrot => Colors.YellowGreen,
2222
Animal.Squirrel => Colors.SaddleBrown,
23-
_ => throw new ArgumentException("Invalid value", nameof(value))
23+
_ => DependencyProperty.UnsetValue
2424
};
2525
}
2626

CommunityToolkit.WinUI.SampleApp/SamplePages/MarkdownTextBlock/InitialContent.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,11 @@ To add an image, it is almost like a link. You just need to add a \! before.
376376

377377
So inline image syntax looks like this:
378378

379-
>\!\[Helpers Image](https\://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/master/CommunityToolkit.WinUI.SampleApp/Assets/Helpers.png)
379+
>\!\[Helpers Image](https\://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/main/Microsoft.Toolkit.Uwp.SampleApp/Assets/Helpers.png)
380380
381381
which renders in:
382382

383-
![Helpers Image](https://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/master/CommunityToolkit.WinUI.SampleApp/Assets/Helpers.png)
383+
![Helpers Image](https://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/main/Microsoft.Toolkit.Uwp.SampleApp/Assets/Helpers.png)
384384

385385
Rendering Images is now supported through prefix. use property **UriPrefix**
386386

@@ -412,11 +412,11 @@ which renders in:
412412

413413
MarkdownTextblock supports links wrapped with Images.
414414

415-
>\[!\[image](https\://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/master/build/nuget.png)](https\://docs.microsoft.com/windows/uwpcommunitytoolkit/)
415+
>\[!\[image](https\://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/main/build/nuget.png)](https\://docs.microsoft.com/windows/uwpcommunitytoolkit/)
416416
417417
will render into
418418

419-
[![image](https://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/master/build/nuget.png)](https://docs.microsoft.com/windows/uwpcommunitytoolkit/)
419+
[![image](https://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/main/build/nuget.png)](https://docs.microsoft.com/windows/uwpcommunitytoolkit/)
420420

421421
and when clicked will go to the Linked Page.
422422

@@ -425,7 +425,7 @@ MarkdownTextBlock also supports Reference based links.
425425
```
426426
[![image][1]][2]
427427
428-
[1]:https://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/master/build/nuget.png
428+
[1]:https://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/main/build/nuget.png
429429
[2]:https://docs.microsoft.com/windows/uwpcommunitytoolkit/
430430
431431
```
@@ -434,7 +434,7 @@ will render into
434434

435435
[![image][1]][2]
436436

437-
[1]:https://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/master/build/nuget.png
437+
[1]:https://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/main/build/nuget.png
438438
[2]:https://docs.microsoft.com/windows/uwpcommunitytoolkit/
439439

440440
*****

CommunityToolkit.WinUI.SampleApp/readme.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Therefore, for any new control/extension, you should still have a simplified sni
9292

9393

9494
## 4. For Events/Resource Templates: Have your sample page implement the **IXamlRendererListener** interface
95-
This gets called whenever the template gets parsed (due to loading or user modification). Here you can use the [LogicalTree](https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/CommunityToolkit.WinUI.UI/Extensions/Tree/LogicalTree.cs) extensions to grab named controls in the template and register their events. **Check for null first** as the developer may have removed the name from the element.
95+
This gets called whenever the template gets parsed (due to loading or user modification). Here you can use the [LogicalTree](https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/main/Microsoft.Toolkit.Uwp.UI/Extensions/Tree/LogicalTree.cs) extensions to grab named controls in the template and register their events. **Check for null first** as the developer may have removed the name from the element.
9696

9797
```csharp
9898
var markdownText = control.FindChild("MarkdownText") as MarkdownTextBlock;
@@ -148,9 +148,9 @@ Select the category where you want your page to be listed and add the following
148148
"Name": "AdaptiveGridView",
149149
"Type": "AdaptiveGridViewPage",
150150
"About": "The AdaptiveGridView control allows to present information within a Grid View perfectly adjusting the total display available space. It reacts to changes in the layout as well as the content so it can adapt to different form factors automatically. The number and the width of items are calculated based on the screen resolution in order to fully leverage the available screen space. The property ItemsHeight define the items fixed height and the property DesiredWidth sets the minimum width for the elements to add a new column.",
151-
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/CommunityToolkit.WinUI.UI.Controls/TextToolbar",
151+
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/main/Microsoft.Toolkit.Uwp.UI.Controls/TextToolbar",
152152
"XamlCodeFile": "AdaptiveGridViewCode.bind",
153-
"DocumentationUrl": "https://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/master/docs/controls/AdaptiveGridView.md"
153+
"DocumentationUrl": "https://raw.githubusercontent.com/windows-toolkit/WindowsCommunityToolkit/main/docs/controls/AdaptiveGridView.md"
154154
}
155155
]
156156
}
@@ -188,7 +188,7 @@ Use the DocumentationUrl property to add a link to the raw documentation in *sam
188188

189189
`https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/{branch}/docs/{folder/file.md}`
190190
191-
> NOTE: When building and running the app in release mode, the branch will automatically be changed to **master** before loading.
191+
> NOTE: When building and running the app in release mode, the branch will automatically be changed to **main** before loading.
192192

193193
> NOTE: The documentation is also packaged with the sample app. If there is no network connection, or the documentation is not yet on GitHub, the sample app will use the packaged version
194194

@@ -201,4 +201,4 @@ Use the DocumentationUrl property to add a link to the raw documentation in *sam
201201

202202
### CodeUrl
203203

204-
The value of CodeUrl is modified when the app is built in release mode. The branch is automatically changed to **master**. This allows you to test the link in debug while pointing to dev.
204+
The value of CodeUrl is modified when the app is built in release mode. The branch is automatically changed to **main**. This allows you to test the link in debug while pointing to dev.

CommunityToolkit.WinUI.UI.Controls.Core.Design/Common/MetadataRegistrationBase.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace CommunityToolkit.WinUI.Design.Common
2020
{
2121
public abstract class MetadataRegistrationBase : IProvideAttributeTable
2222
{
23-
private AttributeTable masterMetadataTable;
23+
private AttributeTable mainMetadataTable;
2424

2525
internal MetadataRegistrationBase() { }
2626

@@ -36,8 +36,8 @@ protected virtual AttributeTable BuildAttributeTable()
3636
AddAttributes(builder);
3737
AddTables(builder, this);
3838

39-
masterMetadataTable = builder.CreateTable();
40-
return masterMetadataTable;
39+
mainMetadataTable = builder.CreateTable();
40+
return mainMetadataTable;
4141
}
4242

4343
#region IProvideAttributeTable Members
@@ -250,4 +250,4 @@ protected virtual void AddAttributes(AttributeTableBuilder builder)
250250
{
251251
}
252252
}
253-
}
253+
}

CommunityToolkit.WinUI.UI.Controls.Input/ColorPicker/ColorPicker.Properties.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public partial class ColorPicker
2020
nameof(CustomPaletteColors),
2121
typeof(ObservableCollection<Windows.UI.Color>),
2222
typeof(ColorPicker),
23-
new PropertyMetadata(Windows.UI.Color.FromArgb(0x00, 0x00, 0x00, 0x00)));
23+
new PropertyMetadata(null));
2424

2525
/// <summary>
2626
/// Gets the list of custom palette colors.
@@ -64,7 +64,7 @@ public int CustomPaletteColumnCount
6464
nameof(CustomPalette),
6565
typeof(IColorPalette),
6666
typeof(ColorPicker),
67-
new PropertyMetadata(DependencyProperty.UnsetValue));
67+
new PropertyMetadata(null));
6868

6969
/// <summary>
7070
/// Gets or sets the custom color palette.

CommunityToolkit.WinUI.UI.Controls.Input/ColorPicker/ColorToColorShadeConverter.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
using System;
66
using CommunityToolkit.WinUI.Helpers;
7+
using Microsoft.UI.Xaml;
78
using Microsoft.UI.Xaml.Data;
89
using Microsoft.UI.Xaml.Media;
910
using Windows.UI;
@@ -40,7 +41,8 @@ public object Convert(
4041
}
4142
else
4243
{
43-
throw new ArgumentException("Invalid color value provided");
44+
// Invalid color value provided
45+
return DependencyProperty.UnsetValue;
4446
}
4547

4648
// Get the value component delta
@@ -50,7 +52,8 @@ public object Convert(
5052
}
5153
catch
5254
{
53-
throw new ArgumentException("Invalid parameter provided, unable to convert to integer");
55+
// Invalid parameter provided, unable to convert to integer
56+
return DependencyProperty.UnsetValue;
5457
}
5558

5659
// Specially handle minimum (black) and maximum (white)
@@ -119,7 +122,7 @@ public object ConvertBack(
119122
object parameter,
120123
string language)
121124
{
122-
throw new NotImplementedException();
125+
return DependencyProperty.UnsetValue;
123126
}
124127
}
125128
}

CommunityToolkit.WinUI.UI.Controls.Input/ColorPicker/ColorToHexConverter.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
using System;
66
using CommunityToolkit.WinUI.Helpers;
7+
using Microsoft.UI.Xaml;
78
using Microsoft.UI.Xaml.Data;
89
using Microsoft.UI.Xaml.Media;
910
using Windows.UI;
@@ -34,7 +35,8 @@ public object Convert(
3435
}
3536
else
3637
{
37-
throw new ArgumentException("Invalid color value provided");
38+
// Invalid color value provided
39+
return DependencyProperty.UnsetValue;
3840
}
3941

4042
string hexColor = color.ToHex().Replace("#", string.Empty);
@@ -58,7 +60,8 @@ public object ConvertBack(
5860
}
5961
catch
6062
{
61-
throw new ArgumentException("Invalid hex color value provided");
63+
// Invalid hex color value provided
64+
return DependencyProperty.UnsetValue;
6265
}
6366
}
6467
else
@@ -69,7 +72,8 @@ public object ConvertBack(
6972
}
7073
catch
7174
{
72-
throw new ArgumentException("Invalid hex color value provided");
75+
// Invalid hex color value provided
76+
return DependencyProperty.UnsetValue;
7377
}
7478
}
7579
}

CommunityToolkit.WinUI.UI.Controls.Input/ColorPicker/ContrastBrushConverter.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
using System;
66
using Microsoft.UI;
7+
using Microsoft.UI.Xaml;
78
using Microsoft.UI.Xaml.Data;
89
using Microsoft.UI.Xaml.Media;
910
using Windows.UI;
@@ -41,7 +42,8 @@ public object Convert(
4142
}
4243
else
4344
{
44-
throw new ArgumentException("Invalid color value provided");
45+
// Invalid color value provided
46+
return DependencyProperty.UnsetValue;
4547
}
4648

4749
// Get the default color when transparency is high
@@ -82,7 +84,7 @@ public object ConvertBack(
8284
object parameter,
8385
string language)
8486
{
85-
throw new NotImplementedException();
87+
return DependencyProperty.UnsetValue;
8688
}
8789

8890
/// <summary>

0 commit comments

Comments
 (0)