Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

wpf StaticResource to c# behind code

$
0
0

This is my XAML Code

<Window.Resources><ResourceDictionary><Style x:Key="LastRowHighlighted"
                    BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=RowStyle}}"
                    TargetType="{x:Type dxg:GridRowContent}"></Style></ResourceDictionary></Window.Resources>

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 do not know how can i replace
BasedOn="{StaticResource {dxgt:GridRowThemeKey ResourceKey=RowStyle}}"
with c# code


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>