Skip to content

Commit e92f7de

Browse files
Add LTR/RTL toggle to demo tool for easy testing of RTL layouts (#2908)
1 parent 0eedc19 commit e92f7de

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

MainDemo.Wpf/MainWindow.xaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
<Grid.RowDefinitions>
154154
<RowDefinition />
155155
<RowDefinition />
156+
<RowDefinition />
156157
</Grid.RowDefinitions>
157158
<TextBlock
158159
Text="Light"
@@ -175,6 +176,22 @@
175176
IsChecked="{Binding ControlsEnabled}"
176177
Grid.Row="1"
177178
Grid.Column="1"/>
179+
180+
<TextBlock
181+
Text="LTR"
182+
Margin="0 10 10 0"
183+
Grid.Row="2"/>
184+
<ToggleButton
185+
x:Name="FlowDirectionToggleButton"
186+
Click="FlowDirectionButton_Click"
187+
Margin="0 10 0 0"
188+
Grid.Column="1"
189+
Grid.Row="2"/>
190+
<TextBlock
191+
Text="RTL"
192+
Margin="10 10 0 0"
193+
Grid.Column="2"
194+
Grid.Row="2"/>
178195
</Grid>
179196

180197
<Separator/>

MainDemo.Wpf/MainWindow.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ private void MenuToggleButton_OnClick(object sender, RoutedEventArgs e)
8686
private void MenuDarkModeButton_Click(object sender, RoutedEventArgs e)
8787
=> ModifyTheme(DarkModeToggleButton.IsChecked == true);
8888

89+
private void FlowDirectionButton_Click(object sender, RoutedEventArgs e)
90+
=> FlowDirection = FlowDirectionToggleButton.IsChecked.GetValueOrDefault(false)
91+
? FlowDirection.RightToLeft
92+
: FlowDirection.LeftToRight;
93+
8994
private static void ModifyTheme(bool isDarkTheme)
9095
{
9196
var paletteHelper = new PaletteHelper();

0 commit comments

Comments
 (0)