Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Dynamically changing RoutedUICommand->Text

 
 
Old 09-01-2006   #1 (permalink)
=?Utf-8?B?Sm9obiBEdW5u?=


 
 

Dynamically changing RoutedUICommand->Text

When is it possible to changed the Text propery of a RoutedUICommand and have
it display with the new value in a Menu? In my application it would be ideal
to set this member during the CanExecute call - at that point I know exactly
what I need to show the user ( Undo <last_cmd_here> ). The problem is that
doing so has no effect on the text displayed. I can set Text at other points
in the code and it takes affect.

My System SpecsSystem Spec
Old 09-05-2006   #2 (permalink)
=?Utf-8?B?VGhlUkhvZ3Vl?=


 
 

RE: Dynamically changing RoutedUICommand->Text

There are RoutedCommand and ICommand samples in the SDK:
http://windowssdk.msdn.microsoft.com.../ms771540.aspx

The negative with the link is that it takes you to a 72 megabyte download to
Beta 2 samples. The positive is that you get a lot of samples you can easily
search through to find code samples...the RoutedCommand sample built on the
latest WPF release.

The following syntax may be of interest to you:

<CommandBinding Command="{x:Static custom:Window1.ColorCmd}"
Executed="WindowColorCmdExecuted"
CanExecute="ColorCmdCanExecute"/>

If the architecture of routed command doesn't work, you will need to
implement an ICommand which is easy to do...and there is an SDK sample too

"Give a man a fish, and you feed him for a day. Teach a man to fish, and you
feed him for a lifetime." ...I think I prefer..."Learn to fish, and feed
yourself for a lifetime."


"John Dunn" wrote:

> When is it possible to changed the Text propery of a RoutedUICommand and have
> it display with the new value in a Menu? In my application it would be ideal
> to set this member during the CanExecute call - at that point I know exactly
> what I need to show the user ( Undo <last_cmd_here> ). The problem is that
> doing so has no effect on the text displayed. I can set Text at other points
> in the code and it takes affect.

My System SpecsSystem Spec
Old 09-05-2006   #3 (permalink)
=?Utf-8?B?VGhlUkhvZ3Vl?=


 
 

RE: Dynamically changing RoutedUICommand->Text

Sorry, John. My response was for the previous post, but it still may help you
as the SDK samples in this area is very good.

"TheRHogue" wrote:

> There are RoutedCommand and ICommand samples in the SDK:
> http://windowssdk.msdn.microsoft.com.../ms771540.aspx
>
> The negative with the link is that it takes you to a 72 megabyte download to
> Beta 2 samples. The positive is that you get a lot of samples you can easily
> search through to find code samples...the RoutedCommand sample built on the
> latest WPF release.
>
> The following syntax may be of interest to you:
>
> <CommandBinding Command="{x:Static custom:Window1.ColorCmd}"
> Executed="WindowColorCmdExecuted"
> CanExecute="ColorCmdCanExecute"/>
>
> If the architecture of routed command doesn't work, you will need to
> implement an ICommand which is easy to do...and there is an SDK sample too
>
> "Give a man a fish, and you feed him for a day. Teach a man to fish, and you
> feed him for a lifetime." ...I think I prefer..."Learn to fish, and feed
> yourself for a lifetime."
>
>
> "John Dunn" wrote:
>
> > When is it possible to changed the Text propery of a RoutedUICommand and have
> > it display with the new value in a Menu? In my application it would be ideal
> > to set this member during the CanExecute call - at that point I know exactly
> > what I need to show the user ( Undo <last_cmd_here> ). The problem is that
> > doing so has no effect on the text displayed. I can set Text at other points
> > in the code and it takes affect.

My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Changing text in subject line Vista mail
changing the colors used in highlighting text. Vista General
Outlook Replies Changing to Text Microsoft Office
Changing the default text size in windows mail Vista mail
Changing the color and font of text in new letters Vista mail


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46