This is a migrated thread and some comments may be shown as answers.

Modify the OpenCommand

2 Answers 51 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Missing User
Missing User asked on 11 Jun 2012, 12:57 PM
Hello!

I have an ImageEditor with custom UI and everything is working great, I just want to change some functionality of the Open button. When the user clicks on it, the OpenFileDialog open but the pre-defined file type is *.PNG and every time he need's to change it to .JPG.

Is there a way to override the OpenCommand and change the default file type of the Dialog window?

Here's the code of the button:

<telerik:RadImageEditorButton Grid.Column="0"
                              Image="/Telerik.Windows.Controls.ImageEditor;Component/Images/open.png"
                              Command="{Binding Commands.Open, ElementName=imageEditor}" />

Thanks!

2 Answers, 1 is accepted

Sort by
0
Missing User
answered on 11 Jun 2012, 08:06 PM
Hello again,

I managed to modify the OpenCommand, I've created a class that inherits from OpenImageCommand and then override the ExecuteOverride method and implement my own logic to filter the Dialog for JPG images.

Thanks!


0
Iva Toteva
Telerik team
answered on 12 Jun 2012, 04:35 PM
Hello Joao,

It is good to hear that you have managed to achieve the desired behavior by yourself. Implementing an OpenDocumentCommand which uses an OpenFileDialog with the filter you would like to have is indeed the correct way to do this.

Regards,
Iva Toteva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
ImageEditor
Asked by
Missing User
Answers by
Missing User
Iva Toteva
Telerik team
Share this question
or