Print Page | Close Window

CXTPControlMarkupLabel capabilities in command bar

Printed From: Codejock Forums
Category: General
Forum Name: XAML Snippets
Forum Description: Post your XAML snippets here for everyone to enjoy :)
URL: http://forum.codejock.com/forum_posts.asp?TID=13555
Printed Date: 21 November 2024 at 12:08pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPControlMarkupLabel capabilities in command bar
Posted By: PierreL
Subject: CXTPControlMarkupLabel capabilities in command bar
Date Posted: 02 March 2009 at 9:14pm
Hello folks,

I've been playing with the various markup features and I like it so far! Good job

I must admit I'm having trouble understanding some of the capabilities as I'm new to XAML. It could also be that I'm trying to do something which is not supported? Here's an example of what I'm trying to achieve, maybe someone can help me figure this out?

I have a frame that contains a few toolbars. One of these toolbars hosts a CXTPControlMarkupLabel to which I applied some markup. I want it to look like this:



(See further down for the markup code)


My problem:
1- The Button is not responding to click events as it does in the MarkupPad. For this to work, does the host of such a control need to derive from 'CXTPMarkupContext'?

2- If possible, how do I "connect" this label (using SetDelegate) when my frame does not derive from CXTPMarkupContext? Is there a way to do this so I can respond to events in my frame class? I'd like to display a drop-down list when it is clicked.

Thank's for your help,
Peter

Markup code:


<StackPanel Orientation="Horizontal">
 <Button>       
  <Grid>
   <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto"/>
    <ColumnDefinition Width="*"/>
    <ColumnDefinition Width="*"/>
    <ColumnDefinition Width="*"/>
   </Grid.ColumnDefinitions>
   <Image Grid.Column="0" Width="24" Height="24" HorizontalAlignment="Left"
          VerticalAlignment="Top" Source="1002"/>         
   <TextBlock Grid.Column="1" FontWeight="Bold" Foreground="Navy"
            Text="Jason Bourne" TextAlignment="Left" VerticalAlignment="Center"/>
   <TextBlock Grid.Column="2" Margin="8, 0, 8, 0" Foreground="Gray"
            TextAlignment="Right" VerticalAlignment="Center">(Available:
            <Hyperlink ToolTip="Call Jason...">+16101234567</Hyperlink>)
   </TextBlock>
   <Image Grid.Column="3" Width="11" Height="11"
          HorizontalAlignment="Right" VerticalAlignment="Center" Source="1003"/>
  </Grid>           
 </Button>
</StackPanel>




-------------
Product: Xtreme ToolkitPro version 13.0.0
Platform: Windows XP (32bit) - SP 3
Language: C++ (MFC)



Replies:
Posted By: Oleg
Date Posted: 03 March 2009 at 1:03am
Hi,
 
Sorry, with CommandBars you can only use format features of Markup but can't use its events :(
 
So there is more difficult path - create standard STATIC with Markup (copy code from our sample) and insert it to toolbar with CXTPControlCustom control type.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: PierreL
Date Posted: 03 March 2009 at 2:13pm
Thanks Oleg,

Maybe in future releases?

About the format features of Markup (in regards to my sample), can I change the default look of the markup button from my sample above? More specifically, can I use LinearGradientBrush & GradientStops? I tried but it requires the Page.Resource tag, which I assume is not supported in the CommandBars right?

Oh, and which Sample were you referring to in your reply?


Thanks again!
Peter





-------------
Product: Xtreme ToolkitPro version 13.0.0
Platform: Windows XP (32bit) - SP 3
Language: C++ (MFC)


Posted By: Oleg
Date Posted: 04 March 2009 at 3:47am
Hi,
I mean \Samples\ToolkitPro\MarkupSample  sample and its MarkupStatic file.
 
Maybe event better  to use our CXTPButton with markup inside. Check this sample anyway. :)


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net