Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HideShowSingleWindow
- <Grid>
- <tb:TaskbarIcon
- IconSource="/Icons/main.ico"
- ToolTipText="SCADA Control Center"
- DoubleClickCommand="{Binding Path=HideShow}">
- <tb:TaskbarIcon.ContextMenu>
- <ContextMenu>
- <ContextMenu.ItemsSource>
- <CompositeCollection>
- <MenuItem Header="Windows" ItemsSource="{Binding Path=RegisteredWindows}">
- <MenuItem.ItemContainerStyle>
- <Style TargetType="{x:Type MenuItem}">
- <Setter Property="Header" Value="{Binding Path=Title}" />
- <Setter Property="IsCheckable" Value="True" />
- <Setter Property="IsChecked" Value="{Binding Path=IsLoaded, Mode=OneWay}"/>
- <Setter Property="Command" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContextMenu}}, Path=HideShowSingleWindow}" />
- <Setter Property="CommandParameter" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContextMenu}}, Path=PlacementTarget.SelectedItem}" />
- </Style>
- </MenuItem.ItemContainerStyle>
- </MenuItem>
- <MenuItem Header="Show/Hide All" Command="{Binding Path=HideShow}" />
- <Separator />
- <MenuItem Header="Exit" Command="{Binding Path=Quit}" />
- </CompositeCollection>
- </ContextMenu.ItemsSource>
- </ContextMenu>
- </tb:TaskbarIcon.ContextMenu>
- </tb:TaskbarIcon>
- </Grid>
- <Setter Property="Command" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContextMenu}}, Path=HideShowSingleWindow}" />
- <Setter Property="Command"
- Value="{Binding RelativeSource={RelativeSource FindAncestor,
- AncestorType={x:Type ContextMenu}},
- Path=PlacementTarget.DataContext.HideShowSingleWindow}"/>
- <Setter Property="Command" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type tb:TaskbarIcon}}, Path=DataContext.HideShowSingleWindow}" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement