This version of the page http://lvivcommunity.net/?tag=/style (0.0.0.0) stored by archive.org.ua. It represents a snapshot of the page as of 2008-06-11. The original page over time could change.
Lviv .NET Community - All posts tagged 'style'
(Lviv community of .NET developers)
Home News
  • Archive
  • About
  • Conferences
  • |  
  • Sign in / Register

Recent posts

Кастомізація стилів в класах наслідуваних від класу Selector - Custom style for a class which is inherited from the class of Selector

августа 16, 2007 09:21 by RredCat

Нам потрібно виставити свої стилі і шаблони для для елементів, якими наповнюються контроли наслідувані від абстрактного класу Selector (до них належить стандартні ComboBox, ListBox, TabControl).
Це можна зробити двома шляхами.
1) В ресурси самого контрола внести стилі і шаблони айтемів. Це трохи незручно. З цих стилів і шаблонів нічого не можна буде "побачити" за межами ресурсів "батьківського" контрола.
2) Використати віднаслідувану від Selector`a пропертю ItemContainerStyle - внести в неї значення по ключу статичного ресурса.

PS: Зручність другого способу особливо помітна при написанні контролів, коли для кастомізації айтема потрібна інфа з-за меж "батьківського" ресурсу.


We need set own custom style or template for item of control which was inheritance from abstract class 'Selector' (for example: ComboBox, ListBox, TabControl)
We can use two way:
1) We can add in control's resource some style and template. But it isn't good way, because these styles and templates have access only in boundary of control.
2) We can use inheritance from Selector ItemContainerStyle dependency property and set in it new style value.

Currently rated 5,0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags: custom style, style, template, wpf, ua, en
Categories:
Actions: Permalink | Comments (0) | RSS