How to override the onTouchUp in the user control which can be used to fire the event not only on this user control, but whole application

 I am a new to the C# and WPF. Right now, I want to override onTouchUp event in my user control. Then I can add user control in
the references for reuse. The problem is each time I want to test this event on the application, the event only fire at area of user control, not whole screen. Anyone has solution for this?

You cannot just add a UserControl to a window and expect its OnTouchUp method to get invoked when a TouchUp event occurs outside of the user control. That is not how routed events work.
The OnTouchUp method of the UserControl will only be invoked when a TouchUp event occurs from within the UserControl.
The event will indeed bubble up to the parent elements of the UserControl and you could for example handle the event in the parent window:
<Window x:Class="WpfApplicationSlider.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525" TouchUp="Window_TouchUp">
The OnTouchUp method of the UserControl will however never get invoked when you touch an element outside of the UserControl because an event only travels between the source element and the handler(s). This is how routed events work.
If you want a "global" TouchUp event handler you should override the OnTouchUp of the top-level
window:
public partial class MainWindow : Window
public MainWindow()
InitializeComponent();
protected override void OnTouchUp(TouchEventArgs e)
base.OnTouchUp(e);
//do your thing...
If you want to be able to reuse the functionality across all of your windows in case you have several you could for example create an abstract window class and make all your windows inherit from this one:
namespace WpfApplication1
public abstract class BaseWindow : System.Windows.Window
protected override void OnTouchUp(System.Windows.Input.TouchEventArgs e)
base.OnTouchUp(e);
//do your thing...
MainWindow:
public partial class MainWindow : BaseWindow
public MainWindow()
InitializeComponent();
<local:BaseWindow x:Class="WpfApplicationSlider.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfApplication1"
Title="MainWindow" Height="350" Width="525">
</local:BaseWindow>
Hope that helps.
Please remember to mark helpful posts as answer to close your threads and please start a new thread if you have a new question.

