32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
namespace WPFluent.Controls;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// Extends <see cref="System.Windows.Controls.GridView"/> to use WPFluent custom styles
|
|||
|
|
/// </summary>
|
|||
|
|
/// <example>
|
|||
|
|
/// To use this enhanced GridView in a ListView: <code lang="xml"> /// <ListView> /// <ListView.View>
|
|||
|
|
/// /// <local:GridView> /// <GridViewColumn Header="First Name"
|
|||
|
|
/// DisplayMemberBinding="{Binding FirstName}"/> /// <GridViewColumn Header="Last Name"
|
|||
|
|
/// DisplayMemberBinding="{Binding LastName}"/> /// </local:GridView> /// </ListView.View>
|
|||
|
|
/// /// </ListView> ///</code>
|
|||
|
|
/// </example>
|
|||
|
|
public class GridView : System.Windows.Controls.GridView
|
|||
|
|
{
|
|||
|
|
static GridView()
|
|||
|
|
{
|
|||
|
|
ResourceDictionary resourceDict = new()
|
|||
|
|
{
|
|||
|
|
Source = new Uri("pack://application:,,,/WPFluent;component/Controls/GridView/GridViewColumnHeader.xaml"),
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
Style defaultStyle = (Style)resourceDict["UiGridViewColumnHeaderStyle"];
|
|||
|
|
|
|||
|
|
ColumnHeaderContainerStyleProperty.OverrideMetadata(
|
|||
|
|
typeof(GridView),
|
|||
|
|
new FrameworkPropertyMetadata(defaultStyle));
|
|||
|
|
}
|
|||
|
|
}
|