All the controls missing in WPF. Over 1 million downloads.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
2.7 KiB

<!--***********************************************************************************
Toolkit for WPF
Copyright (C) 2007-2025 Xceed Software Inc.
This program is provided to you under the terms of the XCEED SOFTWARE, INC.
COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
https://github.com/xceedsoftware/wpftoolkit/blob/master/license.md
For more features, controls, and fast professional support,
pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/
Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids
**********************************************************************************-->
<local:DemoView x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views.PropertyGridAdvancedContextMenuView"
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:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
xmlns:view="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer.Samples.PropertyGrid.Views"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:s="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d"
Title="Advanced ContextMenu"
VerticalScrollBarVisibility="Disabled">
<local:DemoView.Description>
<Paragraph FontSize="14"
FontFamily="Segoe">
By default the PropertyGrid provides a context menu for all the properties for a given object. You can override this behavior by setting the ShowAdvancedOptions property to True, and then use the AdvancedOptionsMenu property to provide a custom context menu for the properties.
</Paragraph>
</local:DemoView.Description>
<local:DemoView.Resources>
<ResourceDictionary>
<xctk:PropertyGridContextMenu x:Key="AdvancedOptionsMenu">
<MenuItem Header="Copy"
Click="MenuItem_Click" />
</xctk:PropertyGridContextMenu>
</ResourceDictionary>
</local:DemoView.Resources>
<Grid>
<xctk:PropertyGrid x:Name="_propertyGrid"
Width="450"
MaxHeight="245"
Margin="10"
ShowAdvancedOptions="True"
SelectedObject="{Binding}"
AdvancedOptionsMenu="{StaticResource AdvancedOptionsMenu}">
</xctk:PropertyGrid>
</Grid>
</local:DemoView>