StylesInModel
No edit summary
(Updated Edited template to July 12, 2025.)
 
(One intermediate revision by one other user not shown)
Line 2: Line 2:
The introduction article is found here: https://blog.mdriven.net/introducing-styles-in-model/
The introduction article is found here: https://blog.mdriven.net/introducing-styles-in-model/


To get the <span class="col-blue-dark">StylesInModel</span> styles applied to your WPF application, do this to merge the ResourceDictionary:
To get the <span class="col-blue-dark"><span class="col-black">'''StylesInModel'''</span></span> styles applied to your WPF application, do this to merge the ResourceDictionary:
  var stylesinmodelRD = StylesInModelWPF.GenerateResourceDictionaryFromStylesInModel(ViewModelDefinitionsInApplication.GetActionsRuntime(_es.GetType()), wecpof);
  var stylesinmodelRD = StylesInModelWPF.GenerateResourceDictionaryFromStylesInModel(ViewModelDefinitionsInApplication.GetActionsRuntime(_es.GetType()), wecpof);
  if (stylesinmodelRD != null)
  if (stylesinmodelRD != null)
Line 12: Line 12:
'''See also:''' [[Documentation:Theme as data|Theme as data]]
'''See also:''' [[Documentation:Theme as data|Theme as data]]


{{Edited|July|12|2024}}
{{Edited|July|12|2025}}

Latest revision as of 06:03, 20 January 2025

This page was created by Hans.karlsen@mdriven.net on 2020-03-23. Last edited by Edgar on 2025-01-20.

The introduction article is found here: https://blog.mdriven.net/introducing-styles-in-model/

To get the StylesInModel styles applied to your WPF application, do this to merge the ResourceDictionary:

var stylesinmodelRD = StylesInModelWPF.GenerateResourceDictionaryFromStylesInModel(ViewModelDefinitionsInApplication.GetActionsRuntime(_es.GetType()), wecpof);
if (stylesinmodelRD != null)
{
  wecpof.Resources.MergedDictionaries.Add(stylesinmodelRD);
}

See also: Theme as data