Skip to content

Commit

Permalink
Close flyout
Browse files Browse the repository at this point in the history
  • Loading branch information
yaira2 committed May 11, 2023
1 parent 720acaa commit 35d7202
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Files.App/UserControls/StatusBarControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
BorderThickness="0"
Content="{x:Bind DirectoryPropertiesViewModel.GitBranchDisplayName, Mode=OneWay}">
<Button.Flyout>
<Flyout Opening="Flyout_Opening">
<Flyout x:Name="GitBranchesFlyout" Opening="Flyout_Opening">
<Grid
Width="300"
Height="340"
Expand Down Expand Up @@ -98,9 +98,11 @@

<!-- Branches List -->
<ListView
x:Name="BranchesListView"
Grid.Row="1"
Padding="4"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
ItemClick="BranchesListView_ItemClick"
ItemsSource="{x:Bind DirectoryPropertiesViewModel.BranchesNames, Mode=OneWay}"
SelectedIndex="{x:Bind DirectoryPropertiesViewModel.SelectedBranchIndex, Mode=TwoWay}"
SelectionMode="Single" />
Expand Down
5 changes: 5 additions & 0 deletions src/Files.App/UserControls/StatusBarControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,10 @@ private void Flyout_Opening(object sender, object e)
{
DirectoryPropertiesViewModel.SelectedBranchIndex = DirectoryPropertiesViewModel.ActiveBranchIndex;
}

private void BranchesListView_ItemClick(object sender, ItemClickEventArgs e)
{
GitBranchesFlyout.Hide();
}
}
}

0 comments on commit 35d7202

Please sign in to comment.