Skip to content

Commit 19709c2

Browse files
committed
CI fixes
1 parent ff489f5 commit 19709c2

File tree

5 files changed

+27
-27
lines changed

5 files changed

+27
-27
lines changed

common/CommunityToolkit.Labs.Core.SourceGenerators/Attributes/ToolkitSampleBoolOptionAttribute.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ public sealed class ToolkitSampleBoolOptionAttribute : ToolkitSampleOptionBaseAt
2121
/// <param name="defaultState">The initial value for the bound property.</param>
2222
/// <param name="title">A title to display on top of this option.</param>
2323
public ToolkitSampleBoolOptionAttribute(string bindingName, bool defaultState)
24-
: base(bindingName, null)
24+
: base(bindingName, defaultState)
2525
{
26-
26+
2727
}
2828

2929
/// <summary>

common/CommunityToolkit.Labs.Core.SourceGenerators/Attributes/ToolkitSampleSliderOptionAttribute.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,22 @@ public ToolkitSampleSliderOptionAttribute(string bindingName, double initial = 0
3333
/// <summary>
3434
/// The default start value.
3535
/// </summary>
36-
public double? Initial { get; }
36+
public double Initial { get; }
3737

3838
/// <summary>
3939
/// The minimal value.
4040
/// </summary>
41-
public double? Min { get; }
41+
public double Min { get; }
4242

4343
/// <summary>
4444
/// The maximum value.
4545
/// </summary>
46-
public double? Max { get; }
46+
public double Max { get; }
4747

4848
/// <summary>
4949
/// The step value.
5050
/// </summary>
51-
public double? Step { get; }
51+
public double Step { get; }
5252

5353
/// <summary>
5454
/// The source generator-friendly type name used for casting.

common/CommunityToolkit.Labs.Core.SourceGenerators/Metadata/ToolkitSampleSliderOptionMetadataViewModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace CommunityToolkit.Labs.Core.SourceGenerators.Metadata;
1212
public class ToolkitSampleSliderOptionMetadataViewModel : IGeneratedToolkitSampleOptionViewModel
1313
{
1414
private string? _title;
15-
private object? _value;
15+
private object _value;
1616

1717
/// <summary>
1818
/// Creates a new instance of <see cref="ToolkitSampleSliderOptionMetadataViewModel"/>.
@@ -44,9 +44,9 @@ public ToolkitSampleSliderOptionMetadataViewModel(string name, double initial =
4444
/// <summary>
4545
/// The initial double value.
4646
/// </summary>
47-
public double? Initial
47+
public double Initial
4848
{
49-
get => (double?)_value;
49+
get => (double)_value;
5050
set
5151
{
5252
_value = value;

common/CommunityToolkit.Labs.Shared/Renderers/GeneratedSampleOptionsRenderer.xaml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,13 @@
1616
<local:GeneratedSampleOptionTemplateSelector x:Key="GeneratedSampleOptionTemplateSelector">
1717
<local:GeneratedSampleOptionTemplateSelector.BoolOptionTemplate>
1818
<DataTemplate x:DataType="metadata:ToolkitSampleBoolOptionMetadataViewModel">
19-
<StackPanel>
20-
<TextBlock Text="{x:Bind Title}"
21-
Visibility="{x:Bind local:GeneratedSampleOptionsRenderer.NullOrWhiteSpaceToVisibility(Title)}" />
22-
<!--<CheckBox Content="{x:Bind Title}"
23-
IsChecked="{x:Bind BoolValue, Mode=TwoWay}" />-->
24-
<ToggleSwitch IsOn="{x:Bind BoolValue, Mode=TwoWay}" />
25-
</StackPanel>
19+
<ToggleSwitch Header="{x:Bind Title, Mode=OneWay}"
20+
IsOn="{x:Bind BoolValue, Mode=TwoWay}" />
2621
</DataTemplate>
2722
</local:GeneratedSampleOptionTemplateSelector.BoolOptionTemplate>
2823
<local:GeneratedSampleOptionTemplateSelector.MultiChoiceOptionTemplate>
2924
<DataTemplate x:DataType="metadata:ToolkitSampleMultiChoiceOptionMetadataViewModel">
30-
<ComboBox Header="{x:Bind Title}"
25+
<ComboBox Header="{x:Bind Title, Mode=OneWay}"
3126
ItemsSource="{x:Bind Options}"
3227
SelectedIndex="0"
3328
SelectedItem="{x:Bind Value, Mode=TwoWay}" />
@@ -44,13 +39,21 @@
4439
</local:GeneratedSampleOptionTemplateSelector.SliderOptionTemplate>
4540
<local:GeneratedSampleOptionTemplateSelector.TextOptionTemplate>
4641
<DataTemplate x:DataType="metadata:ToolkitSampleTextOptionMetadataViewModel">
47-
<TextBox Header="{x:Bind Title}"
42+
<TextBox HorizontalAlignment="Stretch"
43+
Header="{x:Bind Title, Mode=OneWay}"
4844
Text="{x:Bind PlaceholderText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
4945
</DataTemplate>
5046
</local:GeneratedSampleOptionTemplateSelector.TextOptionTemplate>
5147
</local:GeneratedSampleOptionTemplateSelector>
5248
</UserControl.Resources>
5349

5450
<ItemsControl ItemTemplateSelector="{StaticResource GeneratedSampleOptionTemplateSelector}"
55-
ItemsSource="{x:Bind SampleOptions, Mode=OneWay}" />
51+
ItemsSource="{x:Bind SampleOptions, Mode=OneWay}">
52+
<ItemsControl.ItemsPanel>
53+
<ItemsPanelTemplate>
54+
<StackPanel Orientation="Vertical"
55+
Spacing="12" />
56+
</ItemsPanelTemplate>
57+
</ItemsControl.ItemsPanel>
58+
</ItemsControl>
5659
</UserControl>

labs/SettingsControls/samples/SettingsControls.Samples/ClickableSettingsCardSample.xaml.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
using System.ComponentModel;
6+
57
namespace SettingsControlsExperiment.Samples;
68

9+
[ToolkitSampleTextOption("TextText", "Placeholder text", Title = "Input the text")]
710
[ToolkitSampleBoolOption("IsCardEnabled", true, Title = "Is Enabled")]
8-
// Single values without a colon are used for both label and value.
9-
// To provide a different label for the value, separate with a colon surrounded by a single space on both sides ("label : value").
10-
//[ToolkitSampleMultiChoiceOption("TextSize", title: "Text size", "Small : 12", "Normal : 16", "Big : 32")]
11-
//[ToolkitSampleMultiChoiceOption("TextFontFamily", title: "Font family", "Segoe UI", "Arial", "Consolas")]
12-
//[ToolkitSampleMultiChoiceOption("TextForeground", title: "Text foreground",
13-
// "Teal : #0ddc8c",
14-
// "Sand : #e7a676",
15-
// "Dull green : #5d7577")]
11+
[ToolkitSampleSliderOption("TextSize", 50, 1, 200, 10, Title = "FontSize")]
12+
[ToolkitSampleMultiChoiceOption("FontSelection", "Segoe UI", "Arial", "Consolas", Title = "Select font")]
1613

1714
[ToolkitSample(id: nameof(ClickableSettingsCardSample), "ClickableSettingsCardSample", description: "A sample for showing how SettingsCard can be static or clickable.")]
1815
public sealed partial class ClickableSettingsCardSample : Page

0 commit comments

Comments
 (0)