Advertisement
Guest User

Untitled

a guest
May 19th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.26 KB | None | 0 0
  1.                     <ItemsControl ItemsSource="{Binding DisplayViewModels}">
  2.                         <ItemsControl.ItemsPanel>
  3.                             <ItemsPanelTemplate>
  4.                                 <WrapPanel Orientation="Horizontal"/>
  5.                             </ItemsPanelTemplate>
  6.                         </ItemsControl.ItemsPanel>                        
  7.                         <ItemsControl.ItemTemplate>
  8.                             <DataTemplate>
  9.                                 <ToggleButton Grid.ColumnSpan="2" Height="30" Template="{StaticResource HeaderTemplate}" IsChecked="{Binding IsChecked, Mode=TwoWay}"
  10.                                              FocusVisualStyle="{StaticResource ResourceKey=FVS_None}">
  11.                                     <ToggleButton.Content>
  12.                                         <StackPanel Orientation="Horizontal">
  13.                                                 <TextBlock FontFamily="Arial" FontWeight="Bold" FontSize="14" Margin="10,0,0,0"
  14.                                                           Foreground="{StaticResource ResourceKey=SectionForeground}" Text="{Binding DisplayText}"/>
  15.                                        
  16.                                                 <Button Margin="10,0,0,0" Content="X" Width="20" Height="20" Style="{StaticResource ResourceKey=Button}"
  17.                                                        Command="{StaticResource ResourceKey=CloseOrder}" CommandParameter="{Binding}"/>
  18.                                         </StackPanel>
  19.                                     </ToggleButton.Content>
  20.                                     <ToggleButton.ContextMenu>
  21.                                         <ContextMenu><MenuItem Command="{StaticResource ResourceKey=CloseOrder}"
  22.                                                        CommandParameter="{Binding Path=PlacementTarget.DataContext, RelativeSource={RelativeSource AncestorType=ContextMenu}}"
  23.                                                        Header="Close Order"/></ContextMenu>
  24.                                     </ToggleButton.ContextMenu>
  25.                                 </ToggleButton>
  26.                             </DataTemplate>
  27.                         </ItemsControl.ItemTemplate>
  28.                     </ItemsControl>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement