Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Some xaml substitution[WIP] #1563

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions WinUIGallery/ControlPages/EasingFunctionPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@
<StackPanel>
<ComboBox x:Name="EasingComboBox" AutomationProperties.Name="Easing type" ItemsSource="{x:Bind EasingFunctions}"
DisplayMemberPath="Name" SelectedValuePath="EasingFunctionBase" Loaded="EasingComboBox_Loaded"/>
<RadioButtons>
<RadioButton x:Name="easeOutRB" Content="EaseOut" IsChecked="True" />
<RadioButtons x:Name="EasingModeRadioButtons" SelectedIndex="0">
marcelwgn marked this conversation as resolved.
Show resolved Hide resolved
<RadioButton x:Name="easeOutRB" Content="EaseOut" />
<RadioButton x:Name="easeInRB" Content="EaseIn" />
<RadioButton x:Name="easeInOutRB" Content="EaseInOut" />
</RadioButtons>
Expand Down Expand Up @@ -177,14 +177,15 @@
&lt;Storyboard x:Name="Storyboard3"&gt;
&lt;DoubleAnimation Storyboard.TargetName="Translation" Storyboard.TargetProperty="X" From="0" To="200" &gt;
&lt;DoubleAnimation.EasingFunction&gt;
&lt;$(EasingFunction)/&gt;
&lt;$(EasingFunction) EasingMode="$(EasingMode)"/&gt;
&lt;/DoubleAnimation.EasingFunction&gt;
&lt;/DoubleAnimation&gt;
&lt;/Storyboard&gt;
</x:String>
</local:ControlExample.Xaml>
<local:ControlExample.Substitutions>
<local:ControlExampleSubstitution Key="EasingFunction" Value="{x:Bind ((control:NamedEasingFunction)EasingComboBox.SelectedItem).Name, Mode=OneWay}" />
<local:ControlExampleSubstitution Key="EasingMode" Value="{x:Bind ((RadioButton)EasingModeRadioButtons.SelectedItem).Content, Mode=OneWay}"/>
</local:ControlExample.Substitutions>
</local:ControlExample>
</StackPanel>
Expand Down
7 changes: 5 additions & 2 deletions WinUIGallery/ControlPages/NumberBoxPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@
</NumberBox>
</local:ControlExample.Example>
<local:ControlExample.Options>
<RadioButtons x:Name="SpinButtonPlacementGroup" Header="SpinButton placement">
<RadioButtons x:Name="SpinButtonPlacementGroup" Header="SpinButton placement" SelectedIndex="1">
<RadioButton Content="Inline" Tag="Inline" Checked="RadioButton_Checked" />
<RadioButton Content="Compact" Tag="Compact" Checked="RadioButton_Checked" IsChecked="True" />
<RadioButton Content="Compact" Tag="Compact" Checked="RadioButton_Checked" />
</RadioButtons>
</local:ControlExample.Options>
<local:ControlExample.Substitutions>
<local:ControlExampleSubstitution Key="SpinButtonPlacementMode" Value="{x:Bind ((RadioButton)SpinButtonPlacementGroup.SelectedItem).Content, Mode=OneWay}"/>
</local:ControlExample.Substitutions>
</local:ControlExample>

<local:ControlExample HeaderText="A formatted NumberBox that rounds to the nearest 0.25."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<NumberBox x:Name="NumberBoxSpinButtonPlacementExample"
Header="Enter an integer:"
Value="1"
SpinButtonPlacementMode="Compact"
SpinButtonPlacementMode="$(SpinButtonPlacementMode)"
SmallChange="10"
LargeChange="100" />