File tree 5 files changed +41
-4
lines changed
5 files changed +41
-4
lines changed Original file line number Diff line number Diff line change 24
24
<Compile Include =" $(MSBuildThisFileDirectory)Attributes\PackageProjectUrlAttribute.cs" />
25
25
<Compile Include =" $(MSBuildThisFileDirectory)Behaviors\NavigateToUriAction.cs" />
26
26
<Compile Include =" $(MSBuildThisFileDirectory)Controls\TitleBar\TitleBar.cs" />
27
+ <Compile Include =" $(MSBuildThisFileDirectory)Converters\StringToUriConverter.cs" />
27
28
<Compile Include =" $(MSBuildThisFileDirectory)DocOrSampleTemplateSelector.cs" />
28
29
<Compile Include =" $(MSBuildThisFileDirectory)Helpers\BackgroundHelper.cs" />
29
30
<Compile Include =" $(MSBuildThisFileDirectory)Helpers\IconHelper.cs" />
Original file line number Diff line number Diff line change
1
+ // Licensed to the .NET Foundation under one or more agreements.
2
+ // The .NET Foundation licenses this file to you under the MIT license.
3
+ // See the LICENSE file in the project root for more information.
4
+
5
+ namespace CommunityToolkit . App . Shared . Converters ;
6
+
7
+ public class StringToUriConverter : IValueConverter
8
+ {
9
+ public object Convert ( object value , Type targetType , object parameter , string language )
10
+ {
11
+ return new Uri ( "ms-appx:///SourceAssets/" + ( string ) value ) ;
12
+ }
13
+
14
+ public object ConvertBack ( object value , Type targetType , object parameter , string language )
15
+ {
16
+ return value ;
17
+ }
18
+ }
Original file line number Diff line number Diff line change 5
5
xmlns : meta =" using:CommunityToolkit.Tooling.SampleGen.Metadata"
6
6
xmlns : win =" http://schemas.microsoft.com/winfx/2006/xaml/presentation" >
7
7
8
+ <converters : StringToUriConverter x : Name =" stringToUriConverter" />
9
+
8
10
<!-- Kind of not supported in Uno (at least directly like this) see https://github.com/unoplatform/uno/issues/7582 (and related root issue)
9
11
<Style x:Key="IndentedGridViewItemStyle"
10
12
BasedOn="{StaticResource DefaultGridViewItemStyle}"
21
23
</Grid .ColumnDefinitions>
22
24
<Image Width =" 16" >
23
25
<Image .Source>
24
- <BitmapImage UriSource =" {Binding Icon}" DecodePixelHeight =" 16" DecodePixelWidth =" 16" />
26
+ <BitmapImage DecodePixelHeight =" 16"
27
+ DecodePixelWidth =" 16"
28
+ UriSource =" {Binding Icon}" />
25
29
</Image .Source>
26
30
</Image >
27
31
<TextBlock Grid.Column=" 1"
72
76
VerticalAlignment =" Center"
73
77
Stretch =" Uniform" >
74
78
<Image .Source>
75
- <BitmapImage UriSource =" {Binding Icon}" />
79
+ <BitmapImage UriSource =" {Binding Icon, Converter={StaticResource stringToUriConverter} }" />
76
80
</Image .Source>
77
81
</Image >
78
82
</Grid >
Original file line number Diff line number Diff line change 7
7
using CommunityToolkit . Tooling . SampleGen . Metadata ;
8
8
using Microsoft . CodeAnalysis ;
9
9
using Microsoft . CodeAnalysis . Text ;
10
+ using System . Collections . Immutable ;
10
11
using System . IO ;
11
12
12
13
namespace CommunityToolkit . Tooling . SampleGen ;
@@ -85,8 +86,6 @@ private static void ReportDocumentDiagnostics(SourceProductionContext ctx, Dicti
85
86
86
87
private ImmutableArray < ToolkitFrontMatter > GatherDocumentFrontMatter ( SourceProductionContext ctx , IEnumerable < AdditionalText > data )
87
88
{
88
-
89
- // System.Diagnostics.Debug
90
89
return data . Select ( file =>
91
90
{
92
91
// We have to manually parse the YAML here for now because of
Original file line number Diff line number Diff line change @@ -71,5 +71,20 @@ public enum ToolkitSampleSubcategory : byte
71
71
/// Samples that focus on XAML triggers.
72
72
/// </summary>
73
73
Triggers ,
74
+
75
+ /// <summary>
76
+ /// Samples that focus on data helpers.
77
+ /// </summary>
78
+ Data ,
79
+
80
+ /// <summary>
81
+ /// Samples that focus on system helpers.
82
+ /// </summary>
83
+ System ,
84
+
85
+ /// <summary>
86
+ /// Samples that focus on helpers during development.
87
+ /// </summary>
88
+ Developer ,
74
89
}
75
90
You can’t perform that action at this time.
0 commit comments