/
MainWindow.xaml
63 lines (58 loc) · 3.45 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<dx:DXWindow x:Class="MenuCustomization.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxdb="http://schemas.devexpress.com/winfx/2008/xaml/demobase"
xmlns:dxsps="http://schemas.devexpress.com/winfx/2008/xaml/spreadsheet"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxspscore="clr-namespace:DevExpress.XtraSpreadsheet.Commands;assembly=DevExpress.Spreadsheet.v15.2.Core"
xmlns:local="clr-namespace:MenuCustomization"
Height="400"
Width="800"
Title="Spreadsheet">
<dx:DXWindow.Resources>
<dxsps:SpreadsheetUICommand x:Key="commands" />
</dx:DXWindow.Resources>
<!--region #PopupMenuCustomization-->
<dxb:BarManager x:Name="barManager1" ToolbarGlyphSize="Small">
<dxb:BarManager.Items>
<dxb:BarButtonItem x:Name="customNewFile"
Command="{Binding FileNew, Mode=OneTime, Source={StaticResource commands}}"
Content="Custom Create New File" />
<dxb:BarButtonItem x:Name="customMergeCells"
Command="{Binding EditingMergeAndCenterCells, Mode=OneTime, Source={StaticResource commands}}"
Content="Custom Merge Cells" />
</dxb:BarManager.Items>
<Grid>
<dxsps:SpreadsheetControl x:Name="spreadsheetControl1"
BarManager="{Binding ElementName=barManager1, Mode=OneTime}"
PopupMenuShowing="SpreadsheetControlPopupMenuShowing">
<dxsps:SpreadsheetControl.MenuCustomizations>
<dxsps:SpreadsheetMenuCustomization MenuType="Cell">
<dxb:BarButtonItemLink dxb:BarItemLinkActionBase.ItemLinkIndex="0">
<dxb:BarButtonItemLink.BarItemName>
customMergeCells
</dxb:BarButtonItemLink.BarItemName>
</dxb:BarButtonItemLink>
</dxsps:SpreadsheetMenuCustomization>
<dxsps:SpreadsheetMenuCustomization>
<dxb:BarButtonItemLink dxb:BarItemLinkActionBase.ItemLinkIndex="1">
<dxb:BarButtonItemLink.BarItemName>
customNewFile
</dxb:BarButtonItemLink.BarItemName>
</dxb:BarButtonItemLink>
</dxsps:SpreadsheetMenuCustomization>
<dxsps:SpreadsheetMenuCustomization>
<dxb:BarItemLinkSeparator dxb:BarItemLinkActionBase.ItemLinkIndex="2" />
</dxsps:SpreadsheetMenuCustomization>
<dxsps:SpreadsheetMenuCustomization MenuType="ColumnHeading">
<dxsps:RemoveSpreadsheetCommandAction Id="{x:Static dxspscore:SpreadsheetCommandId.HideColumnsContextMenuItem}" />
<dxsps:RemoveSpreadsheetCommandAction Id="{x:Static dxspscore:SpreadsheetCommandId.UnhideColumnsContextMenuItem}" />
</dxsps:SpreadsheetMenuCustomization>
</dxsps:SpreadsheetControl.MenuCustomizations>
</dxsps:SpreadsheetControl>
</Grid>
</dxb:BarManager>
<!--endregion #PopupMenuCustomization-->
</dx:DXWindow>