Click here to Skip to main content
16,015,518 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: How to read the data from listbox Itemsource datatemplate and display it in UI controls Pin
Ian Shlasko20-Apr-11 3:57
Ian Shlasko20-Apr-11 3:57 
GeneralRe: How to read the data from listbox Itemsource datatemplate and display it in UI controls Pin
Tarun.K.S20-Apr-11 4:09
Tarun.K.S20-Apr-11 4:09 
GeneralRe: How to read the data from listbox Itemsource datatemplate and display it in UI controls Pin
Ian Shlasko20-Apr-11 4:12
Ian Shlasko20-Apr-11 4:12 
GeneralRe: How to read the data from listbox Itemsource datatemplate and display it in UI controls Pin
Kunal Chowdhury «IN»20-Apr-11 22:44
professionalKunal Chowdhury «IN»20-Apr-11 22:44 
GeneralRe: How to read the data from listbox Itemsource datatemplate and display it in UI controls Pin
Rocky2327-Apr-11 19:49
Rocky2327-Apr-11 19:49 
GeneralRe: How to read the data from listbox Itemsource datatemplate and display it in UI controls Pin
Ian Shlasko28-Apr-11 1:41
Ian Shlasko28-Apr-11 1:41 
QuestionPulling controls from resources Pin
Jean-Louis Leroy19-Apr-11 2:51
Jean-Louis Leroy19-Apr-11 2:51 
AnswerRe: Pulling controls from resources Pin
Ian Shlasko19-Apr-11 5:56
Ian Shlasko19-Apr-11 5:56 
Jean-Louis Leroy wrote:
<layer>If it works, will I get a single instance of a control (as identified by the same key) shared between my dialogs ? Or is a new instance created each time I pull from the resources ?

Neither... Each defined resource is a single instance, but it gets defined once for every window. So each window gets exactly one instance. This means you can use it once per window, but no more than that (Because a UI element can only have one parent).

Jean-Louis Leroy wrote:
When I run it, I get a "first chance exception of type 'System.InvalidOperationException' occurred in mscorlib.dll - Additional information: Stack empty.".

I would suggest looking at the call stack, to get a little more information about that exception. Exactly what was it trying to do when it hit that exception? Was it related to the control being in the StackPanel, or was it something inside the FeatureSelectionControl?

Jean-Louis Leroy wrote:
What are the alternatives (I see one: put the three strings in resources, not the entire control).

You could also do this by defining styles or templates. Those are intended to be reused (Unlike defining the control itself as a resource). Then, instead of putting a StaticResource directly into a StackPanel, you would do something like this:
XAML
<Style x:Key="GroupOwnerCRDSCode" TargetType="local:FeatureSelectionControl">
  <Setter Property="Table" Value="GroupOwnerCRDSCode"/>
  <Setter Property="Label" Value="Customer Group"/>
  <Setter Property="SelectStatement">
    <Setter.Value>
      SELECT blablabla
    </Setter.Value>
  </Setter>
</Style>

XAML
<StackPanel ...>
  <local:FeatureSelectionControl Style="{StaticResource GroupOwnerCRDSCode}"/>
</StackPanel>

Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels)

GeneralRe: Pulling controls from resources Pin
Jean-Louis Leroy19-Apr-11 23:00
Jean-Louis Leroy19-Apr-11 23:00 
GeneralRe: Pulling controls from resources Pin
Ian Shlasko20-Apr-11 2:40
Ian Shlasko20-Apr-11 2:40 
GeneralRe: Pulling controls from resources Pin
Jean-Louis Leroy20-Apr-11 3:00
Jean-Louis Leroy20-Apr-11 3:00 
QuestionHow To Create This Menu In WPF Pin
Kevin Marois18-Apr-11 10:49
professionalKevin Marois18-Apr-11 10:49 
AnswerRe: How To Create This Menu In WPF Pin
Pete O'Hanlon18-Apr-11 11:20
mvePete O'Hanlon18-Apr-11 11:20 
GeneralRe: How To Create This Menu In WPF Pin
Kevin Marois18-Apr-11 11:26
professionalKevin Marois18-Apr-11 11:26 
GeneralRe: How To Create This Menu In WPF Pin
Pete O'Hanlon18-Apr-11 11:31
mvePete O'Hanlon18-Apr-11 11:31 
GeneralRe: How To Create This Menu In WPF Pin
Kevin Marois19-Apr-11 5:22
professionalKevin Marois19-Apr-11 5:22 
GeneralRe: How To Create This Menu In WPF Pin
Pete O'Hanlon19-Apr-11 6:37
mvePete O'Hanlon19-Apr-11 6:37 
QuestionAnybody got TaskbarItemProgressState.Indeterminate to work? Pin
SledgeHammer0118-Apr-11 6:55
SledgeHammer0118-Apr-11 6:55 
AnswerRe: Anybody got TaskbarItemProgressState.Indeterminate to work? Pin
KevinAG6-Mar-19 6:14
KevinAG6-Mar-19 6:14 
QuestionProblem with this binding... Pin
SledgeHammer0118-Apr-11 6:49
SledgeHammer0118-Apr-11 6:49 
AnswerRe: Problem with this binding... Pin
Adrian Cole18-Apr-11 11:03
Adrian Cole18-Apr-11 11:03 
GeneralRe: Problem with this binding... Pin
SledgeHammer0118-Apr-11 11:55
SledgeHammer0118-Apr-11 11:55 
QuestionResource dictionary [modified] Pin
CrafterIt18-Apr-11 4:36
CrafterIt18-Apr-11 4:36 
AnswerRe: Resource dictionary Pin
Kunal Chowdhury «IN»20-Apr-11 22:37
professionalKunal Chowdhury «IN»20-Apr-11 22:37 
Questiondialogs must be user-initiated silverlight 4 Pin
NTheOne18-Apr-11 1:24
NTheOne18-Apr-11 1:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.