Skip to content

Commit

Permalink
sample for #2485
Browse files Browse the repository at this point in the history
  • Loading branch information
punker76 committed May 25, 2016
1 parent c40ce1e commit 442e5d9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 17 deletions.
42 changes: 25 additions & 17 deletions samples/MetroDemo/ExampleWindows/FlyoutDemo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
BorderThickness="1"
SaveWindowPosition="True"
WindowStartupLocation="CenterScreen"
IconOverlayBehavior="Never"
LeftWindowCommandsOverlayBehavior="Never"
RightWindowCommandsOverlayBehavior="Never"
WindowButtonCommandsOverlayBehavior="Always"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance metroDemo:MainWindowViewModel}">

Expand Down Expand Up @@ -229,24 +233,28 @@
</ComboBox>
</StackPanel>
</Controls:Flyout>
<Controls:Flyout Header="Top" Position="Top">
<StackPanel Height="100"
Margin="5,5,5,5"
HorizontalAlignment="Right"
Orientation="Horizontal">
<Button Width="40"
Height="40"
FontFamily="Segoe UI Symbol"
FontSize="16"
Style="{DynamicResource MetroCircleButtonStyle}">
<Rectangle Width="20" Height="20">
<Rectangle.Fill>
<VisualBrush Stretch="Fill" Visual="{DynamicResource appbar_add}" />
</Rectangle.Fill>
</Rectangle>
</Button>
</StackPanel>

<Controls:Flyout Header="Top"
Position="Top"
Theme="Light"
IsModal="True"
Margin="50 0 50 0"
TitleVisibility="Collapsed"
CloseButtonVisibility="Collapsed">
<Grid Height="150">
<TextBlock Text="Flyout on the top..." FontSize="22" Margin="10" />
<Grid VerticalAlignment="Bottom" Background="{DynamicResource AccentColorBrush2}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button Grid.Column="1" Style="{DynamicResource MetroFlatButton}" Margin="5" Content="_Save" IsEnabled="False" />
<Button Grid.Column="2" Style="{DynamicResource MetroFlatButton}" Margin="5" IsCancel="True" Content="_Close" Click="TopFlyoutCloseButtonOnClick" />
</Grid>
</Grid>
</Controls:Flyout>

<Controls:Flyout Header="Bottom" Position="Bottom">
<StackPanel Height="80"
Margin="5,5,5,5"
Expand Down
5 changes: 5 additions & 0 deletions samples/MetroDemo/ExampleWindows/FlyoutDemo.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,5 +187,10 @@ private async void ClickMeOnClick(object sender, RoutedEventArgs e)
{
await this.ShowMessageAsync("Title Template Test", "Thx for using MahApps.Metro!!!");
}

private void TopFlyoutCloseButtonOnClick(object sender, RoutedEventArgs e)
{
this.ToggleFlyout(8);
}
}
}

0 comments on commit 442e5d9

Please sign in to comment.