![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | 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. |
| | #2 (permalink) |
| Guest | 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. |
| | #3 (permalink) |
| Guest | 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. |
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Dynamically Drawing Objects | kmttern | Avalon | 0 | 03-25-2008 09:51 AM |
| Changing the color and font of text in new letters | K Viltersten | Vista mail | 2 | 02-14-2008 03:52 AM |
| changing the colors used in highlighting text. | brg11 | Vista General | 3 | 01-19-2008 10:40 AM |
| dynamically create variable? | Pete Gomersall | PowerShell | 1 | 12-22-2007 03:03 PM |
| Dynamically populate unattend.xml | Ca$h C0w | Vista installation & setup | 0 | 05-09-2007 01:50 PM |