Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6772853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:35:52+00:00 2026-05-26T15:35:52+00:00

In my project, I’ve made a control that inherits from Control . It is

  • 0

In my project, I’ve made a control that inherits from Control. It is called DialogHeader and, as its name stands, is for displaying a header on modal, non-resizable dialogs. In truth, it binds by default to its parent Window. The control has a property called IconLocation, i.e. whether the image should be displayed on the left or right side of the control’s label:

[Image] [Label] -- or -- [Label] [Image]

The template used with DialogHeader is basically the following:

<ControlTemplate>
  <Grid>
    <Grid.ColumnDefinitions>
      <ColumnDefinition x:Name="COLN_Left" Width="auto" />
      <ColumnDefinition Width="auto" />
      <ColumnDefinition x:Name="COLN_Right" Width="*" />
    </Grid.ColumnDefinitions>

    <Image Grid.Column="0" Name="PART_Image" />
    <Separator Grid.Column="1"
               Visibility="Collapsed" Width="{TemplateBinding SpacerWidth}" />
    <TextBlock Grid.Column="2" Name="PART_Text" />
  </Grid>
  <ControlTemplare.Triggers>
    <Trigger Property="ImageLocation" Value="Right">
      <Setter TargetName="PART_Image" Property="Grid.Column" Value="2" />
      <Setter TargetName="PART_Text"  Property="Grid.Column" Value="0" />
      <!-- The following doesn't work! Help! -->
      <Setter TargetName="COLN_Left"  Property="Width"       Value="*" />
      <Setter TargetName="COLN_Right" Property="Width"       Value="auto" />
    </Trigger>
  </ControlTemplate.Triggers>
</ControlTemplate>

Simply put, when the ImageLocation property is set to Location.Right, the widths of COLN_Left and COLN_Right should be exchanged. So instead of [auto][auto][*], I should have [*][auto][auto].

How can I make this work from the ControlTemplate? If not, is there are way that doesn’t involve using C# code?

Thank you in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:35:52+00:00Added an answer on May 26, 2026 at 3:35 pm

    That part does work, it possibly is just not what you want i presume. Try to remove it and the result should be different.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Project: I am having a button that toggles the column length from 3 to
My project is master/content. The client validation always scrolls the first control that is
Every project invariably needs some type of reporting functionality. From a foreach loop in
Project was running fine, i made a change some where and couldn't figure out
Project Requirements: I need to build a web service that will receive chunks of
Project is C#. So I have a bunch of multithreaded code that is designed
Project Structure I have a silverlight project SLProj, that references a silverlight class library
project type is MVC2. Let say that i have page1. after success it write
Project name : pro Project location : /home/cha0s/pro/ Applications location : /home/cha0s/pro/apps/ , where
Our project uses XJC to generate Java classes from an XSD. I'm using JAVA

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.