Change the colour of the rectangle dynamically:

Hi,
I've some tiles in wpf application. (non clickable, drawn using Rectangle). I want to change the colour of the tile depending upon condition Ok, Warning, Error to the colour Blue, Yellow, Red respectively. 
Can you please let me know how can I achieve this?
Thanks,
Santosh

Thanks for the response.
I'm using Datatemplate like below:
<DataTemplate x:Key="Template1" DataType="{x:Type BusinessObjects:BindableCapability}">
            <Border x:Name="CapabilityBorder"
                          Background="{StaticResource GlobalHeaderBackgroundBrush}"
                          BorderBrush="{StaticResource TileBorderBrush}"
                          BorderThickness="1"
                          Margin="8"
                          Height="200"
                          Width="420">
                <Grid>
                    <TextBlock x:Name="CapabilityTextBlock"
                                 Text="{Binding CapabilityIdentifierDescription}"
                                 Style="{StaticResource TileTitleTextStyle}"/>
                </Grid>
            </Border>
            <DataTemplate.Triggers>
                <DataTrigger Binding="{Binding IsAvailable}" Value="False">
                    <Setter TargetName="CapabilityBorder" Property="Background" Value="{StaticResource TileErrorBrush}"/>
                    <Setter TargetName="CapabilityTextBlock" Property="Foreground" Value="{StaticResource TileErrorForegroundBrush}"/>
                </DataTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>
        <DataTemplate x:Key="Template2" DataType="{x:Type BusinessObjects:BindableCapability}">
            <Border x:Name="CapabilityBorder"
                          Background="{StaticResource GlobalHeaderBackgroundBrush}"
                          BorderBrush="{StaticResource TileBorderBrush}"
                          BorderThickness="1"
                          Margin="8"
                          Height="200"
                          Width="202">
                <Grid>
                    <TextBlock x:Name="CapabilityTextBlock"
                                 Text="{Binding CapabilityIdentifierDescription}"
                                 Style="{StaticResource TileTitleTextStyle}"/>
                </Grid>
            </Border>
            <DataTemplate.Triggers>
                <DataTrigger Binding="{Binding IsAvailable}" Value="False">
                    <Setter TargetName="CapabilityBorder" Property="Background" Value="{StaticResource TileErrorBrush}"/>
                    <Setter TargetName="CapabilityTextBlock" Property="Foreground" Value="{StaticResource TileErrorForegroundBrush}"/>
                </DataTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>
Like Temlate1 and Templdate2, I should have one more template which fills the color dynamically for the above templates. I've 12 tiles (rectangles), I need to give some blue, some yellow and some red depending upon some condition.
Please suggest how I can achieve this?
Thanks,
Santosh

