Skip to content

Commit

Permalink
use settings card action and revert resources
Browse files Browse the repository at this point in the history
  • Loading branch information
davidegiacometti committed Aug 16, 2024
1 parent 562873f commit 86d3340
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 37 deletions.
10 changes: 2 additions & 8 deletions settings/DevHome.Settings/Strings/en-us/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -575,12 +575,6 @@
</data>
<data name="FileExplorerSourceControlIntegration_Description" xml:space="preserve">
<value>View property information (such as commit status, last commit date etc.) from source control technologies inside File Explorer</value>
<comment>Inline description of the FileExplorerSourceControlIntegration experimental feature on the 'Settings -&gt; Experiments' page where you enable it.</comment>
<comment>Inline description of the FileExplorerSourceControlIntegration experimental feature on the 'Settings -> Experiments' page where you enable it.</comment>
</data>
<data name="Settings_ExperimentalFeatures_Open_Button.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Open</value>
</data>
<data name="Settings_ExperimentalFeatures_Open_Button.[using:Microsoft.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>Open</value>
</data>
</root>
</root>
55 changes: 26 additions & 29 deletions settings/DevHome.Settings/Views/ExperimentalFeaturesPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
xmlns:views="using:DevHome.Common.Views"
xmlns:models="using:DevHome.Common.Models"
xmlns:behaviors="using:DevHome.Common.Behaviors"
xmlns:ui="using:CommunityToolkit.WinUI"
behaviors:NavigationViewHeaderBehavior.HeaderTemplate="{StaticResource BreadcrumbBarDataTemplate}"
behaviors:NavigationViewHeaderBehavior.HeaderContext="{x:Bind ViewModel}">

Expand All @@ -27,36 +28,32 @@
Header="{x:Bind Name, Mode=OneWay}"
Description="{x:Bind Description, Mode=OneWay}"
Margin="{ThemeResource SettingsCardMargin}"
Visibility="{x:Bind IsVisible, Mode=OneWay}">
<StackPanel
Orientation="Horizontal"
Spacing="16"
Visibility="{x:Bind IsVisible, Mode=OneWay}"
IsClickEnabled="{x:Bind IsEnabled, Mode=OneWay}"
Command="{x:Bind OpenCommand}">
<ToggleSwitch
IsOn="{x:Bind IsEnabled, Mode=OneWay}"
Grid.Column="1">
<ToggleSwitch IsOn="{x:Bind IsEnabled, Mode=OneWay}">
<i:Interaction.Behaviors>
<ic:EventTriggerBehavior EventName="Toggled">
<ic:InvokeCommandAction Command="{x:Bind ToggledCommand}" />
</ic:EventTriggerBehavior>
</i:Interaction.Behaviors>
</ToggleSwitch>
<Button
x:Uid="Settings_ExperimentalFeatures_Open_Button"
IsEnabled="{x:Bind IsEnabled, Mode=OneWay}"
FontFamily="{StaticResource SymbolThemeFontFamily}"
Content="&#xE8A7;"
Height="36"
MinWidth="36"
FontSize="16"
Background="Transparent"
BorderThickness="0"
Command="{x:Bind OpenCommand}">
<Button.Resources>
<SolidColorBrush
x:Key="ButtonBackgroundDisabled"
Color="Transparent" />
</Button.Resources>
</Button>
</StackPanel>
<i:Interaction.Behaviors>
<ic:EventTriggerBehavior EventName="Toggled">
<ic:InvokeCommandAction Command="{x:Bind ToggledCommand}" />
</ic:EventTriggerBehavior>
<ic:DataTriggerBehavior
Binding="{x:Bind IsEnabled, Mode=OneWay}"
Value="False">
<ic:ChangePropertyAction
PropertyName="Margin"
Value="0,0,27,0" />
</ic:DataTriggerBehavior>
<ic:DataTriggerBehavior
Binding="{x:Bind IsEnabled, Mode=OneWay}"
Value="True">
<ic:ChangePropertyAction
PropertyName="Margin"
Value="0" />
</ic:DataTriggerBehavior>
</i:Interaction.Behaviors>
</ToggleSwitch>
</ctControls:SettingsCard>
</DataTemplate>
</ItemsRepeater.ItemTemplate>
Expand Down

0 comments on commit 86d3340

Please sign in to comment.