Binding of WPF graphics and definition lines and plots only in the ViewModel

Hello

is it possible to bind all the Axes and all parcels in the Viewmodel?

Now I've set the Axes and the plots in Xaml, but I want to generate momentum. Is this possible via the ViewModel?

My graph now looks like this:

   
            
                

                
                
                

                    
                        
                    
                
                

                    
                        
                    

                
                

                    
                        
                    

                
                

                    
                        
                    

                
            
            
                
                    
                
                
                    
                
                
                    
                
                
                    
                

            
        

My ViewModel looks like aktually like this:

public ChartCollection[] chartCollection { get; set; }

   chartCollection = new[] {
        new ChartCollection(1000),
        new ChartCollection(1000),
          new ChartCollection(1000),
        new ChartCollection(1000),
                 new ChartCollection(1000),
        new ChartCollection(1000),
                 new ChartCollection(1000),
        new ChartCollection(1000)
    }; 

and data-insert :
  test = hw.T_a1Actual.ToString();
    chartCollection[0].Append(hw.T_a1Actual);
    chartCollection[1].Append(hw.T_a2Actual);
    chartCollection[2].Append(hw.n_a1Actual);
    chartCollection[3].Append(hw.n_a2Actual);

}));

But I want to generate all the Axes and all dynamic plots. What is the best way to do it?

I can do this via the ViewModel?

Thanks in advance

Manual

Do not forget that the plots and the scales on a graph are just components and not the user interface objects themselves.

It would be possible, with little code, take a set of models 'conspiracy' and 'axis' models and generate plots and lines of them, which could then be synchronized with a graphic. If expose you the Plot and AxisDouble components on the model, then the synchronization code would be necessary:

public static class GraphExtensions {

// Private property to hold on to synchronizer.
        private static readonly DependencyProperty PlotsSynchronizerProperty =
            DependencyProperty.RegisterAttached(
                "PlotsSynchronizer", typeof( CollectionViewSynchronizer ), typeof( GraphExtensions ) );

// Public property to declare source of Graph.Plots collection.
        public static readonly DependencyProperty PlotsSourceProperty =
            DependencyProperty.RegisterAttached(
                "PlotsSource", typeof( IEnumerable ), typeof( GraphExtensions ),
                new PropertyMetadata( OnPlotsSourceChanged ) );

public static IEnumerable GetPlotsSource( Graph g ) {
            return (IEnumerable)g.GetValue( PlotsSourceProperty );
        }

public static void SetPlotsSource( Graph g, IEnumerable value ) {
            g.SetValue( PlotsSourceProperty, value );
        }

private static void OnPlotsSourceChanged( DependencyObject d, DependencyPropertyChangedEventArgs e ) {
            var graph = (Graph)d;

// Retrieve existing synchronizer, or create a new one for the target graph.
            var synchronizer = (CollectionViewSynchronizer)graph.GetValue( PlotsSynchronizerProperty );
            if( synchronizer == null ) {
                synchronizer = new CollectionViewSynchronizer { TargetCollection = graph.Plots };
                graph.SetValue( PlotsSynchronizerProperty, synchronizer );
            }

// Synchronize graph's plots with new source.
            synchronizer.SourceCollection = CollectionViewSource.GetDefaultView( e.NewValue );
        }
    }

In XAML, you can set the property attached on the chart as:
    
: where the model exposes a collection or the observable collection of Plot objects.

A similar attached property might be set to synchronize the Axes collection on a graph with a collection of model.

Tags: NI Software

