Creating controls and data triggers statically

Hi,
I have two questions wrt WPF:
1. I've set of controls like below:
 <Grid >
                                <Border x:Name="DrawerOneBorder"  Height="212" Width="227" Margin="1" BorderThickness="1"
                              BorderBrush="{StaticResource TileBorderBrush}" >
                                    <TextBlock Style="{StaticResource TileTitleTextStyle}">Drawer1</TextBlock>
                                </Border>
                                <Image x:Name="DrawerOneImage"  Height="50" Width="50" HorizontalAlignment="Center" VerticalAlignment="Center"
                        Source="..\Status\CheckMark.png" >
                                </Image>
                                    <TextBlock x:Name="DrawerOneWarningText" Text="Drawer is open" HorizontalAlignment="Left" VerticalAlignment="Bottom"
Margin="15" FontSize="16" ></TextBlock>
                                    <TextBlock x:Name="DrawerOneErrorText" Text="Error" HorizontalAlignment="Left" VerticalAlignment="Bottom"
Margin="15" FontSize="16" ></TextBlock>
                                </Grid>
The same set of controls I need to create multiple times. Is there a way where I can create a template kind and use it wherever required? (I should be able to change/give some information like text for each of the controls)
2. I've following code for data triggers:
<DataTrigger Binding="{Binding Path=ModuleDetails.Drawers[0].DrawerStatus }" Value="Ok">                                        
                                        <Setter TargetName="DrawerOneBorder" Property="Background" Value="#BDC2FF"/>
                                        <Setter TargetName="DrawerOneImage" Property="Visibility" Value="Visible"/>
                                        <Setter TargetName="DrawerOneWarningText" Property="Visibility" Value="Hidden"/>
                                        <Setter TargetName="DrawerOneErrorText" Property="Visibility" Value="Hidden"/>
                                    </DataTrigger>
Here, only drawer index changes and rest remains same. Is it possible to give common things in static resource and specific thing in each place?
Kindly waiting for your response.
Thanks,
Santosh

Please only ask ONE question per thread.
>>Is there a way where I can create a template kind and use it wherever required?
You can define an element as a resource at any level (application, window, user control etc.) and then reference it using a ContentControl like this:
<Window.Resources>
<SolidColorBrush x:Key="TileBorderBrush">Green</SolidColorBrush>
<Border x:Key="DrawerOneBorder" x:Shared="false" Height="212" Width="227" Margin="1" BorderThickness="1"
BorderBrush="{StaticResource TileBorderBrush}" >
<TextBlock>Drawer1</TextBlock>
</Border>
</Window.Resources>
<ContentControl Content="{StaticResource DrawerOneBorder}"/>
<ContentControl Content="{StaticResource DrawerOneBorder}"/>
<ContentControl Content="{StaticResource DrawerOneBorder}"/>
Remember to set the x:Shared attribute of the resource to false for a new instance of it to get created for each request to it. Note that you cannot modify any properties of the resource directly in XAML this way though.
If you require to be able to this you should use style resources:
<Window.Resources>
<SolidColorBrush x:Key="TileBorderBrush">Green</SolidColorBrush>
<Style TargetType="Border" x:Key="DrawerOneBorder">
<Setter Property="Height" Value="212"/>
<Setter Property="Width" Value="227"/>
<!-- rest of the properties... -->
</Style>
</Window.Resources>
<!-- override Height of style -->
<Border Style="{StaticResource DrawerOneBorder}" Height="400">
<TextBlock Style="{StaticResource SomeTextBlockStyle}">....</TextBlock>
</Border>
<Border Style="{StaticResource DrawerOneBorder}" />
>>Is it possible to give common things in static resource and specific thing in each place?
I am afraid I don't know if I understand this question but you cannot define the setters in one place and then somehow "import" these setters into the DataTrigger. This is not possible. But please start a new thread if you have a
new question.
Please also remember to mark helpful posts as answer to close your threads.

