Advertisement
Guest User

Untitled

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