Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
85
Trying to include a xamComboEditor in an Expander header
posted

I have created a ControlTemplate that will place a xamComboEditor into the header of an Expander, so it looks like this:

When opened it looks like this:

The idea is that the xamComboEditor will store the names of several presets so changing the value in the dropdown will easily change the values selected in the expander.  When closed the user can still easily see the name of the preset values chosen.

As you can see, I have the control template created, but I'm lost trying to figure out how to get access to the properties of the xamComboEditor.  For instance, I want to change the values in the dropdown programatically (in VB).  I'm relatively new to WPF and I'm sure I'm just missing some concept.

Ideas anyone?

Thanks in advance,

John

Parents
  • 30
    posted

    Define HeaderTemplate of Expander for XamComboEditor.

    Code in XAML is as follows:-

     

     

    <Expander.HeaderTemplate>  

    <DataTemplate>

     

     

     

    <infra:XamComboEditor DisplayMemberPath="Name" ValuePath="ID" Name="uxTesting" ItemsSource="{DynamicResource lstCollection}" Width="Auto" ></infra:XamComboEditor>

     

     

     

     

    </DataTemplate>

     

     

     

    </Expander.HeaderTemplate> 

    You can easily access this XamComboEditor in code behind as

    XamComboEditor cmbEditor = uxExpander.HeaderTemplate.LoadContent()  as XamComboEditor;

    Now u get XamComboEditor, you can set any property of it.

    I hope this will help you.

    Thanks...

Reply Children