Similar Messages

  • Tutorials for MVC, Data Controls, and Data Bindings

    I am looking for some good tutorials on:
    Model View Controller concept
    Creating Data Controls from Java Beans
    Creating and Using Data Bindings
    We are using JDeveloper, but do not want to use ADF as we want more control than ADF offers.
    Thanx
    Pam

    Just curious, what control do you need that ADF doesn't offer you?
    If you use ADF, you don't have to use it for every page. You can bind some components on your page using adf directly to your adf data controls, and you can bind other components to your backing beans, and have full control. No reason to throw out adf if there are just a few cases where you need more control.
    Btw, do you have a link to a page describing these non adf data controls and data bindings?

  • Can I download the instrument Control and Data Aquisition Device Driver CD for 7.1?

    Greetings,
    Can I download the instrument Control and Data Aquisition Device Driver CD for 7.1?
    I'm trying to find out if I can download
    the instrument Control and Data Aquisition Device Driver CD for 7.1. Instead of downloading all the upgrades?
    Is there a link to the image file for this CD?
    TIA

    Sam,
    Unfortunately, the Device Driver CD is not available for download. However, your Technical Sales Representative should be able to send it to you (Contact Information).
    Spencer S.

  • WLC 7.4.100.0 Mobility group control and data path down

    Hi All,
    Today i am facing issue with mobility group. i checked and found  control and data path is down on foreign controller.I am able to ping anchor controller. Required ports are open on firewall but mping and eping fails. Any idea whats wrong. On Anchor controller, i have 7 foreign controller configured and among these 3 are working fine. Having problem with 4 foreign controller. Previously all are working fine and there is no changes made on network or firewall.            

    Post output of "show mobility summary" of your Anchor WLC & a non-working WLC. Also "show sysinfo" of those two controllers.
    Regards
    Rasika

  • How to get the name of a duplicated control or created control and add a callback to it

    Hi All,
    Depending on how many input points I need, I am duplicating a numeric or string input with the DuplicateCtrl function. My question is, how do I get the name and id of the control that was just created, and how can i assign a callback to it? Alternately, would it be better to create a fresh ctrl instead of duplicating?
    Thanks in advance!
    Solved!
    Go to Solution.

    Hi TurboMetrologist,
    why are you trying to get the control constant name? Keep in mind that you cannot use that name to address the control; control names are actually simply macros in the include file associated to the UIR, that is, the compiler preprocesses the code and wherever it finds PANEL_CONTROL names substitutes the corresponding numeric value as parameters to the functions (and consequently 'control' parameter is an int and not a char*)
    That is why NewCtrl () or DuplicateCtrl () functions return a control ID: it is the handle to the new object, our only way to manipulate it. You will need to store this handle into a non-volatile memory so that you can access it durng program life.
    Additionally, there are other ways to assign some particular meaning to a control than swiching on the control constant name. You could for example use the callbackData parameter to differentiate between different copies of a control.
    Let me explain with an example. You told that you need several inputs (dynamically created as you don't know in advance how many of them to use); a clean solution could be to:
    Design a master copy of one control in the UIR editor, where it is easy to customize it; assign also a callback function, if it has to be common to all copies of the control
    Programmatically assign a callbackData value to that control, e.g. SetCtrlAttribute (..., ..., ATTR_CALLBACK_DATA, (void *)1);
    Duplicate the control and then assign a different callbackData
    for (i = 2; i < 5; i++) {
       handle = DuplicateCtrl (...);
       SetCtrlAttribute (..., handle, ATTR_CALLBACK_DATA, (void *)i);
    By operating this way, every time the control callback is fired by any control it will receive the assigned callbackData, and you will be able to differentiate your code by a simple switch:
    switch ((int)callbackData) {
       case 1:    // The master control
          break;
       case 2:    // The first duplicated control
          break;
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Stepper Motor with Linear Stage (Position Control and Data Acquisition)

    Hey All,
    So.. I've attached a stepper motor to a linear stage and so far it's working pretty well.  Using a stepper motor driver from Pololu, I've simplified the control of the motor by just using output pulses from the counter output of a PXI-6143.  I've tested the motor using the Pulse Train examples in LabVIEW and all is working well.  
    My goal now is to allow the user to collect data from a pressure sensor, attached to the linear stage, every X number of steps.  From what I can tell so far, and please correct me if I'm wrong, the motor step movement is synchronised with the pulse train input.  That is to say, if I give the motor a 200 step pulse train, the pulse train ouput is completed at the exact time the motor has moved 200 steps.  From this, I've created a VI that moves the motor X steps, aquires the data point, and then repeats this process for the required amount of data points.  The problem with this is that the motor movement is not continuous; it stops for a split second to take the data point.
    How can I have labview ouput a pulse train of say 1000 steps and record a data point every 50 steps?
    Two ideas that came to mind were:
    1. Use the counter input port on the card to count the pulses being sent to the motor.  
    2. Use an encoder connected to the motor shaft.
    I wanted to stay away from theses ideas though since they require resources from the DAQ card.  
    Thanks,
    Ryan

    Hi Ryan,
    Just to cover all the bases, what version of LabVIEW are you using and can you attach your VI? Initially your ideas sound like they should work, do you expect to be nearly maxing out the DAQ?
    Thank you,
    Deborah Y.
    LabVIEW Real-Time Product Marketing Manager
    Certified LabVIEW Architect
    National Instruments

  • Grid Control and Data Guard Setup

    Hi,
    I have 4 PCs on which I wish to test the following:
    1. OEM Grid Control 10.2 - Console + Service + Agent
    2. Data Guard feature with Broker
    3. Standby Setup for a Primary Database.
    I will create the Primary DB on one Linux PC.
    Standby DB using Grid Control & DataGuard on second Linux PC.
    The Third PC is also Linux but the fourth PC is Windows XP.
    Please guide me in understanding the following:
    1. On which PCs should I install OEM Grid Control 10.2 - Console + Service + Agent?
    2. On which PC should I setup DB Broker?
    Please assume that I will use Oracle 10.2 Softwares and Linux x86 version.
    Regards

    well why don't you go ahead and test?!
    Test and see whether you want to put oms, console all one machine, or whether you want to separate out the componests (you'll need an agent on each box regardless). I have no idea what the specs of your machines are, so why don't read the documentation on Grid and dataguard, see what the recommended settings are and then plan what you want to do.
    Bazza

  • Labview remote control and data transcation

    Hi,
    We have a complicated timing control system written in labview
    6.1 running on our lab PC-1.  Since it is not easy to upgrade to a most
    recent version and limited PCI-slots, and we need to add a few device
    control programs (written in C++ or updated labview), we are thinking of
    an ultimate control system with two PCs and let the old timing program
    be a "slave" of "master" computer PC-2.  OS for both PCs are windows XP.
    The communication between the two PCs are
    fairly straight forward: suppose on PC-1, the program breaks into two
    parts: part A and part B. PC-2 sends selection messages to PC-1 to
    determine which part needs to be running during a particular shot. It is
    true that to our best interest we might need  PC-2 to send data to
    PC-1, in case for a particular run we have to change some data values of
    timing program. 
    The problem might appears to be a piece
    of cake to you experts. It is worth mentioning that on PC-1, any
    changes made to the timing program is nontrivial due to its structual
    complexity. The program is DAQ based (finite) pattern generation (using a
    lot of PCI 6534/PCI 6713/counters, external clocking). 
    The
    reqiurement for speed is not high. PC-2 can in general wait for 1
    second before PC-1 receives a message and start to output.   On the
    other hand, the smaller the delay, the better. 
    We have
    considered a few communication options like TCP/IP, RS232 ports, etc. 
    But before we start implementing the changes, we would really appreciate
    your suggestions/comments! 
    Thanks very much in advance
    for your time! 
    Kunyan

    Kunyan,
    there are really several different ways to solve this. The major question is: Is this a handshake protocol or simple "notifications"?
    If it's simple notifications, things are getting quite easy.
    You can use TCP/UDP/DataSocket/STM if there is a network connection between both PCs. Otherwise, RS232 might be a good idea as well for sure.... but i suggest a network technology in order to reduce delays.
    STM is a protocol built up on TCP and even if you do not use it (it is not available for LV 6.1!), it might get you some ideas about defining a custom protocol.
    hope this helps,
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • SSIS Control and Data Flow Items not available in Customize Toolbox

    I cannot add additional Data Flow and Control Flow items to the SSIS Toolbox. I am using SQL Server 2014 and VS 2013 (BIDS). The standard SSIS items appear - but they are all of them. How do I add the additional ones that are not loaded by default. I didn't
    have this issue with SQL Server 2012.
    Thank you,
    Johhn
    John

    John, which ones you do not see? AFAIK nothing has changed regarding how the items get added to SSIS toolbox in SSDT or VS 2013 with SSDT installed (no BIDS in SSIS 2012 and up).
    Arthur My Blog

  • App for creating complex and data-enclosed forms

    Hello guys,
    This may be a wrong place to ask this but hey i don't know where to go, so here goes:
    I'm looking for an app (OSX) with which i can create quite complex forms, and with that i mean the following example:
    Like in Acrobat Reader Pro you can create forms, you can leave some text that is considered basic text and non-changeable and some fields in which users can fill up their own data. Better yet i'm looking to allow the user to only fill in the particular fields with only a few options.
    For example: Let's say i want to create a mailing form in which the 'TO' field can only be filled up by a pop-up of selectable choices. I've seen this in some PDFs but i'm not sure Acrobat can do that. A friend of mine recommended SQL but that's a pain to install in OSX. So back to the example, when the user selects the TO field to fill up the destination of the letter, i would like to allow him to only fill up let's say one of 10 destinations (with complete address). So the 10 options pop-up in a menu from the field and he selects the destination and then the app does the rest by filling the street name, number etc...
    How can i do that? In what program?
    Thank you!
    Andrei Dica from Bucharest Romania (pround Apple user )

    Ok here is what i want to do:
    I want to simplify and optimize the work in my office. Most of the times we have to create reports or letters which share a common body text. That body text should remain unchanged but there are fields that i want to create to allow all the employees to fill up them depending on their needs. BUT not just fill up by typing because that would be the same as if it would have opened the document (.doc or .pages) delete and type what they want.
    I want to create fields but with options poping out of them when the user clicks on it. For example: let's say an employee wants to do a report about a company, and he already has the data in other documents about the company name, identification codes, address etc...Usually you work with multiple opened documents and copy/paste the required contents from one document to another. But i figured there has to be an easier way if a system can be implemented when the user can work on directly made templates for each task and type only the fields that need to be changed. I vision the process as a user completes some fields in a browser. When you type in the address bar of your browser "you" it automatically pops out a list of possible sites from which i can mention youtube.com and others. Now i understand that there has to be created a database first so that my employees and colleagues can fill 'from' but i'm willing to do that if on the long term it speeds up the work flow.
    Another example is body text that need to be changed only by two values (words) much like numeric values 1 and 0. For example yes or no. Click on the field, pops up yes or no option. Click on the desired option and you're done. Print it, email it and job well done.
    Is this a bit more clear about what i'm trying to achieve?

  • RTSI motion control and data acquistion

    The code attached is part of an example that uses every falling edge of an encoder pulse via a 7334 motion controller card to clock data on a PCI6023E card. (Position-based DAQ)
    Is there a way using this code (or otherwise) so that I could use this signal or some other signal to only TRIGGER the daq on the 6023E? (I want time-based daq)
    Thanks for your time and patience
    Chris
    Attachments:
    example.vi ‏99 KB

    You can definitely use a pulse to trigger an analog acquisition on the 6023E device. I would suggest to look at a LabVIEW shipping example that illustrates how to integrate a digital start trigger for analog aquisition.
    The 'Acquire N Scans Digital Trig VI' would be a great place to start. You will just need to add a control/constant to the analog chan & level input of the AI Start VI and enter "RTSI0" into the string of that cluster input. This will set the 6023E to trigger off of RTSI0. So, instead of using the RTSI line in your program for the analog scan clock, you will use the RTSI line as a digital start trigger.
    I hope this helps.
    Regards,
    Todd D.
    NI Applications Engineer

  • Remote control and data logging

    Hello,
    Somebody can help me?
    Measuring computer measures data from data acquisition card continuously. Measured data are saved to .txt file and moreover they are transmitting to Data server over Ethernet. Remote computers should be able to access to this server (Duplex) data though LAN during measurement.
    for details see attached file
    Attachments:
    description1.doc ‏36 KB

    Stefo wrote:
    Don't understand me wrong please! I don't looking for already developed software. I need some footing for beginning. I’m thinking that I find it in manual just now. Again But what I'm looking is maybe some advice, or simple example. I want to improve my self, no take already developed solution.
    best regards,
    I didn't want to cause offence to you
    Maybe it's just me, but what you asking for in this post is something that I would not do for free unless I was being paid as a consultant. You already have the simple outline of what is required. 
    This is an engineering project. The solution it isn't something that you can find in a manual. If only things were that simple.

  • Recover control and data file

    hello
    i have an oracle database 10GR2 EE on windows server 2003 sp2
    the database is in archive log mode
    today i lost all control files+ the system datafile
    i have a cold backup + a script to recreate the controlfiles
    i restored the system datafile from cold backup
    but when i run the script to recreate the controlfiles i got this error:
    ERROR at line 1:
    ORA-01503: CREATE CONTROLFILE failed
    ORA-01189: file is from a different RESETLOGS than previous files
    any help is appreciated
    thanks

    Hi,
    Please refer to Metalink Note:121801.1, there is an step by step resolution.
    Regards,
    Adrian

  • Basic wireless mobility domains (Control and Data Path Down)

    I am unable to get my 4402 and 2504 to pair in mobility, I made short video to explain my issues.
    Any help is greatly appreciated, also do not worry there is no propritary information in this video, I am working on a lab that does not mirror any production networks.
    http://www.youtube.com/watch?v=7nVG1h12Y34

    4402 Mobility IP = 10.60.1.9
    2504 Mobility IP = 10.40.1.4
    From the 4402 I get this output:
    (Cisco Controller) >mping 10.40.1.4
    Send count=3, Receive count=0 from 10.40.1.4
    (Cisco Controller) >eping 10.40.1.4
    Send count=3, Receive count=0 from 10.40.1.4
    (Cisco Controller) >ping 10.40.1.4
    Send count=3, Receive count=3 from 10.40.1.4
    From the 2504 I get this output:
    (Cisco Controller) >mping 10.60.1.9
    Verify IP address belongs to a mobility peer
    (Cisco Controller) >eping 10.60.1.9
    Verify IP address belongs to a mobility peer
    (Cisco Controller) >ping 10.60.1.9
    Send count=3, Receive count=3 from 10.60.1.9

  • Best way to control and read data from multiple instruments?

    Hello,
    I'm building an application to test power supplies involving multiple pieces of equipment over a couple of different comm busses. The application will also send control instructions to some of the instruments, and read data from some of the instruments. The reading and control profiles will not run on the same schedule (variable length control steps, configurable read interval).
    I was thinking of using a queued statemachine (producer/consumer) for the control profile and another to read the data, but I got concerned that there would be collisions between sending control commands and read commands to the same machine. Is there a suggested design pattern for implementing something like this?
    Timing of the commands isn't critical down to the milisecond, but I need to collect reasonably accurate timestamps when the data is read. The same is true for the control commands.
    Here are the instruments I'm going to use, if the are control, read, or both, and the communication method
    Instrument Funtions Comm Method
    Power Supply Read data Communicates to PMBus Adapter
    PMBus to USB Adapter Read data USB (Non-Visa)
    Switch control relays USB (VISA)
    Power Dist. Unit read data/control outlets SNMP (Ethernet)
    Electronic Load read data/control load GPIB (VISA)
    Thermal Chamber read data/control temp Ethernet (VISA)
    Thanks,
    Simon

    Hello, there is a template in LV called "Continuous measurement and Logging".
    It can give you some idea how to properly decouple the "GUI Event handler" top loop (where your Event structure is) from the DAQ and other loops.
    You do not need to totally replicate the above example, but you can find there nice tricks which can help you at certain points.
    The second loop from the top is the "UI message loop". It handles the commands coming from the top loop, and regarding to the local state machine and other possible conditions and states, it can command the other loops below.
    During normal run, the different instrument loops just do the data reading, but if you send a control command from the top loop to a certain instrument loop (use a separate Queue for every instrument loops), that loop will Dequeue the control command, execute it, and goes back to data reading mode (in data reading mode the loop Dequeu itself with a "data read" command automatically). In this way the control and data read modes happen in serial not in parallel which you want to avoid (but I think some instrument drivers can even handle parallel access, it will not happen in really parallel...).
    In every instrument loop when you read a value, attach a TimeStamp to it, and send this timestamp/value couple to the DataLogging loop via a Queue. You can use a cluster including 3 items: Source(instrument)/timestamp/value. All the instrument loops can use the same "Data logging" Queue. In the Datalogging while loop, after Dequeue-ing, you can Unbundle the cluster and save the timestamp and data-value into the required channel (different channel for every instrument) of a TDMS file.
    (Important: NEVER use 2 Event structures in the same top level "main" VI!)

Maybe you are looking for