Create waveform from a set of points with differtent time intervals

Hello,
I would like to create a waveform from a set of points like this
Time           Data
0                 0
0,5              1
0,6              2
1                 1
2                 0
5                 1
The problem is that the time interval between each points are not the same.
The only idea I found was to create a waveform for each doublet of points with the same rate (100ms) and than to append them together.
Does anybody have a better idea?
Regards,
Risotto.

If you use a Wave From data type, re-sampling is not required.
When using a WF datatype the chart (graph) will pick-up the X value from the t0 of the waveform.
The trick is to just build an array of the single update value and make sure the t0 value is correct.
Re-create this example
and try it for yourself.
Ben
Note: make sure the data you pass is consistant with the data already displayed. If you post a t0 value that is older than what is already displayed, the chart will clear the display and start over.
Message Edited by Ben on 09-15-2006 11:49 AM
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction
Attachments:
WF_Datatype.JPG ‏59 KB

Similar Messages

  • How to create an Area(or shape) from a set of points?

    In fact I want to accomplish a function which can fill an area of same color on an image, just like the Magic Wand tool in Photoshop.
    I have written a function to figure out the points which should be included in the Area, but I don't know how to create the Area from a set of points...:(
    I tried to create Rectengel2D from each point, the union them one by one, but it's too slow
    Anyone can help me? Thanks

    you should look att the fillPolygon api instead, it can draw more than one corner.
    I would use it in a paintComponent method and a method that creates the x and y cordinates for each corner.
    API HELP:
    http://jdrawing.sourceforge.net/doc/0.2.1/api/org/jdrawing/graphics/FillPolygon.html

  • Create an area from a set of points

    How to create an area from a set of points ? I searched everywhere but could not find a better solution for it. Let�s say that I have a matrix that contains the points for a shape. I�ll need a way to connect the points near each other continuously to form the outline for the shape.
    Thanks fro any feedback.

    ... But I'll also need a way to connect
    those points in an order so that they'll form the
    path (edge) of the shape.Do you mean the Convex Hull [1] of a set of points?
    If so, you could find it by implementing a Graham Scan [2] algorithm and then calculating the area of the polygon [3].
    [1] http://mathworld.wolfram.com/ConvexHull.html
    [2] http://en.wikipedia.org/wiki/Graham_scan
    [3] http://mathworld.wolfram.com/PolygonArea.html

  • How do I remove one failing hard drive from raid set and replace with new one

    Last Friday apparently one of my raid drives started failing.
    As I mentioned on this forum I started getting continous beeping.
    I was finally able to get the raid working at a degraded level.  I ordered a replacement hard drive which is arriving today.
    (In the meantime I made twice daily backups of my work.....)
    Below was the message I got from the browser based raid software:
    Blahblah 09    1000.2GB   RaidSet Member SamSung HD103SJ
    Blahblah 10    1000.2GB     Free                 SamSung HD103SJ
    Blahblah 11    1000.2GB   RaidSet Member SamSung HD103SJ
    Blahblah 12    1000.2GB   RaidSet Member SamSung HD103SJ
    (See this earlier thread if you wish!)
    http://forums.adobe.com/thread/727867?tstart=0
    At one point when I did the checked the browser interface I saw the message Failed and Degraded
    As I said, I was able to work over the weekend on the degraded system.
    This morning I got the beeping again and did the rescue and now I am running a "full raid" without the notice that one raid was "Free".
    In any case, the new hard drive is arriving today.
    What steps should I take to incorporate the new drive into the raid system.
    I have one OS drive
    and 4 tb raid drives.   One needs to be replaced with the new one that I am getting today.
    Thanks
    Rowby

    Harm,
    Regarding your comment:
    Re: How do I remove one failing hard drive from raid set and replace with new one
    Please tell me how to read the serial number from an individual drive rather easily, without un-installing them:
    If you select the proper drive to change out, you only need to remove one drive and look at its serial number...
    Step 1: Identify bad drive serial number using Areca's tools
    Step 2: Turn off the computer
    Step 3: Remove what you think is the bad drive based on following your numbered cable method, marked hot-swap bays, whatever
    Step 4: Verify that the serial number matches the "bad drive" serial number from step 1; if it does great, proceed; if it does not match, go back to step 3
    Step 5: Change out the CORRECT drive - that's the bottom line for this whole procedure
    Cheers,
    Jim

  • How can I set up a guest access point with a Time Capsule and an Airport Extreme? I am using a Telus router with the Time Capsule used as a wireless access point (bridge mode). I don't want the guest access point to have access to my network.

    How can I set up a guest access point with a Time Capsule and an Airport Extreme? I am using a Telus router with the Time Capsule used as a wireless access point (bridge mode). I don't want the guest access point to have access to my network.

    The Guest Network function of the Time Capsule and AirPort Extreme cannot be enabled when the device is in Bridge Mode. Unfortunately, with another router...the Telus...upstream on your network, Bridge Mode is indicated as the correct setting for all other routers on the network.
    If you can replace the Telus gateway with a simple modem (that performs no routing functions), you should be able to configure either the Time Capsule or the AirPort Extreme....whichever is connected to the modem....to provide a Guest Network.

  • API for setting Access points with PEAP programmatically

    Dear Godly developers,
    Would like to find out if there is any APIs for setting Access points with PEAP programmatically?
    Regards
    hAoZ

    Thanks for your response. We don't have the Wireless LAN Controller installed and have only configured directly through the AP's, which don't seem to have any configuration changes regarding Aironet IE's. Is there a config change that needs to be made just on the AP's? Or is the Wireless LAN Controller software necessary to make this change?
    Thanks again.

  • Can pulse measurement.vi measures 2M points with 10ns time interval?

    Hi,
    I used pulse measurement.vi to measure the pulse duration of waveforms when the waveforms exceed certain threshold level. The data file has 2 millions data points with 10ns time interval.  But I got error message saying that
    "The waveform did not cross the mid reference level enough time to perform this measurement. Check the signal length, mid reference level, and reference level unit."
    I was wondering if pulse measurement.vi is capable of handling such large file or it was due to my paramenter errors.
    Thank you for your help in advance.

    I realized that I can't really modify the percent level settings or specfication of the pulse measurement.vi. For instance, I changed the percent level setting to peak instead of the default auto select. After running the VI unsuccessfully and I reopened the pulse measurement.vi, I saw the percent level setting was set to auto select again instead of peak method. I have attached the image of the block digram and a very small part of the waveform data. I hope you can open both.
    Thank you.
    Attachments:
    pulse measurement.doc ‏45 KB
    example.txt ‏2 KB

  • How to create Analysis from two different subject areas with diff models

    Hello,
    I have problem with create analysis from two different areas with two different models (Model Star and Snowflakes) build in BI Admin tools.
    First Model A = Subject Area A have one fact tables (with measures) and three dimensions tables (Model Star)
    Second Model B = Subject Area B have one fact table (no measures) and five dimensions tables (Model Snowflakes).
    I'm looking solutions how I can give good results. In this case I can't use UNION, INTERSECT etc., because this models haven't the same number column and data type?
    whether it is possible to do in OBIEE?
    Please help me
    Kind regard
    robix

    Hi
    One thing to understand is that if your are imagining having two Subject Areas (SAs) displayed and then dragging columns from each into your Request without any preparation, then no, that can't be done. You would need to do a join in the BMM layer and expose the column from the second Subject Area in the presentation layer.
    But if you indeed interested in UNION (or intersect) queries, then do this:
    Build your first query in the first SA in the usual manner. Note the number of columns and the data types of each column.
    Now at the bottom of the Criteria workspace, there is a button called "Combine with similar request." Click it.
    Select your second SA. You will note that the outlines of the columns in your first query appear. This is to remind you that the number of columns in this second query must be the same as in the first. It also shows the data type of each column for the same reason.
    Once you select your columns and your filters, click on result. (Oh, you will also need to decide what kind of combination you want -- click on the dropdown.) The result will be a new Request that has data from both SAs in the query and combined in the manner you select (union, intersect, etc.)
    That should give you a start.
    http://obiee101.blogspot.in/2010/08/obiee-combine-with-similar-request.html -- Read this link this is good one to understand with screen shots. -- OBIEE 10g
    http://oraclebiee11g.blogspot.in/2011/01/querying-across-multiple-subject-areas.html -- OBIEE 11g
    Award Points it is useful.
    Thanks
    satya

  • Saving data with automatic time intervals

    Hi everyone
    I am a new user with LabVIEW (I just started using it 3 weeks ago) and I am having a problem with data recording and saving.
    Basically, what we want to do is to monitor data for four different variables countinuosly but saving them in automatic and specified time intervals. Specifically, we would like to save data countinuosly only for five minutes each hour. After the 5 minutes, only the saving function must be stopped for 1 hour then return to record for 5 minutes without shutting the major loop. Additionally, we would like to collect all the data in this way in one exel file per day for three weeks or more, so instead of creating a data file for each recording we would like to collect them in only one file per day.
    Finally, if its possible, we would like to extract the mean of the data for one day in a single file.  We are not interested in modifying the rate of data aquisition, we only want to focus on the saving rate. We tried many timed function (as Elapsed time, Time delay, Wait) and timed loops but it was impossible for us to syncronize different loops or to set up timing function for the saving issue without blocking the main loop work.
    Data are collected throught the "write to measurement file" function.
    any kind of help will be really appreciated!
    Here we submit our front panel and block diagram of our VI.
    Best regards
    Solved!
    Go to Solution.
    Attachments:
    Hypoxia 21-05-2014 Monitoring.vi ‏451 KB

    Use a shift register to keep track of your start time.  If the difference between the start time and the current time is less than 5 minutes, save the data.  If the time difference is an hour, save the new time as the start time.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Denormalization with overlapping time intervals

    The table keeps statuses for objects, along with times each status started and ended. Like:
    ID   From   To   Status
    ===  ====   ==   ======
    23   T1     T2    S1
    23   T3     T4    S2
    23   T5     T6    S3The statuses may start and end at arbitrary moments of time, and each object may have several statuses at the same time. So the time intervals in the above table may look like this:
    T1------------T2
        T3----------------------T4
             T5----------T6So, for example, from T! to T3 the object has only S1, while from T5 to T2 it has all 3: S1, S2, and S3.
    I need to denormalize the table and show in the same line all statuses the object is having at different time intervals, that is
    ID   From   To   Status1  Status2  Status3
    ===  ====   ==   ======   =======  =======
    23   T1     T3    S1
    23   T3     T5    S1       S2
    23   T5     T2    S1       S2       S3
    23   T2     T6    S2       S3
    23   T6     T4    S2

    SQL> with t as (select trunc(sysdate) dt from dual),
      2       t1 as (select 23 ID, dt From_dt, dt+10 To_dt, 'S1' Status from t union all
      3              select 23 ID, dt+3 From_dt, dt+18 To_dt, 'S2' Status from t union all
      4              select 23 ID, dt+7 From_dt, dt+14 To_dt, 'S3' Status from t)
      5              select * from t1
      6  /
            ID FROM_DT     TO_DT       STATUS
            23 04.08.2007  14.08.2007  S1
            23 07.08.2007  22.08.2007  S2
            23 11.08.2007  18.08.2007  S3
    SQL>
    SQL> with t as (select trunc(sysdate) dt from dual),
      2       t1 as (select 23 ID, dt From_dt, dt+10 To_dt, 'S1' Status from t union all
      3              select 23 ID, dt+3 From_dt, dt+18 To_dt, 'S2' Status from t union all
      4              select 23 ID, dt+7 From_dt, dt+14 To_dt, 'S3' Status from t),
      5       t2 as (select id,from_dt begdt from t1
      6               union all
      7              select id,to_dt from t1),
      8       t3 as  (select t2.*, lead(begdt) over(partition by id order by begdt) enddt from t2)
      9       select t3.*,
    10              (select status from t1 where t3.id=t1.id and greatest(t1.from_dt,t3.begdt)<least(t1.to_dt, t3.enddt) and t1.status='S1') Status1,
    11              (select status from t1 where t3.id=t1.id and greatest(t1.from_dt,t3.begdt)<least(t1.to_dt, t3.enddt) and t1.status='S2') Status2,
    12              (select status from t1 where t3.id=t1.id and greatest(t1.from_dt,t3.begdt)<least(t1.to_dt, t3.enddt) and t1.status='S3') Ststus3
    13               from t3
    14        where enddt is not null
    15        order by 2
    16  /
            ID BEGDT       ENDDT       STATUS1 STATUS2 STSTUS3
            23 04.08.2007  07.08.2007  S1             
            23 07.08.2007  11.08.2007  S1      S2     
            23 11.08.2007  14.08.2007  S1      S2      S3
            23 14.08.2007  18.08.2007          S2      S3
            23 18.08.2007  22.08.2007          S2     
    SQL>PS
    there's a problem in vizualization on the forum.
    all GREATEST() < LEAST()

  • Creating a waveform from a set of data points

    I have a set of Y values which are spaced 1/sampling rate apart. I am trying to build a waveform with them, but buildwaveform.vi does not seem to be working. Any suggestions? Thanks.
    Intern NSWCCD Carderock.

    Did you try the build waveform function.
    Look at annex,
    Hope it helps,
    Paulo
    Attachments:
    BuildWaveform.vi ‏27 KB

  • How do i set up a wireless access point with ny time capsule

    I am using a new Airport Extreme and want to utilize my older TC to create a wireless access point or maybe an aditional router using the same newtwork.  What are the steps to set this up?
    Thanks
    Alamo

    You will first need to perform a Factory Default Reset on the Time Capsule.
    Resetting an AirPort Base Station or Time Capsule FAQ
    Then, temporarily locate it in close proximity (same room or nearby) to the AirPort Extreme.
    Open Macintosh HD > Applications > Utilities > AirPort Utility
    Click the tab in the upper left hand corner of the AirPort Utility window that reads Other AirPort Base Stations (1), then click the Time Capsule
    AirPort Utility will take a moment or two to analyze your network, then announce that the TC will be configured to extend your wireless network.
    Enter a name for the TC (you can use the same device name that you used before if you wish) and click Next.
    AirPort Utility will take a another minute or two to configure the TC and then tell you that the setup is complete. Click Done
    At this point, power down the TC and move it to a location that is approximately half the distance from the AirPort Extreme and the area that needs more wireless coverage.....to give the TC a good strong signal to "extend"
    Power up the TC and wait for the green light and then you are all set.

  • ECC allow to create order from fully referenced Quate/Cont with Warning mes

    Hi,
    Problem- System shall allow to create as many sales order from the fully referenced quatation or contract with " WARNING MESSAGE".
    i.e Let say I have a quatation of 100 Q. in ECC.
    I want to create 15 sales order of 10 quantity each with the reference of above mentioned quatation of 100 Quantity. But the moment i reached to reference target quantity (100) is committed then system shall still allow me  to create sales order but with Warning message. Warning message could be like "Taget quantity is already committed" from the quatation #. But system should not stop me to create more sales order from that quatation of 100 quantity.
    Looking forward your valuable inputs in this context. Appreciate  your effort and time

    Hi,
    This is a standard functionality in SAP.
    Go to your Quotation to Sales order copy control IMG setting. Tx: VTAA
    There select your relevant Copy control, go in to Item Level with the relevant Item Category.
    Check whether you have maintained below settings.
    Pos./neg. quantity = +
    Update document flow = X
    Check the "Completion Rule" specified in the item Category IMG Setting as well.
    Then system will through a message, once your quotation quantity is reached.
    Best regards,
    Anupa

  • Setting Colour Point with curves CS4

    Hi, I use CS4 and I want to do some colour correction so I use the colour sampler to select areas I want to change ie Highlights to around 242 but I want to place a sample point for midtones on the RGB channels at the same time, to do this I understand if I place the cursor over a sample point and hold Ctrl + Shift then click it should set points on all channels but when I hover over the sample my colour sample point picker changes to the move tool so I assume I must have hit a button someplace but don't no where! Any help please.
    Thanks
    Russ

    I guess your working with a curves adjustment layer?
    You probably still have the color sampler tool selected.
    Either select the eyedropper tool or you can use the Auto-Select-Targeted Adjustment Tool.
    MTSTUNER

  • Create a trigger which set Image source with binding to a dependency property.

    I'm trying to create a specified button which switch images every time it pressed, without using the Click CBFunction, so I'm using toggle button and triggers (checked unchecked) and I want this button to
    supply DP of string so who ever uses is button will only have to specify the images paths and a click CBFuntion to
    perform what ever he wishes.
    I managed to create the mechanism for switching images with triggers(but the triggers image paths are hard coded and not using DP) and to enable setting a click CBFunction. When I switch the hard coded image path with a DP which return a string with
    the path the program crush, an exception is thrown.
    U.C xaml:
    <UserControl x:Class="ButtonChangeImage.UserControl1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    mc:Ignorable="d">
    <Grid>
    <ToggleButton x:Name="btnCI">
    <ToggleButton.Content >
    <Image Name="img" Source="C:\Users\AmitL\Desktop\joecocker.jpg"/>
    </ToggleButton.Content>
    <ToggleButton.Triggers>
    <EventTrigger RoutedEvent="ToggleButton.Checked">
    <EventTrigger.Actions>
    <BeginStoryboard>
    <Storyboard>
    <ObjectAnimationUsingKeyFrames Storyboard.Target="{x:Reference img}" Storyboard.TargetProperty="Source">
    <DiscreteObjectKeyFrame KeyTime="0:0:0">
    <DiscreteObjectKeyFrame.Value>
    <BitmapImage UriSource="{Binding FirstImage}"/>
    <!--<BitmapImage UriSource="C:\Users\AmitL\Desktop\james-brown-010.jpg"/>--><!--if I switch to this line it works fine!-->
    </DiscreteObjectKeyFrame.Value>
    </DiscreteObjectKeyFrame>
    </ObjectAnimationUsingKeyFrames>
    </Storyboard>
    </BeginStoryboard>
    </EventTrigger.Actions>
    </EventTrigger>
    <EventTrigger RoutedEvent="ToggleButton.Unchecked">
    <EventTrigger.Actions>
    <BeginStoryboard>
    <Storyboard>
    <ObjectAnimationUsingKeyFrames Storyboard.Target="{x:Reference img}" Storyboard.TargetProperty="Source">
    <DiscreteObjectKeyFrame KeyTime="0:0:0">
    <DiscreteObjectKeyFrame.Value>
    <BitmapImage UriSource="C:\Users\AmitL\Desktop\joecocker.jpg"/>
    </DiscreteObjectKeyFrame.Value>
    </DiscreteObjectKeyFrame>
    </ObjectAnimationUsingKeyFrames>
    </Storyboard>
    </BeginStoryboard>
    </EventTrigger.Actions>
    </EventTrigger>
    </ToggleButton.Triggers>
    </ToggleButton>
    </Grid>
    </UserControl>
    U.C cs:
    public partial class UserControl1 : UserControl
    public static readonly DependencyProperty FirstImageDP = DependencyProperty.Register("FirstImage", typeof(string), typeof(UserControl1), new PropertyMetadata(@"C:\Users\AmitL\Desktop\james-brown-010.jpg", new PropertyChangedCallback(FirstImageSource)));
    private string m_strFirstImage = string.Empty;
    private BitmapImage m_oBMImage = null;
    private static void FirstImageSource(DependencyObject obj, DependencyPropertyChangedEventArgs args)
    UserControl1 l_UCBtnSwitchImage = (UserControl1)obj;
    l_UCBtnSwitchImage.m_strFirstImage = (string)args.NewValue;
    l_UCBtnSwitchImage.m_oBMImage = new BitmapImage(new Uri(l_UCBtnSwitchImage.m_strFirstImage, UriKind.Absolute));
    public string FirstImage
    get
    string l_strTemp = (string)GetValue(FirstImageDP);
    return l_strTemp;
    set
    SetValue(FirstImageDP, value);
    public event RoutedEventHandler Click
    add { btnCI.Click += value; }
    remove { btnCI.Click -= value; }
    public UserControl1()
    InitializeComponent();
    window xaml:
    <Window x:Class="ButtonChangeImage.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:m="clr-namespace:ButtonChangeImage"
    Title="MainWindow" Height="350" Width="525">
    <Grid>
    <m:UserControl1 Click="ToggleButton_Checked" FirstImage="C:\Users\AmitL\Desktop\james-brown-010.jpg"></m:UserControl1>
    </Grid>
    </Window>
    The exception:
    A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll
    Additional information: 'Provide value on 'System.Windows.StaticResourceExtension' threw an exception.' Line number '20' and line position '46'.
    I would love to know why when I switch the hard coded value with DP it suddenly throw exception, how to fix it or if there is other way to achieve U.C with those demands.
    Thanks.

    Hey Magnus,
    Unfortunately I get the same result, the button is switching between the (Joe Cocker) image to blue button(normal pressed button look) how come the
    (Joe Cocker) image return I didn't set a trigger for unchecked so what make it change the content
    or the image source back to that image?
    And I can't debug (by the way what's happening there how come it doesn't stop in all those code lines?).
    I didn't make any changes here is all the code:
    U.C cs:
    namespace ButtonChangeImage
    public class ImageConverter : IValueConverter
    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    string s = value as string;
    var source = new System.Windows.Media.Imaging.BitmapImage();
    source.BeginInit();
    source.UriSource = new Uri(s, UriKind.RelativeOrAbsolute);
    source.EndInit();
    return source;
    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    throw new NotImplementedException();
    public partial class UserControl1 : UserControl
    public static readonly DependencyProperty FirstImageDP = DependencyProperty.Register("FirstImage", typeof(string), typeof(UserControl1), new PropertyMetadata(@"C:\Users\AmitL\Desktop\james-brown-010.jpg", new PropertyChangedCallback(FirstImageSource)));
    private string m_strFirstImage = string.Empty;
    private BitmapImage m_oBMImage = null;
    private static void FirstImageSource(DependencyObject obj, DependencyPropertyChangedEventArgs args)
    UserControl1 l_UCBtnSwitchImage = (UserControl1)obj;
    l_UCBtnSwitchImage.m_strFirstImage = (string)args.NewValue;
    l_UCBtnSwitchImage.m_oBMImage = new BitmapImage(new Uri(l_UCBtnSwitchImage.m_strFirstImage, UriKind.Absolute));
    public string FirstImage
    get
    string l_strTemp = (string)GetValue(FirstImageDP);
    return l_strTemp;
    set
    SetValue(FirstImageDP, value);
    public event RoutedEventHandler Click
    add { btnCI.Click += value; }
    remove { btnCI.Click -= value; }
    public UserControl1()
    InitializeComponent();
    U.C xaml:
    <UserControl x:Class="ButtonChangeImage.UserControl1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    mc:Ignorable="d">
    <Grid>
    <ToggleButton x:Name="btnCI" xmlns:local="clr-namespace:ButtonChangeImage">
    <ToggleButton.Resources>
    <local:ImageConverter x:Key="conv" />
    </ToggleButton.Resources>
    <ToggleButton.Style>
    <Style TargetType="ToggleButton">
    <Setter Property="Content">
    <Setter.Value>
    <Image Name="img" Source="C:\Users\AmitL\Desktop\joecocker.jpg"/>
    </Setter.Value>
    </Setter>
    <Style.Triggers>
    <Trigger Property="IsChecked" Value="True">
    <Setter Property="Content">
    <Setter.Value>
    <Image Source="{Binding Path=FirstImage, Converter={StaticResource conv}}"/>
    </Setter.Value>
    </Setter>
    </Trigger>
    </Style.Triggers>
    </Style>
    </ToggleButton.Style>
    </ToggleButton>
    </Grid>
    </UserControl>
    Main Window cs:
    namespace ButtonChangeImage
    public partial class MainWindow : Window
    public MainWindow()
    InitializeComponent();
    private void ToggleButton_Checked(object sender, RoutedEventArgs e)
    MessageBox.Show("f");
    Main Window xaml:
    <Window x:Class="ButtonChangeImage.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:m="clr-namespace:ButtonChangeImage"
    Title="MainWindow" Height="350" Width="525">
    <Grid>
    <m:UserControl1 Click="ToggleButton_Checked" FirstImage="C:\Users\AmitL\Desktop\james-brown-010.jpg"></m:UserControl1>
    </Grid>
    </Window>
    Thanks,
    Amit.

Maybe you are looking for