Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a800448

Browse files
authored
Update Readme.md
1 parent b13a0c6 commit a800448

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

‎Readme.md‎

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,30 @@
33
[![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/T325071)
44
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
55
<!-- default badges end -->
6-
<!-- default file list -->
7-
*Files to look at*:
86

9-
* [MainWindow.xaml](./CS/RadialMenuExample/MainWindow.xaml) (VB: [MainWindow.xaml](./VB/RadialMenuExample/MainWindow.xaml))
10-
* [MainWindow.xaml.cs](./CS/RadialMenuExample/MainWindow.xaml.cs) (VB: [MainWindow.xaml.vb](./VB/RadialMenuExample/MainWindow.xaml.vb))
11-
* [TextBoxService.cs](./CS/RadialMenuExample/TextBoxService.cs) (VB: [TextBoxService.vb](./VB/RadialMenuExample/TextBoxService.vb))
12-
* [ViewModel.cs](./CS/RadialMenuExample/ViewModel.cs) (VB: [ViewModel.vb](./VB/RadialMenuExample/ViewModel.vb))
13-
<!-- default file list end -->
14-
# How to: Create a Radial Context Menu
7+
# Create a Radial Context Menu for WPF
8+
9+
This example demonstrates how to create a [WPF Radial Context Menu](https://docs.devexpress.com/WPF/DevExpress.Xpf.Bars.RadialContextMenu) and assign it to a text box.
10+
11+
![WPF Radial Context Menu, DevExpress](https://raw.githubusercontent.com/DevExpress-Examples/create-wpf-radial-context-menu/22.2.2%2B/media/wpf-radial-context-menu-devexpress.png)
12+
13+
## Implementation Details
1514

15+
The radial menu's DataContext is bound to the window's DataContext. The DataContext is set to a `RadialContextMenuViewModel` object (it is automatically generated by `DevExpress.Mvvm.POCO.ViewModelSource`). This object automatically generates commands for all public methods in the `RadialContextMenuViewModel` class.
1616

17-
<p>This example shows how to assign a <a href="https://documentation.devexpress.com/WPF/clsDevExpressXpfBarsRadialContextMenutopic.aspx">RadialContextMenu</a> to a text box and initialize the menu with items.</p>
18-
<p>To assign the <a href="https://documentation.devexpress.com/WPF/clsDevExpressXpfBarsRadialContextMenutopic.aspx">RadialContextMenu</a> to the text box, the <a href="https://documentation.devexpress.com/WPF/DevExpressXpfBarsBarManager_DXContextMenutopic.aspx">BarManager.DXContextMenu</a> attached property is used.</p>
19-
The radial menu displays three regular buttons (Copy, Cut and Paste) and one sub-menu (Select All) that provides access to two additional items (Clear and Select All). Commands are assigned to the buttons with the Command properties.<br><img src="https://raw.githubusercontent.com/DevExpress-Examples/how-to-create-a-radial-context-menu-t325071/14.2.4+/media/d84f3cf7-a3d1-11e5-80bf-00155d62480c.png"><br>The radial menu's DataContext is bound to the window's DataContext. This DataContext is set to a RadialContextMenuViewModel class descendant, which is automatically generated by the <strong>DevExpress.Mvvm.POCO.ViewModelSource</strong> object. This descendant automatically generates commands for all public methods in the RadialContextMenuViewModel class (the ClearSelectionCommand is generated for the ClearSelection method).
17+
The radial menu displays four items: "Copy", "Cut", "Paste", and "Select All". The "Select All" item is a sub-menu with "Clear" and "Select All" items.
2018

21-
<br/>
19+
The item's [Command](https://docs.devexpress.com/WPF/DevExpress.Xpf.Bars.BarItem.Command) property specifies the command:
2220

21+
```xaml
22+
<dxb:BarButtonItem Content="Copy" Glyph="{dx:DXImage Image=Copy_16x16.png}" Command="{Binding CopyCommand}" CommandTarget="{Binding}" />
23+
```
2324

25+
Use the the [BarManager.DXContextMenu](https://docs.devexpress.com/WPF/DevExpress.Xpf.Bars.BarManager.DXContextMenu) property to assign the radial context menu to the text box.
26+
27+
28+
## Files to Review
29+
30+
* [MainWindow.xaml](./CS/RadialMenuExample/MainWindow.xaml) (VB: [MainWindow.xaml](./VB/RadialMenuExample/MainWindow.xaml))
31+
* [TextBoxService.cs](./CS/RadialMenuExample/TextBoxService.cs) (VB: [TextBoxService.vb](./VB/RadialMenuExample/TextBoxService.vb))
32+
* [ViewModel.cs](./CS/RadialMenuExample/ViewModel.cs) (VB: [ViewModel.vb](./VB/RadialMenuExample/ViewModel.vb))

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /