BarItemLinkBase.CustomResources Property
Gets or sets custom resources for the current link.
This is a dependency property.
Namespace: DevExpress.Xpf.Bars
Assembly:
DevExpress.Xpf.Core.v20.2.dll
NuGet Packages:
DevExpress.WindowsDesktop.Wpf.Core, DevExpress.Wpf.Core
Declaration
public ResourceDictionary CustomResources { get; set; }
Public Property CustomResources As ResourceDictionary
Property Value
Example
This example demonstrates how to change a BarItemLink’s appearance by customizing templates (available via the CustomResources property)
To learn more on how to implement similar functionality in Silverlight, refer to the T246660 example.
See also: T361488 - How to find and change an inner DevExpress control template.
View Example
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using DevExpress.Xpf.Core;
namespace CustomResources {
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : DXWindow {
public MainWindow() {
InitializeComponent();
}
}
}
<dx:DXWindow x:Class="CustomResources.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:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxcn="clr-namespace:DevExpress.Xpf.Core.Native;assembly=DevExpress.Printing.v16.1.Core"
xmlns:dxbt="http://schemas.devexpress.com/winfx/2008/xaml/bars/themekeys"
xmlns:local="clr-namespace:CustomResources"
Title="MainWindow" Height="350" Width="525">
<Grid>
<dxb:BarManager>
<dxb:BarManager.Items>
<dxb:BarButtonItem Name="bt" Content="BarButtonItem" />
</dxb:BarManager.Items>
<dxb:BarManager.Bars>
<dxb:Bar>
<dxb:Bar.ItemLinks>
<dxb:BarButtonItemLink BarItemName="bt" UserContent="Regular BarButtonItem" />
<dxb:BarButtonItemLink BarItemName="bt" UserContent="BarButtonItem using custom resources">
<dxb:BarButtonItemLink.CustomResources>
<ResourceDictionary>
<ControlTemplate x:Key="{dxbt:BarItemBorderThemeKey ResourceKey=Normal, ThemeName=Office2016White}" TargetType="{x:Type dxb:ItemBorderControl}">
<Border BorderBrush="Red" BorderThickness="3">
<ContentPresenter />
</Border>
</ControlTemplate>
</ResourceDictionary>
</dxb:BarButtonItemLink.CustomResources>
</dxb:BarButtonItemLink>
</dxb:Bar.ItemLinks>
</dxb:Bar>
</dxb:BarManager.Bars>
</dxb:BarManager>
</Grid>
</dx:DXWindow>
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System.Windows.Documents
Imports System.Windows.Input
Imports System.Windows.Media
Imports System.Windows.Media.Imaging
Imports System.Windows.Navigation
Imports System.Windows.Shapes
Imports DevExpress.Xpf.Core
Namespace CustomResources
''' <summary>
''' Interaction logic for MainWindow.xaml
''' </summary>
Partial Public Class MainWindow
Inherits DXWindow
Public Sub New()
InitializeComponent()
End Sub
End Class
End Namespace
See Also