-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding new controls * Uno fixes * Added SettingsExpanderSample * Adding sampleref * Bugfixes * CI fix * Fix CI * Adding ExpanderV2 * CI fix * Update Generic.xaml * Add overrides * Uno fixes * CI fix * Update ExampleSettingsControlsTestClass.cs * Simplifing state setting * Revert "Simplifing state setting" This reverts commit a014377. * Quick fix to enable building locally to workaround unoplatform/uno#9297 * Update labs/SettingsControls/samples/SettingsControls.Samples/SettingsExpanderSample.xaml Co-authored-by: Michael Hawker MSFT (XAML Llama) <[email protected]> * Update labs/SettingsControls/samples/SettingsControls.Samples/SettingsExpanderSample.xaml Co-authored-by: Michael Hawker MSFT (XAML Llama) <[email protected]> * Tweaks * Renamed ButtonIcon to ActionIcon * Make SettingsExpander Content a ContentProperty * File rename * Making the StyleSelector work * Add github.com/rudyhuyn/XamlPlus Attached Style Helper Resolve issue with ToggleSwitch override due to microsoft/microsoft-ui-xaml#7792 * Add binding to Expander option toggle Note: should be TwoWay bound but issue on Uno, added note here for now: #207 (comment) * Removing HeaderedContentControl from the template * XAML styling * Removed HeaderedContentControl out of the SettingsCard template * Adding WrapThreshold * Fix failing test in SettingsCard tests * Tweaked SettingsCard sample * XAML styling * Remove SettingsExpanderItem and use SettingsCard directly Allows for better interop to just cut/paste SettingsCards in/out of Expanders 🙂 * UI tweaks to samples and SettingsCard to render the correct height * Adding VSM only * Temp: Comment out column trigger which was causing control to grow after state change and cause infinite layout cycle i.e. when the break point was reached (e.g. control size 560), VSM was changing the layout and now control size would be larger again (e.g. 605), which would then turn off trigger and re-layout back to old size which would now be smaller again, etc... We need to ensure the transition between the Right and Vertical states doesn't increase the width of the control. * Remove redundant minwidth * Clean up code, comments * Code cleanup SettingsCard * Settings ToolkitSampleRenderer alignment to Stretch * Bumping version number * Removing HeaderedContentControl * Removing remaining reference * Add triggers * Update Generic.xaml * Update Generic.xaml * Use ThemeResource instead of StaticResource Co-authored-by: michael-hawker <[email protected]> Co-authored-by: Rudy Huyn <[email protected]>
- Loading branch information
1 parent
12013d4
commit 919a61f
Showing
26 changed files
with
2,119 additions
and
361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
labs/SettingsControls/samples/SettingsControls.Samples/SettingsExpanderSample.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<!-- 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="SettingsControlsExperiment.Samples.SettingsExpanderSample" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:labs="using:CommunityToolkit.Labs.WinUI" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d"> | ||
|
||
<StackPanel Spacing="3"> | ||
<labs:SettingsExpander x:Name="settingsCard" | ||
Description="A picture background applies to your current desktop. A solid color or slideshow background apply to all your desktops." | ||
Header="Personalize your background" | ||
IsEnabled="{x:Bind IsCardEnabled, Mode=OneWay}" | ||
IsExpanded="{x:Bind IsCardExpanded, Mode=OneWay}"> | ||
<!-- TODO: This should be TwoWay bound but throws compile error in Uno. --> | ||
<labs:SettingsExpander.HeaderIcon> | ||
<FontIcon Glyph="" /> | ||
</labs:SettingsExpander.HeaderIcon> | ||
|
||
<ComboBox SelectedIndex="0"> | ||
<ComboBoxItem>Picture</ComboBoxItem> | ||
<ComboBoxItem>Solid color</ComboBoxItem> | ||
<ComboBoxItem>Slideshow</ComboBoxItem> | ||
<ComboBoxItem>Windows spotlight</ComboBoxItem> | ||
</ComboBox> | ||
|
||
<labs:SettingsExpander.Items> | ||
<labs:SettingsCard ContentAlignment="Vertical" | ||
Header="Vertically aligned"> | ||
<GridView SelectedIndex="1"> | ||
<GridViewItem> | ||
<Border Width="64" | ||
Height="64" | ||
Background="#0078D4" | ||
CornerRadius="4" /> | ||
</GridViewItem> | ||
<GridViewItem> | ||
<Border Width="64" | ||
Height="64" | ||
Background="#005EB7" | ||
CornerRadius="4" /> | ||
</GridViewItem> | ||
<GridViewItem> | ||
<Border Width="64" | ||
Height="64" | ||
Background="#003D92" | ||
CornerRadius="4" /> | ||
</GridViewItem> | ||
<GridViewItem> | ||
<Border Width="64" | ||
Height="64" | ||
Background="#001968" | ||
CornerRadius="4" /> | ||
</GridViewItem> | ||
</GridView> | ||
|
||
</labs:SettingsCard> | ||
<labs:SettingsCard Description="There can be a description too!" | ||
Header="A control that is right aligned (default)"> | ||
<Button Content="Browse photos" /> | ||
</labs:SettingsCard> | ||
<labs:SettingsCard ContentAlignment="Left"> | ||
<CheckBox Content="A control that is left aligned" /> | ||
</labs:SettingsCard> | ||
<labs:SettingsCard Header="Can be clicked as well" | ||
IsClickEnabled="True" /> | ||
|
||
<labs:SettingsCard Header="A togglable setting"> | ||
<ToggleSwitch /> | ||
</labs:SettingsCard> | ||
|
||
<labs:SettingsCard Header="Individual settings can be disabled" | ||
IsClickEnabled="True" | ||
IsEnabled="False"> | ||
<labs:SettingsCard.ActionIcon> | ||
<FontIcon FontSize="14" | ||
Glyph="" /> | ||
</labs:SettingsCard.ActionIcon> | ||
</labs:SettingsCard> | ||
</labs:SettingsExpander.Items> | ||
</labs:SettingsExpander> | ||
</StackPanel> | ||
</Page> |
25 changes: 25 additions & 0 deletions
25
labs/SettingsControls/samples/SettingsControls.Samples/SettingsExpanderSample.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// 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. | ||
|
||
namespace SettingsControlsExperiment.Samples; | ||
|
||
[ToolkitSampleBoolOption("IsCardEnabled", "Is Enabled", true)] | ||
[ToolkitSampleBoolOption("IsCardExpanded", "Is Expanded", false)] | ||
// Single values without a colon are used for both label and value. | ||
// To provide a different label for the value, separate with a colon surrounded by a single space on both sides ("label : value"). | ||
//[ToolkitSampleMultiChoiceOption("TextSize", title: "Text size", "Small : 12", "Normal : 16", "Big : 32")] | ||
//[ToolkitSampleMultiChoiceOption("TextFontFamily", title: "Font family", "Segoe UI", "Arial", "Consolas")] | ||
//[ToolkitSampleMultiChoiceOption("TextForeground", title: "Text foreground", | ||
// "Teal : #0ddc8c", | ||
// "Sand : #e7a676", | ||
// "Dull green : #5d7577")] | ||
|
||
[ToolkitSample(id: nameof(SettingsExpanderSample), "SettingsExpander", description: "The SettingsExpander can be used to group settings. SettingsCards can be customized in terms of alignment and content.")] | ||
public sealed partial class SettingsExpanderSample : Page | ||
{ | ||
public SettingsExpanderSample() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// 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. | ||
|
||
#if WINAPPSDK | ||
using ToolkitCST = CommunityToolkit.WinUI.UI.Triggers.ControlSizeTrigger; | ||
#else | ||
using ToolkitCST = Microsoft.Toolkit.Uwp.UI.Triggers.ControlSizeTrigger; | ||
#endif | ||
|
||
namespace CommunityToolkit.Labs.WinUI; | ||
/// <summary> | ||
/// Provide an abstraction around the Toolkit ControlSizeTrigger for both UWP and WinUI 3 in the same namespace (until 8.0). | ||
/// </summary> | ||
public partial class ControlSizeTrigger : ToolkitCST | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// 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. | ||
|
||
#if WINAPPSDK | ||
using ToolkitIEST = CommunityToolkit.WinUI.UI.Triggers.IsEqualStateTrigger; | ||
#else | ||
using ToolkitIEST = Microsoft.Toolkit.Uwp.UI.Triggers.IsEqualStateTrigger; | ||
#endif | ||
|
||
namespace CommunityToolkit.Labs.WinUI; | ||
/// <summary> | ||
/// Provide an abstraction around the Toolkit IsEqualStateTrigger for both UWP and WinUI 3 in the same namespace (until 8.0). | ||
/// </summary> | ||
public partial class IsEqualStateTrigger : ToolkitIEST | ||
{ | ||
} |
Oops, something went wrong.