Similar Messages

  • How to change the images dynamically in a table.

    Hai,
                     How to change the images dynamically in a table based on the condition in webdynpro abap.
    Edited by: Ravi.Seela on Oct 13, 2011 2:17 PM

    This has been much discussed earlier. Do search posts.
    For your scenario i would do the following.
    inside your node which is binded to the table, i create a new node image with cardinality 1 ..1 and a attribute called path of type string.
    create a  supply function for the node image .
    Supply method now has a Element (Parent element ) and node.
    Based on your record in element, set the right image source to path attribute and bind the node.
    This will make sure that the framework calls the image supply function for every row in a table.

  • How change the graph dynamically based on pivot table.

    Hi,
    My Report having pivot table and bar chart. Organization Name column set as pivot table prompts in pivot table.So Organization Name is appear as dropdown list.If i choose the diffrent Organization Names the pivot table data is according to the Organization Name but no changes in chart.How change the Graph dynamically based on pivot table.
    Please help on this.

    ok.I created pivot table with 4 columns and created chart using pivot table chart options but all 4 columns are displaying chart.But I need only 2 column in chart ..unable to edit the only chart in pivot table.Please help on this.Thank you..

  • How to change the image dynamically depend upon the input parameter

    Hi All
    I have one report running depend upon the Organization specific, I have 15 operating unit and 15 different logo for each operating unit.
    How to change the Logo dynamically depend upon the input passed by the user.
    If I have three or four logo i can add in my layout using if else statement and its works fine but i have more that 10 logos so its no possible to keep these in My RTF Template.
    Is it possible to change the logo according to the input without keeping this in Template.
    I have seen this link but its not working fine
    http://erpschools.com/articles/display-and-change-images-dynamically-in-xml-publisher
    Regards
    Srikkanth.M

    Hi,
    I have not completed fully,so sorry i cant able to share the files, could you please give me some tips and steps to do.
    Without having the logo in RTF if it possible to bring the logo depends on the user input (Ie Operating unit).
    Regards
    Srikkanth

  • Change the description dynamically for formula variable in Bex

    Hi Everyone ,
    I need to change the description of my formula variable that i have created in coulmns.
    My requirement is as follows:
    Depending on the date it must show for next 5 days . So i have created 5 formulas and i need to change the description dynamically.
    22 july 2013
    23 july 2013
    24 july 2013
    25 july 2013
    26 july 2013
    XXX
    XXX
    XX
    XXXX
    XXXX
    Please help me in this.
    Thanks in Advance.
    JC

    Hi,
    Please follow this doc to create text variables to display texts dynamically.
    http://scn.sap.com/docs/DOC-11187
    Regards,
    Suman

  • How to change the button dynamically?

    Hi,
        My Application is that,when i will press the button(on state-Enliglish text will come on the button,off state-Hindi Text will come on the button).
    So,my problem is that i can't write hindi text on the button,so only way is that i can port the image from the file,so how cal i do this without customizing the button.
    With Regards
    Dibya

    Broken Arrow wrote:
    Baji wrote:
    Place a boolean button in the LabVIEW front pannel and right click>>Advance>>Customize. ......
    Message Edited by Baji on 05-29-2009 04:23 PM
    The question, for whatever reason, was how to do this without customizing the button, although your solution is obviously the best way to do it, and how it is meant to be done.
    So, my question to the original poster, why can't you customize the button like Baji has suggested?
    Agreed.
    I would also encourage posting both in English and your native tongue to try and clarify the issue.
    Looking forward...
    Dynamic language changes are best handled using property nodes to change the captions and text of all FP objects. It is a lot of work to set-up the first time but once completed, maintaining the code is straight froward.
    If there are issues with just changing properties not fullfilling all reqs then a Picture Control takes care of most of the "all other cases" rather well (but is seldom trivial).
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to change the font dynamically in SAP script

    Hello,
    There are three fields for a line item to be printed in SAP form (Through Script). The font of one field has to be bigger than rest of the two.
    Can anybody tell me how to change the font of a specific field in a line of an SAP-script?
    Regards
    Kiran

    Hi,
    Its like any other character format. you can have any field with a character format.
    --Ragu

  • How to change the skin dynamically

    Hi
    I have six projects in my application.so each project has trinidad.xml file for Skin configuration. My problem is if I changed the skin at one project it should reflect in all other projects .
    When I moved from one .jxpx in a project to another one .jspx in another project within the application the skin need to be set in Trindad-config.xml file
    Can u plz post your ideas?????

    Thanks for your reply Frank,
    Actually Im following the steps you have mentioned,
    1.I used selectOneChoice in a .jspx file in the 2nd project to set the skins in the database using the managed beans
    2.In the managed bean itself I tried to set in the trindad-config.xml file by setting in the following EL #{sessionScope.skinFamily} and used to refresh the page by redirecting to that particular URL.I have given the following code used in the managed bean
    String skin;
    public void changeSkin(ValueChangeEvent valueChangeEvent) {
    this.skin = (String)valueChangeEvent.getNewValue();
    int result = 0;
    CommonAppModuleImpl appModuleImpl =
    (CommonAppModuleImpl)BackingUtils.getApplicationModuleForDataControl("CommonAppModuleDataControl");
    result = appModuleImpl.updateSkin(this.skin);
    FacesContext context = FacesContext.getCurrentInstance();
    if (result == 1) {
    ELContext elContext = context.getELContext();
    ExpressionFactory ef =
    context.getApplication().getExpressionFactory();
    ValueExpression ve =
    ef.createValueExpression(elContext, "#{sessionScope.skinFamily}",
    Object.class);
    ve.setValue(elContext, skin);
    } else {
    System.out.println("*****Skin value did not change in DB*****");
    String currentView = context.getViewRoot().getViewId();
    String actionUrl =
    context.getApplication().getViewHandler().getActionURL(context,
    currentView);
    try {
    ExternalContext eContext = context.getExternalContext();
    String resourceUrl = actionUrl;
    eContext.redirect(resourceUrl);
    } catch (IOException ioe) {
    System.err.println("Problem trying to reload the page:");
    ioe.printStackTrace();
    3.While Im moving from some1.jspx file in the 2nd project to some6.jspx file in 5th project,
    I used the following steps,
    In the beforePhase() of the some6.jspx, I called a managed bean and retrived the skin value from the database and set it in the EL but It will not reflect in the trindad-config.xml because when we hit any URL in the project then only the xml files configured.
    But while Im trying in the __onLoad()_ in the pageListener controller class_ it works.
    this works fine..
    this works fine..
    this works fine..
    But now my problem_ is In my some2.jspx file in 2nd project Im using four panelBox ,in these panel box they used to call the some4.jspx file in the 4th project as inline frame by some URL[] methods.As a beginner I dont know about that.can you please give me Idea about this method
    the follwing InlineFrame is used in the panelBox
    <af:inlineFrame id="iframe1"
    shortDesc="#{bindings.PanelTitleList.items[1].label}"
    source="#{url[bindings.PanelUrlList.items[1].label]}" //please note this source url[] method
    styleClass="Panel"
    partialTriggers="refreshLink1"/>
    can you please give me information about this url[[] method
    Thanks in Advance,
    Felix

  • How to change the content dynamically by date wise

    Hi,
    In my application, i have a survey module.
    In that i have to change the question by every week, which iam getting
    from the Database.
    Iam using java,and mysql DB, framework struts.
    How can i update the question for every week ??
    What is the procedure to attain it.
    Give me suggestions and tips to startup.
    Thanks,
    Mohan

    The cron command would do that on Linux and Solaris. On Windows, use a similar command.

  • How to change the geometry dynamicly

    Hello,
    I'm a newbie for java3d. I'm developing a degning tool with java3d, and need to change the geometry frequently therefore. However, the 3d result always shows the initial data only. Can someone gives me a hint about what's the problem, and how can I solve it?
    Thank you very much!
    xiaoni
    Following is the relative codes:
    private SimpleUniverse su;
    private BranchGroup sceneBG;
    private BoundingSphere bounds;  // for environment nodes
    public void paintComponent(Graphics g) {
            setLayout(new BorderLayout());
            GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
            Canvas3D c = new Canvas3D(config);
            add("Center", c);
            c.addKeyListener(new KeyHandler());
            su = new SimpleUniverse(c);
            createSceneGraph();
            initUserPosition();        // set user's viewpoint
            orbitControls(c);   // controls for moving the viewpoint
            su.addBranchGraph(sceneBG);
        public void createSceneGraph() {
            sceneBG = new BranchGroup();
            bounds = new BoundingSphere(new Point3d(0,0,0), BOUNDSIZE);  // for environment nodes
            lightScene();         // add the lights
            addBackground();      // add the sky
            sceneBG.addChild( new CheckerFloor(affine).getBG() );  // add the floor
            addBuilding();
        //    sceneBG.compile();   // fix the scene
       private void addBuilding(){
            BranchGroup floorBG = new BranchGroup();
            ArrayList groundArray = new ArrayList();
            int num;
            Point3f p1;
            Vertex v1;
            for (int n = 0; n < buildings.size(); n++) {
                ground = buildings.get(n).getGround();
                num = ground.getNumber();
                for (int i = 0; i < num; i++) {
                    v1 = ground.getVertex(i);
                    p1 = new Point3f(v1.x,v1.z,v1.y);
                    groundArray.add(p1);
                floorBG.addChild( new ColouredObj(groundArray, white) );
            sceneBG.addChild(floorBG);
        }note:
    1. buildings is a global variable, which stores the geometry data. When the data is changed somewhere else, the 3D result does not change therefore.
    2. ColouredObj is a class extented from Shape3D, which transfer the format from arrayList to quadArray, providing both gemetry and appearance.

    Ok, thank you for your reply.
    In fact, it doesn't change anything on my OBJ objects : they always look strange (Java interpretation of faces more than 3 points is quite strange for me)... I will try to decompose each faces of my objects into triangles, but if you know an other easier method, it would be great !
    So, I consider this topic solved, thank you for your help !!!
    Regards.

  • How to change the pattern dynamically in an Entity Level RegExp Validation?

    Hi,
    In entity attribute level, i gave a Regular Expression Validation. In validation i hardcode the pattern like [A-Z a-z]{0,25}. Is it possible to assign the Pattern of RegExpValidationBean in Entity from a property file or a EL for getting the pattern.
    Example:
    <validation:RegExpValidationBean
    Name="FirstName_Rule_0"
    ResId="SHOULD_BE_ALPHABET"
    OnAttribute="FirstName"
    Pattern="PATTERN_ALPHABET"
    Inverse="false"/>
    Can anyone help me regarding this???
    Thanks & Regards,
    Perumal S

    Hi,
    Its like any other character format. you can have any field with a character format.
    --Ragu

  • Change the agent dynamically

    Hi I am new to this Work flow and wanted to know it conceptually.
    I have a adobe form and when the submit button is pressed it should go to his approvers box. how do we do this.
    Submit button pressed ->control goes to backend class ->determine the new agent(approver ).. upto here no issues..
    how do we pass the new agent (approver ) to the workflow so that the item goes to his box..
    any help would be appreciated .. Thanks!

    Hi,
    Well, on click of Submit, trigger the workflow using the <b>SAP_WAPI_START_WORKFLOW</b> function module and use the RULES for Agent Determination to send the workitems for approvals.
    To get to know more about rules, check this link.
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/96/aef837aea75351e10000009b38f8cf/frameset.htm
    Hope this helps.
    Regards
    <i><b>Raja Sekhar</b></i>

  • Change the colour of the tile dynamically:

    Hi,
    I have 12 tiles in my application. Depending upon some condition, few tiles colour should be changed and also to the same tiles image should be added. (I'm creating tiles using Border)
    Can anybody suggest how can I achieve this?
    Thanks,
    Santosh

    Please close your previous threads before you start a new one.
    Also, you have asked this very same question before here:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/b3752b09-2ee2-46ac-a941-dc7baad78110/change-the-colour-of-the-rectangle-dynamically?forum=wpf#b3752b09-2ee2-46ac-a941-dc7baad78110.
    Please don't ask the same question twice.
    You could use DataTriggers and/or converters to change the property of some UI element based on some condition as already suggested in the previous thread.
    Of course you must post your code, or even better upload a reproducable sample of your issue to OneDrive and post the link to it here, for anyone to be able to provide a specific solution.
    But note that the forums are not for anyone else to do the entire work for you. You were given code samples of how to use data triggers and converters in the previous thread. That should certainly give you the idea.
    Please remember to close your threads by marking helpful posts as answer and please start a new thread if you have a new question.

  • How to change the text for the tabs of a tabstrip control dynamically

    Hi Guys,
        I am having two screens in a transaction.
    1. 1st screen has material number as an input and submit push button
    2. 2nd screen has two tabs in a tabstrip control.
        I want to display material description and plant number as heading for the two tabs based on the material number entered by the user in the 1st screen. Means i want to change the text dynamically. Is there any possible way? If it is there please help me. Very urgent...
    Thanks in advance
    James.

    Hi,
    If you set the "Output field" attribute for a pushbutton/tab, you can also set its text dynamically in the ABAP program. To do this, you must create a field in the ABAP program with the same name as the pushbutton/tab. You must then assign the required text to the field before the screen is displayed.
    For example define a global field in your program called MATNUM(20) and use this as the name for the material number tab on the tabstrip. Then you can assign a text MATNUM = 'Material Number' and this will appear as the tab title. Don;t forget to set the "Output field" attribute on the tab.
    Hope it helps

  • How to change the JCA JNDI dynamically using FTP Adapter

    We have 5 FTP Servers, each having a directory to poll. We have created 5 CCI instances for these FTP Adapters in the FTPAdapter deployment. We created a BPEL process and using FTP Adapter to connect to above mentioned servers.
    Question: Customer's requirement is to use a single BPEL process to poll all these FTP Servers at a specified date and time. How can we connect dynamically to each FTP server at specified time.
    (OR)
    Is there any way to change the JCAJNDI dynamically in a FTP Adapter configuration ?
    I have seen that FTP Adapter POLL doesnt take any JCA JNDI/hostname/un/pwd/date/time dynamically.
    Regards
    Pavan

    Hi Pavan,
    It's possible to change the JNDI dynamically but only when you use put operation where you can control the JNDI name at the time of invoking the FTP Adapter as described in below link.
    Dynamic JNDI in FTP Adapter | jca.jndi property not picked by Adapter
    However, can you consider using BPEL process with SyncRead (and read files through all the JNDIs in a loop) and scheduling this BPEL process to a desired frequency?
    Regards,
    Neeraj Sehgal

Maybe you are looking for

  • Shortdump in monitor after upgrade to BI 7.0

    Hi guru's, We just went through the technical upgrade to BI 7.0 . However we are still using RSA1OLD at the moment. We are having an issue with the monitor. While checking failed loads, whenever we go from the details tab to the header tab, we get a

  • W_DAY_D issue in DAC

    Hi, We are using Dac Build AN 10.1.3.4.1.20090415.0146. The start date is 01-Jan-1980 and end date 31-dec-2010. I am interested to change the end date to 31-dec-2020. For that I have created a custom container. Design -> Task -> Query on SIL_DayDimen

  • Why ExtExcape return 0 (not supported) woth adobe Acrobat 6 though return 1 with version 5?

    I posted a question earlier to ask how to remove "save pdf File as" dialog. It turned out that the ExtEscape function not working right and return 0 with adobe acrobat 6 even though the same code return 1 (success) with adobe acrobat 5. "The return v

  • Moving music to Itunes

    Good day, I just bought my first Mac! Its great! Just one little problem, I copied my music file from my PC to a thumb drive, added it to my Mac Book Pro music file and drug it to Itunes. It didn't put all my music in Itunes. I've tried to drag the m

  • Chat accounts won't connect

    Hello, I have thunderbird installed on my Mac mini, OSX 10.10.2, latest version of thunderbird, and Dell laptop, Windows 8.1, again latest thunderbird. I am able to set up my google mail account, but cannot set up google chat. Thunderbird says it can