Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to code a menu un a browser
Message
De
24/02/2010 08:44:29
 
 
À
24/02/2010 08:24:45
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Versions des environnements
Environment:
VB 9.0
Divers
Thread ID:
01450668
Message ID:
01450744
Vues:
43
Hmm also :-}
Category is WPF - but there is no Silverlight one so.....
But if it is Silverlight then AFAIR there are no native Menu elements. Several third party ones (some free) knocking around tho......

>Hmm, browser and wpf in the same sentence? Are we talking Silverlight or am I confused.
>
>>>Hello
>>>I am using vb express 2008
>>>Can anybody explain how is the sintax to make a code for Menu in a browser in XAML?
>>>Thank you in advance
>>>Luis Martin
>>
>>Hi,
>>Menus are pretty flexible in WPF. Example of some of the options (just scratching the surface really):
>><Window x:Class="Junk.Window2"
>>    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>>    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>>    Height="300" Width="300">
>>    <StackPanel>
>>        <Menu>
>>            <MenuItem Header="File" >
>>                <!--Normal Click handling -->
>>                <MenuItem Header="Open" Click="MenuItem_Click"/>
>>                <!--Wired to WPF RoutedUICommand
>>                (Note Header and ShortCut are supplied by the command)-->
>>                <MenuItem Command="ApplicationCommands.Save"/>
>>                <!-- Checkable Example-->
>>                <MenuItem Header="DoIt?" IsCheckable="True" Foreground="Red"/>
>>            </MenuItem>
>>            <MenuItem Header="Edit">
>>                <MenuItem Header="Name">
>>                    <!-- MenuItem can be anything....-->
>>                    <StackPanel Orientation="Horizontal">
>>                        <TextBox Width="100"></TextBox>
>>                        <Button>Save</Button>
>>                    </StackPanel>
>>                </MenuItem>
>>            </MenuItem>
>>        </Menu>
>>        <StackPanel>
>>            <TextBox Width="200" Height="200"></TextBox>
>>            <!-- A Menu can be anywhere-->
>>            <Menu>
>>                <MenuItem Header="Hello"/>
>>            </Menu>
>>        </StackPanel>
>>    </StackPanel>
>></Window>
>>
The most flexible approach is to wire up the items using the Commanding system. You can either use the pre-defined WPF commands as in the above "Save" item or author your own additions. If you want to get fancy bear in mind that MenuItem derives from FrameworkElement so you can not only set colors as above but also use animation, mouseover etc etc
>>HTH,
>>Viv
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform