Sample app command bindings

Ribbon for WPF Forum

Posted 15 years ago by Crile Carvey
Version: 4.5.0480
Avatar
Hi,

I've been plugging the sample app and am having a heck of a time following the code execution.

For the Ribbon / Gallery Color Pickers app, where is the ribbonSamplesDemoDocumentEditor:ApplicationCommands.ApplyForeground command bound?

Thanks, Crile

Comments (5)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Look at the top of the XAML for "ribbonSamplesDemoDocumentEditor" and that will show you the namespace that contains that particular ApplicationCommands.

In this case, it's in the "ProductSamples\RibbonSamples\Demo\DocumentEditor" folder.


Actipro Software Support

Posted 15 years ago by Crile Carvey
Avatar
Thanks - I had found that, but where is the code that fires when ribbonSamplesDemoDocumentEditor:ApplicationCommands.ApplyForeground is executed?
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Crile,

You can do a search in the code to see where it's used. Better yet, open the ApplicationCommands class in VS in the sample project and do Find All References on ApplyForeground. That will show you exactly where it's used.


Actipro Software Support

Posted 15 years ago by Crile Carvey
Avatar
>> Better yet, open the ApplicationCommands class in VS in the sample project and do Find All References on ApplyForeground.

Thanks, but that does not show the implementation - just four references as follows:
C:\Working\_WPF Projects\ActiproSamples\SampleBrowser\ProductSamples\RibbonSamples\Demo\DocumentEditor\ApplicationCommands.cs - (167, 9) : if (applyForeground == null)

C:\Working\_WPF Projects\ActiproSamples\SampleBrowser\ProductSamples\RibbonSamples\Demo\DocumentEditor\ApplicationCommands.cs - (168, 6) : applyForeground = new RibbonCommand("ApplyForeground", typeof(Ribbon), "Text Color");

C:\Working\_WPF Projects\ActiproSamples\SampleBrowser\ProductSamples\RibbonSamples\Demo\DocumentEditor\ApplicationCommands.cs - (169, 12) : return applyForeground;

C:\Working\_WPF Projects\ActiproSamples\SampleBrowser\ProductSamples\RibbonSamples\Demo\DocumentEditor\ApplicationCommands.cs - (24, 38) : private static RibbonCommand applyForeground;
I'm apparently not as conversant with the WPF Routed Command model as I need to be. More ideas how to trace through this sample code?

Crile
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
You need to do it on the public ApplyForeground property, not the private field in ApplicationCommands. If you do that it will point you right where the code that uses it is.


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.