的代码背后是什么

的代码背后是什么

本文介绍了“{StaticResource {dxgt:GridRowThemeKey ResourceKey = RowStyle}}”的代码背后是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的XAML代码



This is my XAML Code

<Window x:Class="Q316995.MainWindow"

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"

        xmlns:dxgt="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"

        xmlns:local="clr-namespace:Q316995"

        Title="MainWindow" Height="350" Width="525">

<Window.Resources>
    <ResourceDictionary>
        <Style x:Key="LastRowHighlighted"

                BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=RowStyle}}"

                TargetType="{x:Type dxg:GridRowContent}">
        </Style>
    </ResourceDictionary>
</Window.Resources>







类似于c#代码的背后是






its similar behind c# code is

Binding _Binding = new Binding();
_Binding.Converter = new LastRowHighlighter();

Setter _Setter = new Setter();
_Setter.Property = GridRowContent.FontWeightProperty;
_Setter.Value = _Binding;

Style _Style = new System.Windows.Style();
//_Style.BasedOn = new Style(typeof(GridRowContent));
_Style.TargetType = typeof(GridRowContent);
_Style.Setters.Add(_Setter);

grid.Resources.Add("LastRowHighlighted", _Style);





i不知道如何更换

BasedOn ={StaticResource {dxgt:GridRowThemeKey ResourceKey = RowStyle} }

with

c #code



i do not know how can i replace
BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=RowStyle}}"
with
c# code

推荐答案

BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=RowStyle}}





和应用您自己的setter,例如



and apply your own setters like

<setter property="Background" value="Green" />


这篇关于“{StaticResource {dxgt:GridRowThemeKey ResourceKey = RowStyle}}”的代码背后是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 00:48