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

Added FlowDirection picker to SampleController #4521

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions Microsoft.Toolkit.Uwp.SampleApp/Pages/SampleController.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@
<ComboBoxItem Content="Light" />
<ComboBoxItem Content="Dark" />
</ComboBox>

<TextBlock Text="Flow Direction" VerticalAlignment="Center" Margin="8,0,10,0" />
<ComboBox x:Name="FlowDirectionPicker">
<ComboBoxItem Content="Left To Right" />
<ComboBoxItem Content="Right To Left" />
</ComboBox>
</StackPanel>
</StackPanel>

Expand Down
14 changes: 14 additions & 0 deletions Microsoft.Toolkit.Uwp.SampleApp/Pages/SampleController.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public SampleController()
ThemePicker.SelectedIndex = (int)GetCurrentTheme();
ThemePicker.SelectionChanged += ThemePicker_SelectionChanged;

FlowDirectionPicker.SelectedIndex = (int)DemoFlowDirection;
FlowDirectionPicker.SelectionChanged += this.FlowDirectionPicker_SelectionChanged;

DocumentationTextBlock.SetRenderer<SampleAppMarkdownRenderer>();

ProcessSampleEditorTime();
Expand Down Expand Up @@ -661,6 +664,11 @@ private void ThemePicker_SelectionChanged(object sender, SelectionChangedEventAr
}
}

private void FlowDirectionPicker_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
DemoFlowDirection = (FlowDirection)FlowDirectionPicker.SelectedIndex;
}

public Sample CurrentSample { get; private set; }

public ObservableCollection<SampleCommand> Commands { get; } = new ObservableCollection<SampleCommand>();
Expand Down Expand Up @@ -694,6 +702,12 @@ public bool UseBackground
}
}

private FlowDirection DemoFlowDirection
{
get => DemoAreaGrid.FlowDirection;
set => DemoAreaGrid.FlowDirection = value;
}

// The Loaded Instance of the backing .xaml.cs Page (if any)
private Page SamplePage { get; set; }

Expand Down