Open file and save buttons

Image_9837_1727413904171

Open file and save buttons should be hidden, how to do it.


3 Replies 1 reply marked as answer

VO Vishal Omprasad Syncfusion Team September 27, 2024 08:36 AM UTC

Hi Jaloliddin,

Regarding “hide Open and Save buttons”:

Your requirement to hide the Open and Save icons can be achieved using the custom SfImageEditor and overriding the OnApplyTemplate() method, where you can hide the hide/disable the toolbar items of your need.

[XAML]:

<local:CustomEditor x:Name="editor" ImageSource="Assets/Buildingimage.jpg"/>

[C#]:

public class CustomEditor : SfImageEditor

{

    public override void OnApplyTemplate()

    {

        base.OnApplyTemplate();

 

        var border = this.Template.FindName("PART_HeaderToolbarPanel", this) as Border;

        var panel = (border.Child as Grid).Children[0] as StackPanel;

        var browseButton = panel.Children[0] as Button;

        var saveButton = panel.Children[1] as Button;

        var line = panel.Children[2] as Rectangle;

 

        browseButton.Visibility = Visibility.Collapsed;

        saveButton.Visibility = Visibility.Collapsed;

        line.Visibility = Visibility.Collapsed;

    }

}

We have prepared an example sample illustrating the above approach and have attached it below for your reference. Please check the sample and let us know whether your requirement is achieved.

We have already published a Knowledge Base article on how to keep only the default toolbar items in WPF SfImageEditor control: How to keep only the default toolbar items in WPF SfImageEditor?.

We hope that this helps you. Please let us know if you need further assistance.

Regards,
Vishal O.


Attachment: WpfImageEditor_e512df5d.zip

Marked as answer

J“ Jaloliddin “Jm7uz” replied to Vishal Omprasad September 27, 2024 09:29 AM UTC

thank you



PR Preethi Rajakandham Syncfusion Team September 27, 2024 09:37 AM UTC

Hi Jaloliddin,

You're welcome. We will mark this thread as solved. Please let us know if you need further assistance. As always, we are happy to help you out. 

Regards,

Preethi R


Loader.
Up arrow icon