none
How to set the workflow custom activity properties to [Browsable(false)] dynamically RRS feed

  • Question

  • I have created custom activity inherits native activity with activity designer.

    In custom activity i have created three properties with attribute as [Browsable(true)]

    My requirement is if i cange some thing in my custom activity designer these three properties needs to be set to [Browsable(false)] i.e. I want to hide these properties.

    Please help me.


    Regards, Naveen G
    Monday, July 25, 2011 9:10 AM

Answers

  • Hi, Naveen

    I would suggest you display these custom properties in Custom Activity designer. activity designer is actually base on WPF. so you can make any change as you like in the designer. for example, you have a activity designer:
    <sap:ActivityDesigner x:Class="MyActivityDesignerLibrary.ActivityDesignerTest"
        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>
            <StackPanel>
            <Button Content="Button"   Name="button1"  Click="button1_Click"  />
            <Label  Content="Label"   Name="label1"  />
            </StackPanel>
        </Grid>
    </sap:ActivityDesigner>
    Here is the backend code:
        public partial class ActivityDesignerTest {
            public ActivityDesignerTest() {
                InitializeComponent();
            }
     
            private void button1_Click(object sender, RoutedEventArgs e) {
                label1.Content = "haha";
            }
        }

    Now,  associate it with a activity by

     [Designer(typeof(ActivityDesignerTest))]
    

    Then build all project, place this activity in a workflow, then click "Button", label content will become "haha"

    Hope this helps
    Regards


    MSDN Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This posting is provided "AS IS" with no warranties, and confers no rights. My Blog: http://xhinker.com
    Microsoft Windows Workflow Foundation 4.0 Cookbook
    Monday, August 1, 2011 8:06 AM
    Moderator

All replies

  • Hi, Naveen

    I would suggest you display these custom properties in Custom Activity designer. activity designer is actually base on WPF. so you can make any change as you like in the designer. for example, you have a activity designer:
    <sap:ActivityDesigner x:Class="MyActivityDesignerLibrary.ActivityDesignerTest"
        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>
            <StackPanel>
            <Button Content="Button"   Name="button1"  Click="button1_Click"  />
            <Label  Content="Label"   Name="label1"  />
            </StackPanel>
        </Grid>
    </sap:ActivityDesigner>
    Here is the backend code:
        public partial class ActivityDesignerTest {
            public ActivityDesignerTest() {
                InitializeComponent();
            }
     
            private void button1_Click(object sender, RoutedEventArgs e) {
                label1.Content = "haha";
            }
        }

    Now,  associate it with a activity by

     [Designer(typeof(ActivityDesignerTest))]
    

    Then build all project, place this activity in a workflow, then click "Button", label content will become "haha"

    Hope this helps
    Regards


    MSDN Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This posting is provided "AS IS" with no warranties, and confers no rights. My Blog: http://xhinker.com
    Microsoft Windows Workflow Foundation 4.0 Cookbook
    Monday, August 1, 2011 8:06 AM
    Moderator
  • I don't think this is what he asked. What he asked is how to change Browsable to false in dynamically, so that it won't show up in the property panel
    Tuesday, August 2, 2011 1:45 AM
  • exactly you are correct, can i have the answer for that question?
    Monday, July 29, 2019 10:43 AM