Similar Messages

  • The log file which can be used to track the HTML preview of HFR Reports

    Hi,
    Could you please let me know the log file which can be used to track the HTML preview of HFR Reports?
    Thanks,
    Aparna

    You could check the FinancialReporting0.log and FRLogging.log .You could refer the same in the
    " http://docs.oracle.com/cd/E17236_01/epm.1112/epm_install_troubleshooting_11121.pdf" page 47.

  • How can i use AME for the new OAF page.

    Dear all,
    I have developed a new OAF page and registered under Employee Self Service.
    How can i use AME for the approval process.
    Appreciate your ideas?
    zamora

    I will try to answer based on my experience of working with iProcurement and AME. It depends on how you want to make a call to AME , directly from OAF Page or from Workflow and your requirement. You didn't specify what you want to show the users on OAF Page and your business requirement.
    Before calling AME Engine from the OAF page or workflow, I guess you did already setup AME Transaction Type and it's Approval Groups, Conditions, Action Types and Rules. Do some testing from AME Business Analyst Test Workbench. Please note that, AME provides lot of PL/SQL API's that you have to call from your programs (java or workflow pl/sql)
    Let's look at the workflow and putting an OAF Page as notification.
    As Sameer said, you have kick-off workflow process from PR of CO and with in the workflow function, you make a call to AME Engine API's with the AME Transaction ID. This transactionId belongs to the AME Transsaction Type that you setup. Based on the rules setup, AME Engine generates list of approvers/approver and stores them AME Tables for that transactionId. Then, it sends a notification to the approver.
    In the workflow, where that notification is defined, in the message body you have to put an attribute(&XX_WF_FWK_RN) of type document/send. And this attribute will have the constant JSP:/OA_HTML/OA.jsp?OAFunc=XX_FUNC&paramId=-&DOCUMENT_ID-. This function is SSWA Jsp function that makes a web html call to your OAF Region.
    If your requirement is to just show the list of approvers on the OAF Page, you may have to call AME API diectly passing your AME TrasnactionId with other parameters. Then AME generates list of approvers and stores them in AME tables with each approver status. You can pickup those approvers using VO and show them on OAF Page.
    Hope this gives some idea.

  • How can I programmably extract the project build information set in the project build specification. So I can then use the information in an 'About' dialog.

    Extracting Project information
    How can I programmably extract the project build information set in the project build specification.
    So I can then use the information in an ‘About’ dialog.
    Dave

    In the labview\resource\appbuild folder their are some VI's that can deal with build specs! They return a variant containing the data!
    It's the reason I build a variant probe.
    Be aware that the build info is not present in th lvproj file of the built executable!
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • I have 2 questions regarding the iphone 5. 1 How do i get my yahoo mail set up. I tried the setting it up as both a yahoo mail and other mail. 2. I seem to have lost my notes on my iphone 5 but I have them on my ipad. How can I use cloud to sync my notes?

    I have 2 questions regarding the iphone 5. 1 How do i get my yahoo mail set up. I tried the setting it up as both a yahoo mail and other mail. 2. I seem to have lost my notes on my iphone 5 but I have them on my ipad. How can I use cloud to sync my notes?

    I will address your second question.
    First, make sure your iPhone and iPad have absolutely identical Apple IDs.  If they do, use that Apple ID in Settings > iCloud on your iPhone to select the "Notes" option.  Lo and behold, all your iCloud notes should appear on your iPhone.

  • I have an itunes account in Euro. I received iTunes and AppStore Gift Cards in $US. How can I use these on the same iWhatever?

    I have an itunes account in Euro. I received iTunes and AppStore Gift Cards in $US. How can I use these on the same iWhatever and keep together music/apps bought in the 2 currencies?
    Thx

    Barbara Hunt wrote:
    Would it be possible for me to download iTunes in Parallels and get the files into that and then onto my iPod?
    Yes, you can download iTunes for Windows using Parallels. If planning on making purchases here and/or authorizing already purchased tracks (from your Mac iTunes library), you are permitted to authorize five (5) computers as per iTunes Store terms of use, regardless of computing platform. No need to create a separate new iTunes Store account.
    However, judging from what you would like to do, your best bet would be to convert the WMAs to AAC/MP3 in iTunes-Windows (iTunes-Mac cannot import WMA files), and drag the files from the Parallels window to your desktop to add to the iTunes-Mac library. (as the iPod itself is currently linked to your iTunes-Mac library)
    Hope this helps,
    Steve

  • How can I retrieve my password when the retrials email was not recoverable? I also can't use or pass the othere menace of recovery? Not being able to pass or answer the security questions?

    How can I retrieve my password when the retrials email was not recoverable either? I also can't use or pass the othere means of recovery? Not being able to pass or answer the security questions?
    I created a new ID but never being able to update the iTunes that were purchased/saved using the old id?
    I can't also delete.

    Hi Kazmania89,
    Welcome to the Support Communities!
    If you require additional assistance with this, click on the link below for guidance:
    Apple ID: Contacting Apple for help with Apple ID account security
    http://support.apple.com/kb/HT5699
    Once you are able to gain access to the old Apple ID, this article may be helpful:
    Using your Apple ID for Apple services
    http://support.apple.com/kb/HT4895
    I have purchased music, apps, or books with multiple Apple IDs. How can I get all of this content onto my iOS device?

    First, you need to copy all of your purchased content so it is on the same Mac or PC with iTunes. This computer should be the one you sync your device with. For more information on how to move your content, see these articles:
    Mac:  iTunes for Mac: How to copy purchases between computers
    PC:  iTunes for Windows: How to copy purchases between computers
    Next, authorize your computer to play content with each Apple ID in iTunes. Once your computer is authorized for all your content, it can be synced to your iPhone, iPad, or iPod touch. 
    Cheers,
    - Judy

  • IPhone 5 16GB iOS8.3 i'm a new user on iPhone. My sister gave me her old iPhone that she bought in UK, she she it here in the Philippines and i'm having problems because i can't use it. i already restored it to set it up new but i couldn't still acti

    iPhone 5
    16GB
    iOS8.3
    i'm a new user on iPhone. My sister gave me her old iPhone that she bought in UK, she she it here in the Philippines and i'm having problems because i can't use it. i already restored it to set it up new but i couldn't still activate it. It says, " Your iPhone could not be activated because the activation server cannot be reached." and "The SIM card that you currently have installed in this iPhone is from a carrier that is not supported under the activation policy that is currently assigned by the activation server. This is not a hardware issue with the iPhone. Please insert another SIM card from a supported carrier or request that this iPhone be unlocked by your carrier. Please contact Apple for more information."
    what should i do for me to be able to use it?
    please help!
    Thank you very much!

    It is locked to your sisters carrier.
    She would have to ask her carrier if they unlock iPhones and if she qualifies for this service.

  • How can I use some of the image i am working on to paint with? like if I wanted to give someone an extra eye in the forehead, ow could i then paint their own i in the forehead? I know there is a paint tool for that, i just can't find it ... :/

    How can I use some of the image i am working on to paint with? like if I wanted to give someone an extra eye in the forehead, ow could i then paint their own i in the forehead? I know there is a paint tool for that, i just can't find it ... :/

    It sounds like you are talking about the cloning tool?
    Tool looks like this:
    Then when selected you can change the size of the brush and using Alt (windows) and Command (Mac) to select your region you want to copy then start to create you cloned image.
    Hope this helps?

  • I just updated my iTunes and I do not like the newer version.....can I go back to the earlier version??  This new version does not have the iTunes DJ nor does is show at the bottom as in the earlier version how many songs and the size of my library.

    I just updated my iTunes on 12-7-2012 and I do not like the newer version.....can I go back to the earlier version??  This new version does not have the iTunes DJ nor does is show at the bottom as in the earlier version how many songs and the size of my library.

    To do this in iMovie 11. use the SHARE menu. Share your project using the Share menu and choose Export Using QuickTime.
    In the Dialog box that comes up, choose Sound to AIFF, or one of the other sound options. This will create a file that you can drag into iTubes.

  • After upgrading to firefox 7, I can't use many of the features on my schools secure website. So, how do I install a previous version of firefox?

    After upgrading to firefox 8, I can't use many of the functions on my schools website like opening the textbook and sending emails. I spoke the school's tech. support & they informed me that my version of firefox was not compatible with their system. So, how do I install a previous version of firefox (firefox 6 to be exact)?

    You can download Firefox 6.0.2 for Mac OS X 10.5 from ftp://ftp.mozilla.org/pub/firefox/releases/6.0.2/
    Backup your '''Profiles''' folder before new installation.
    edit: replaced random third-party download site link.

  • I am still using my Apple G4 1.25 Ghz MDD running Leopard 10.5.8 with iTunes 10.6.3 installed. Can I use an Phone 4s with iOS 5 with this set up? I have read the iPhone iOS 5 user guide and it appears that I can but is anybody actually doing it ?

    Hello to all my readers.I am still using my Apple G4 1.25 Ghz MDD running Leopard 10.5.8 with iTunes 10.6.3 installed. Can I use an Phone 4s with iOS 5 with this set up? I have read the iPhone iOS 5 user guide and it appears that I can but is anybody actually doing it ? My current phone is a £10 Nokia and I've neither wish nor cash to spend more than a grand upgrading to an intel based machine (at the moment) ! Regards to you all.

    If you can find an iPhone running iOS5 and those are the specs for iOS5, there is no reason it should not work.
    If you want a more current version of iOS or a more current device, a Windows computer is always an option at significantly less cost. 
    Granted, there is no requirement to have a computer to use an iPhone.

  • How can I fix the Runtime Error R6034 so that I can correctly install iTunes on my PC ? I get a notice that states ' An application has made an attempt to load the C runtime library incorrectly - Please contact the application's support team for more info

    How can I fix the Runtime Error R6034 so that I can correctly install iTunes on my PC ? I get a notice that states ' An application has made an attempt to load the C runtime library incorrectly - Please contact the application's support team for more info

    Hey Debbiered1,
    Follow the steps in this link to resolve the issue:
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    When you uninstall, the items you uninstall and the order in which you do so are particularly important:
    Use the Control Panel to uninstall iTunes and related software components in the following order and then restart your computer:
    iTunes
    Apple Software Update
    Apple Mobile Device Support
    Bonjour
    Apple Application Support (iTunes 9 or later)
    Important: Uninstalling these components in a different order, or only uninstalling some of these components may have unintended affects.
    Let us know if following that article and uninstalling those components in that order helped the situation.
    Welcome to Apple Support Communities!
    Take care,
    Delgadoh

  • How to Setup Forward Error Handling in PI Scenarios. Can you help me with the same with screen shots if possible?

    Dear all
    How to Setup Forward Error Handling in PI Scenarios. Can you help me with the same with screen shots if possible?
    Thanks
    Regards
    karan

    Hello
    These are the following errors
    1. Trace level="1" type="T">no interface action for sender or receiver found</Trace>
    2. <Trace level="1" type="System_Error">Application-Error exception return from pipeline processing!
    3.
    <Trace level="1" type="T">Application Error at Receiver... => ROLLBACK WORK</Trace>  
    <Trace level="1" type="T">System Error at Receiver... => ROLLBACK WORK</Trace>  
    <Trace level="1" type="B" name="CL_XMS_MAIN-WRITE_MESSAGE_LOG_TO_PERSIST" />  
    <Trace level="1" type="System_Error">Application-Error exception return from pipeline processing!</
    Trace level="3" type="T">No persisting of message after plsrv call, because of config</Trace>Trace level="3" type="T">Error of the prevous version:</TraceTrace level="3" type="T">Error ID APPLICATION_ERROR</Trace>
    tThere are repeating errors also.
    TThanks
    Regards
    kkaran

  • How can I use Method in the bean

    Hi every one
    please I made a method in for example employees entity "EmployeesImpl"
    the name of method getmax() it return number
    how can I use it at the bean
    for eaxmple when I want to press button give me the value from this method
    sorry Iam still beginner
    thanks in advance

    Thanks sir for your response
    my version
    oracle jdeveloper reales 1 (11,1,1,4,0)
    I use business component
    I make method
    this metod wrote at enitity "EmployeesImpl"
    public Number getMax() throws JboException
    PreparedStatement stat=null;
    ResultSet rs=null;
    try {
    String sql="select max(EMPLOYEE_ID)+1 from EMPLOYEES";
    stat=getDBTransaction().createPreparedStatement(sql, 1);
    rs=stat.executeQuery();
    if (rs.next()) {
    return new Number (rs.getInt(1));
    } catch (Exception e) {
    // TODO: Add catch code
    //e.printStackTrace();
    throw new JboException("error");
    } finally {
    try {
    rs.close();
    stat.close();
    } catch (Exception e) {
    // TODO: Add catch code
    //e.printStackTrace();
    // oracle.jbo.domain.Number
    return new Number (1);
    I made a jsf page
    and I put button at the page
    I want when press the button give me message contain the number which come from previous metod
    thanks my dear

Maybe you are looking for