Similar Questions

  • How I dissable graphics and have only the text when you open a site?

    Y at - it an option to turn off the graphics and text only for web content?

    Hello, the next addon comes with a toggle to disable the loading of images & plugins on the Web sites: https://addons.mozilla.org/firefox/addon/quickjava/

  • my windows xp does not start and it only shows the arrow and a black screen in the Middle, what can I do to solve this problem. __

    my windows xp does not start and it only shows the arrow and a black screen in the Middle, what can I do to solve this problem.

    Try to restart your machine and pressing F8 before the spash screen Windows appears.  Choose the option "last last known good configuration".

    If this fails, you can try to repair your installation of starting for the original CD-ROM for Windows XP installation and choosing the option 'Fix' when prompted.

  • Hi all. How can I manage the preferences that LR do not take up space on my MAC hard drive and works only on the external hard drive?

    Hi all. I am new and on a free trial right now.

    How can I manage the preferences that LR do not take up space on my MAC hard drive and works only on the external hard drive?

    Monthly payment included cloud storage?

    Peut I manage backups? And how?


    -Amir

    Hi amireos,

    Yes, you can create your workflow where you can keep all your images on the external hard drive and the Lightroom catalog file as well.

    If you start with Lightroom and then use the Destination location as external hard drive when you import your image of the external source such as a camera or SD.

    If you already have your Images on the Mac HD drive, then play all your Image on the external hard drive first and then import images directly from there.

    Finally, you can change the location of the Lightroom Catalog as well.

    Default location: folder on the Mac Drive HD, there is folder called Lightroom that you can move on the external drive too (however catalog Lightroom can't memory space as its only import previews of the images is not the real image and full)

    Once you move the file catalog Lightroom external hard disk, then you need to browse the catalog file when you launch Lightroom only once.

    See thread: LR catalog moving on external hard drive

    Let us know if it helps.

    Kind regards

    ~ Mohit

  • Moving graphics and texts to separate the layers on multiple open documents

    Hello world

    My situation is as follows:

    I have several documents to make changes to, and I can't have my script to work on all open documents.

    I get an error message:

    2015-07-30_12h12_09.png

    My script works only on a single file, and then stops with this error.

    What I'm doing:


    I would spend all my texts to a certain layer, which is created by the script and move all my photos to a different layer, also created by the script. (the graphics must be only graphic, not rectangles with a fillColor, but of the rectangles with graphics inside of them.)

    I'm trying to make this happen on all open documents.

    I also want to get rid of all the other layers, except the two I've created with the script.

    Why am I doing this?

    Well, I have documents with images and texts, but also some rectangles filled with colors.

    I'm trying to get rid of these rectangles, but I have found no way to get rid of the rectangles without getting rid of the rectangles that have images inside them...

    Here's the code I'm working on:

    function moveToLayer(){    
     var myDoc = app.documents;
    
            for (var i = myDoc.length-1; i >= 0; i--) {
                
    if(!myDoc[i].layers.itemByName("pictureLayer").isValid){myDoc[i].layers.add({name:"pictureLayer" })}; 
    if(!myDoc[i].layers.itemByName("textLayer").isValid){myDoc[i].layers.add({name:"textLayer"})}; 
    
    var textLayer = myDoc[i].layers.itemByName("textLayer"); 
    textLayer.locked = false; 
    
    var pictureLayer = myDoc[i].layers.itemByName("pictureLayer"); 
    pictureLayer.locked = false; 
    
    myDoc[i].spreads.everyItem().textFrames.everyItem().locked = false; 
    myDoc[i].spreads.everyItem().textFrames.everyItem().itemLayer = textLayer; 
    
    var myPageItems = myDoc[i].pageItems;  
    
    for(var i=0; i<myPageItems.length; i++){  
        
    if(myPageItems[i].allGraphics.length==1){
        
    myPageItems[i].locked = false; 
    myPageItems[i].itemLayer = pictureLayer; 
    }
    }
    }
    }
    

    I've been everywhere in the forum to research, gather a few pieces of code, but now I'm stuck and begging for your help!

    Could someone please explain me what is happening and what is wrong, and/or could get this script to work as it should?

    Thank you all!

    Embeddd of the loop for use the same variable for the meter, i. use a different variable for integrated loop:

    for(var j=0; j
    

    and change all the i-j inside this loop.

    Peter

  • printing in black and white only on the all-in-one HP Officejet J5780

    I am trying to print page 2 of an article of web in plain black and white.  However, the upper part of the page is red on the web, the main part is black and white only.  No matter how clearly, I insist that I want simple black and white, what I get is the page, printed in red.    The printer does not do what I ask.  How can I fix this?

    Hi daniel199,

    You get the same problem when you try to print from another internet browser?

  • Hello! How can I disable only Bill emails for each Stock photo/graphic and move on to the monthly bill? Is this possible? THX.

    Everythime I upload a Photo or an Illustration Stock I received an E-Mail. Is it possible to swith to monthly delivery?

    Please come back to me

    Kind regards

    Alex

    Hi Alex,

    It's not a way to do this, but I have forwarded your request to the product team. Thanks for the suggestion.

    EBQ

  • Principle &amp; interest and interest only check the behavior of box

    Hi people,

    I have a customer who would like 2 check - boxes they say 'Principle and interest' and the other just says 'interest '.

    So, basically, you need to check one of these boxes to see the final figure of "Monthly payments" appear. See the diagrams below for a better explanation:

    Principle and interest

    principle_interest.jpg

    In this diagram, if are not ticked the boxes, no amount should appear in "monthly payment". If "Principle and interest" is checked (circled in the figure), then the figure appears - in this example, the figure is $2 040,73. (This figure is calculated in accordance with a PMT calculation script kindly provided for me in this thread: principle and interest calculation in Acrobat PDF format.)

    Interest only

    interest_only.jpg

    Similarly to the above, in this scheme, if no checkbox is enabled, no amount should appear in "monthly payment". If "interest only" is checked (circled in the diagram) then the figure appears - in this example, the figure is $1 561,59. (This figure is calculated using the following simplified field Notation: Total_Loan_2_L2 * Actual_Interest_Rate_L2 / 12)

    The two checkboxes name is 'Loan2_check' and we got the export value of 'Yes1' and the other 'YES2"so that the two can be controlled at the same time.

    If someone could kindly help solve what would be greatly appreciated

    Thank you

    Change this line:

    var rate = getField("Actual_Interest_Rate_L1").value;

    To do this:

    var rate = + this.getField ("Actual_Interest_Rate_L1") .value;

    This will force the value of the field to be converted to a number, if the field is empty, it will return zero.

  • Ringtone and gamemusic only on the blutooth/headphones-device

    Hi you all out there.

    My iPhone 5 (most recent iOS) is not connected to any external device via bluetooth, etc., no headphones plugged.

    So there is no ring tone for incoming calls (vibrant works), game-apps have no sound. Dictation voice-messages does not work, the curve which shows the recognition of the frequencies is flat. But the music from the music app is normally played on the loudspreaker!

    But when I connect it to a speaker of the blutooth with a microphone, I hear the ringtone and game-music and saving messages of speech also works via the blutooth device. The same thing when the headphones are connected.

    Mode normal iPhone always think, it is connected to another Bluetooth device or something else and it's use for some acoustic out - and input - if it is not connected.

    I rebooted several times, flightmode turned on and off, ignored or deleted all bluetooth devices, he has experienced so far (only 2), opened the only application, which allows to redirect the output to devices outside and clicked on "iPhone" or "speaker" as the device to use - nothing helped so far...

    Any other ideas?

    Thanks in advance!

    Michael

    Look at the switch at the top left of the phone. Make sure you stop sounds. If you see orange in this turnout, reverse the reverse effect.

  • Just downloaded Firefox 8 and tried "Get Add-ons" in the Add-ons Manager and they would not appear and I only see the button "load". Any help?

    Click Tools-> Add-ons, then get add-ons and they never appear

  • Qosmio G20: How to run programs and movies only on the second screen

    It is possible to select what programs are displayed on the secondary display (tv)? If so, how.

    If I have a movie on TV he also plays on his laptop computer and all. How can this be stopped IE only play on tv?

    Norskman

    Hello

    Usually, you can change the display with the function FN + F5 devices.
    Then, you can change the option for laptop / LCD, LCD, laptop computer screen / TV, TV

    If you use the software as WinDVD, so you first change the display device and then use the software.

  • Hello I have seen a few question here with my apple ID and email I am no longer using and I only remember the security answer, why did you guys all of a sudden to block my ife apple

    Dear Apple

    I face a big question here what my Apple ID ***@hotmail.com, a few days ago, you guys suddenly refuse my login and ask me to reset my password, the MAN I NICU is more than e-mail. How I'm going to reset it ok fine after seeing the mention to keep security response ok one of them are wrong! WTH my first car honda Jazz I confirms is correct, but the pets, I'm not sure! Please help me to reset for me

    It's a very bad idea to post your email/ID address and asked guests to remove it.

    This is a user to user forum: you're not talking about Apple here. Go to https://getsupport.apple.com . Click on "see all of the products and services ', then 'More', then 'Apple ID', then 'other Apple ID subjects' then 'security issues forgotten Apple ID". If you have problems with this test of this form: https://www.apple.com/emea/support/itunes/contact.html

  • Web access remote Windows 2011 essentials, EI computers available and accessible only to the administrator account. not available for computer users

    A new installation of Windows SBS 2011 Essentials. We have the following text:

    1 / web remote access is fine for the administrator account, server and work stations are available and accessible francs

    2 - However, if any user uses the web remote access, it is able to see the shared folders but no computers available.

    3. from the server, I am able to connect locally remotely and manage the client computer (local, not through the internet)

    Hello

    I suggest you send the query in the link for assistance.
    http://social.technet.Microsoft.com/forums/en/smallbusinessserver/threads

  • my profile is gone and I only have the temporary profile, how do I restore my profile

    Computer closed donw incorrectly last night.  Whan I connect not put my profile to load, it is only the profile on the computer.  start the computer with only the temporary profile.  tried restoring the system which did not fix the problem

    I have completed the following

    How to fix error "your user profile was not loaded correctly! You have visited
    logged on with a temporary profile. "in Vista & Windows 7.
    http://www.Vistax64.com/tutorials/135858-user-profile-error-logged-temporary-profile.html

    and then

    Difficulty of a corrupted user profile
    http://windowshelp.Microsoft.com/Windows/en-AU/help/769495bf-035C-4764-A538-c9b05c22001e1033.mspx

    but all my files are gone, pictures, documents, etc. Is there a way to recover them and how?

    Restore backups.  You do not compatible external backups and persistent of the files and folders that are important to you than losing them would ruin at least a few minutes of your day?

    Not to mention step 1 of the first link, you said that you have followed...

    1. back up whatever it is that you do not want to lose in the profile folder of theC:\Users\(user-name) of this user account, If the profile folder still exists, to another location, and then delete the profile(user name) folder.

    Now - if in the first step you did that C:\Users\(your old username) doesn't exist anymore - I refer back to my first statement "backup."  He had disappeared before.

    In addition - something like Recuva * could * find something--unlikely if... especially given the duration of the use of the system has obtained from erasure.

  • Windows fax and scan only saves the first page

    When I use the windows fax and scan pages to analyze. You can get an overview of all the multiple pages scanned, but what emailing or save you then cannot see the first page.

    Hello

    If you're using a scanner with a charger of documents and Windows Fax and Scan, you can scan multiple pages into a single file of scanning to the TIFF (.tif) file format. For more information, see:


    Scan a document or photo with Windows Fax and Scan
    http://Windows.Microsoft.com/en-us/Windows7/scan-a-document-or-photo-with-Windows-fax-and-scan 

    If you use Windows Fax and Scan and a flat bed scanner, you can scan multiple images to separate files probably. Not all scanners flat have this ability, so you may need to contact the manufacturer of the scanner to get a driver so that your scanner flat may offer this option.

    Reference:

    Scanning: Frequently asked questions
    http://Windows.Microsoft.com/en-us/Windows7/scanning-frequently-asked-questions 

    Kind regards
    Afzal Taher
    Microsoft technical support engineer

Maybe you are looking for

  • Satellite L - How to fix the keys?

    remember what my user name, when you read this... lol and forgive me. the cat "fell" on my laptop somehow and ripped off the SHIFT key and on my old laptop, they just jumped in his place, but for some reason any I can't sit tight plus, I have the whi

  • ReadyNAS NV + stuck 'Starting'... »

    Yesterday, my ReadyNAS itself set off the power. After a power up I see with Raidar it full file system check, but then never becomes operational. He disappears to Raidar, and LCD display just 'starting...' "I have read the manual NV + regarding goin

  • Application of PID

    Hello I am new to programming of PID and I had a stupid question. I try to order a valve so that I can control the pressure downstream of the valve. My variable entry and set point are the measure of pressure transducer. However my PID should show a

  • Activate the FsX acceleration expansion pak

    FsX activation has been without any problem, but the activation of the extension acceleration caused an error.It was: error code: 80004005-1. I got the file kb/927007 but not found an answer to activate, as telephone activation is no choice. What to

  • reading voice

    Hello I can't hear playback, w7 32 bit