timheuer / callisto

A control toolkit for Windows 8 XAML applications. Contains some UI controls to make it easier to create Windows UI style apps for the Windows Store in accordance with Windows UI guidelines.
http://timheuer.com/blog/archive/2012/05/31/introducing-callisto-a-xaml-toolkit-for-metro-apps.aspx
Other
338 stars 108 forks source link

Not getting any output. #59

Closed ghost closed 12 years ago

ghost commented 12 years ago

Hi Tim, I have coded a flyout control as shown in ur example, but I am not getting any output. I am posting my code here. Please help me for solving my problem.

XAML Code :

<Page>

<Page.BottomAppBar>
    <AppBar x:Name="BottomAppBar" Padding="10,0,10,0" Visibility="Visible" IsSticky="True" IsOpen="True">
        <Grid>
            <StackPanel x:Name="RightPanel" Orientation="Horizontal" Grid.Column="0" HorizontalAlignment="Right">
                <Button Style="{StaticResource MoreAppBarButtonStyle}" Tag="Filter" Click="ShowFlyoutMenu" />
            </StackPanel>
        </Grid>
    </AppBar>
</Page.BottomAppBar>
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
    <TextBlock Text="Press more appbar button to show flyout control" FontSize="24" Margin="20,100,0,0"></TextBlock>
</Grid>

C# Code :

private void ShowFlyoutMenu(object sender, RoutedEventArgs e) { Flyout flyOut = new Flyout(); flyOut.PlacementTarget = sender as UIElement; flyOut.Placement = PlacementMode.Top; Menu m = new Menu(); MenuItem mi1 = new MenuItem(); mi1.Text = "Some Option"; MenuItem mi2 = new MenuItem(); mi2.Text = "Another Option Here"; m.Items.Add(mi1); m.Items.Add(new MenuItemSeparator()); m.Items.Add(mi2); flyOut.Content = m; flyOut.IsOpen = true; }

ghost commented 12 years ago

Mods please delete this, I have solved the issue.