How to add icon to custom activity (without activity creator)

Hello , i have made many custom activities , but i never add a icon to the activity , but i think i want to add one now , but i cant figure out where and how to add the icon to each activity

im not using activity creator for building my activities , im using the old way of creating it (Class Library .netframework)

I have checked this question on the forum on the same topic but the link for the ICON added in the answer doesn’t redirect to the page it intended too

and the answer is for the Activity Creator not for the one im looking for

Here is my code

namespace Tiff_To_Pdf
{
    [DisplayName("Convert Tiff to PDF")]
    [Description("Converts a TIFF file to a PDF.")]
    public class ConvrtTiffToPdf : CodeActivity
    {
        [Category("Input")]
        [DisplayName("Tiff File Path")]
        [RequiredArgument]
        [Description("Enter the path to the TIFF file to be converted.")]
        public InArgument<string> TiffFilePath { get; set; }

        [Category("Input")]
        [DisplayName("PDF File Path")]
        [RequiredArgument]
        [Description("Enter the path to save the converted PDF file.")]
        public InArgument<string> PdfFilePath { get; set; }

        protected override void Execute(CodeActivityContext context)
        {
            try
            {
                string tiffFilePath = TiffFilePath.Get(context);
                string pdfFilePath = PdfFilePath.Get(context);

                ConvertTiffToPdf(tiffFilePath, pdfFilePath);
            }
            catch (Exception ex)
            {
                Console.WriteLine($"An error occurred: {ex.Message}");
            }
        }
}

@indiedev91

Generally in project we main icons in .cs file which is used for design…is there some file that is used for design?

Cheers

No, there is no design file, here is the solution explorer to have look

maybe you have to define an association between your activity and activity designer before.

didnt understand quite well, and how can i do that

https://docs.uipath.com/activities/other/latest/developer/creating-activities-with-code
Step 16

okay i have added, now how to add the image in this

<sap:ActivityDesigner x:Class="Tiff_To_Pdf.ActivityDesigner1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
    xmlns:sapv="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation">
    <Grid>
        
    </Grid>
</sap:ActivityDesigner>

maybe the following can help:
https://blogs.msmvps.com/theproblemsolver/2010/01/25/changing-the-icon-on-a-custom-activity-designer/

it is working but its a lot of hastle ,bydefault layout that is created by UiPath is now not visible i have to make the layout by myself if i use the ActivityDesigner

which is too much time consuming right now

i thought maybe adding just icon will be not that big thing but i was wrong

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.