Skip to content

Instantly share code, notes, and snippets.

@Jonsey
Created March 23, 2011 21:41
Show Gist options
  • Select an option

  • Save Jonsey/884081 to your computer and use it in GitHub Desktop.

Select an option

Save Jonsey/884081 to your computer and use it in GitHub Desktop.
Command events
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:BrewPal.Modules.InventoryModule.ViewModels"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
mc:Ignorable="d"
x:Class="BrewPal.Modules.InventoryModule.MainMenuView"
d:DesignWidth="640" d:DesignHeight="480" Height="80" Padding="0,10"
d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True, Type={x:Type vm:MainMenuViewModel}}"
>
<!--DataContext="{Binding MainMenuViewModel, Source={StaticResource ViewModelLocator}}"
-->
<Grid x:Name="LayoutRoot">
<StackPanel Margin="0" Orientation="Horizontal" Height="27" HorizontalAlignment="Center">
<Button x:Name="AddFermentableButton" Content="Add Fermentables" Margin="0,0,20,0" Style="{DynamicResource MenuButtonStyle}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<i:InvokeCommandAction Command="{Binding ShowAddFermentableViewCmd}" CommandParameter="MainRegion"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button Content="Add Hops" Width="75" Margin="10,0" Style="{DynamicResource MenuButtonStyle}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<i:InvokeCommandAction Command="{Binding ShowAddHopViewCmd}" CommandParameter="MainRegion"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button Content="Add Yeasts" Width="75" Margin="20,0,10,0" Style="{DynamicResource MenuButtonStyle}"/>
<Button Content="View Inventory" Width="75" Style="{DynamicResource MenuButtonStyle}" Margin="20,0,0,0"/>
</StackPanel>
</Grid>
</UserControl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment