Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Organising resources
Message
 
 
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Miscellaneous
Thread ID:
01384902
Message ID:
01385150
Views:
24
Thanks, Viv.

>Hi,
>Debatable. See:http://en.wikipedia.org/wiki/American_and_British_English_spelling_differences
>(the -ise -ize bit)
>I'm an -ise man <g>
>
>>Unrelated question. In US it's organizing. I believe I discussed it before with Terry, is it 'organising' in UK ?
>>
>>>Hi,
>>>
>>>I'm looking at general design for a WPF application. There seems to be plenty of reading on property and style inheritance, user controls etc but very little on strategies for pulling the whole thing together as a type of framework. To get a feel for what can be done I've created a UserControl which wraps a couple of elements plus a button. The buttons click is used to raise a 'Clicked' event at the control level. Now I might need to use this as, say, a DataTemplate in a ListBox. So in Window.Resources I wrap it in a Style so:
>>><Style x:Key="RectTemplate" TargetType="ItemsControl">
>>>  <Setter Property="ItemsControl.ItemTemplate">
>>>    <Setter.Value>
>>>      <DataTemplate>
>>>        <loc:TestListItem x:Name="TLI" Clicked="TestListItem_Clicked" />
>>>      </DataTemplate>
>>>    </Setter.Value>
>>>  </Setter>
>>> </Style>
and then use it for a Listbox:
<ListBox Grid.Row="1" Name="listBox1"  Style="{StaticResource RectTemplate}" SelectionMode="Extended"
>>>      HorizontalContentAlignment="Stretch">
>>></ListBox>
So far so good - everything works fine. But say that I now want to move the Style definition to an external or application level resource dictionary. The Clicked event handler can't now be hooked up because it is not in scope. So how can I hook it up in the Listbox on the form (even in code behind)?
>>>Or is there a better way of architecting this sort of thing?
>>>Regards,
>>>Viv
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform