Why is DialogResult True when I set it to False?

I have a ChildWindow displayed. I have a Button with a Click event. The Click even sets DialogResult = False. I have a Closing event listener on the ChildWindow.
When the Closing event is entered, the sender is the ChildWindow and the Sender's DialogResult = TRUE!???
DialogResult was already False, when the Click event happened.
How the heck did it get to be TRUE?
And nothing else sets DialogResult in my code as far as I could find.

I put together a very simple MainPage:
<Grid x:Name="LayoutRoot" Background="White">
<Button Click="Button_Click">Show Child</Button>
</Grid>
and
public MainPage()
InitializeComponent();
private void Button_Click(object sender, RoutedEventArgs e)
ChildWindow1 cw = new ChildWindow1();
cw.Closed += new EventHandler(cw_Closed);
cw.Show();
void cw_Closed(object sender, EventArgs e)
ChildWindow1 cw = (ChildWindow1)sender;
if (cw.DialogResult == true )
ChildWindow1 is a regular child window
It's generated with this code:
public partial class ChildWindow1 : ChildWindow
public ChildWindow1()
InitializeComponent();
private void OKButton_Click(object sender, RoutedEventArgs e)
this.DialogResult = true;
private void CancelButton_Click(object sender, RoutedEventArgs e)
this.DialogResult = false;
I put a breakpoint in the line
if (cw.DialogResult == true )
When I click OK I get true returned.
When I click cancel I get false returned.
Hope that helps.
Recent Technet articles: Property List Editing;
Dynamic XAML

Similar Messages

  • How do you keep the colors of an image true when you set it as a background?

    I have an image with lines in it and a black blackground. When I set it as a background :
    html {
        background: url(../Images/backgroundimage.jpg);
        background-repeat:auto;
        background-position:center top;
    the black is a couple shades lighter so when I place a <div> with an <img>that is also mainly black on top of it, the top image is much darker than the background. I have no other css tags on the div other than a margin. The only difference in the images is I saved the background from photoshop and the image in the div from illustrator but I dont think that should have effected anything. Does anybody know anything about this because I am seriously stumped.
    Thanks

    We have been here before…
    Firstly, Adobe' Photoshop has the ability to save a color profile with an image. That color profile will be consistent across all versions of Adobe software. Problem is, Adobe does not make web browsers (and that is probably a good thing).
    When you save images for websites, you need to go through the proper Photoshop or Illustrator dialog. You want to Save for Web & Other Devices. Why? because the applications will take the image out of CMYK color space (if it is in that color space) and make it RGB. They will also try to translate the colors in a sensible way. When you use this dialog, you will see various options for JPG, including ICC Profile. Turning this on or off will change how the colors get mapped, and some experimentation to get best results is a good idea.
    I have it turned off, presently.
    The image will be set up for 72 dots per inch automatically, and you can, then, resize the image to optimize it for the website you are working on. If you are trying to fill a hole for an image that is 350 pixels wide by 250 tall, don't save the image as 1125 wide by 1024 high. That will take a long time to download from your server to whatever device is displaying it. Your original image will not be changed and you can navigate your path to your defined website's images folder.
    This should help you immeasurably. I should mention that If I am trying to match a background exactly, I will tend to knock out that color from the image, save the image as a .PNG file with transparency (where that particular color is) and place the image on the background in question with the background color I am trying to match on the website.
    -Mark

  • Why disable few parameters when fast_start_mttr_target set to non zero.

    When fast_start_mttr_target set to non zero value why do we need to disable log_checkpoint_interval, log_checkpoint_timeout and fast_start_io_target?

    These parameters were replaced in 9i only by the fast_start_mttr_target parameter. And the recommendation to not to use them now is because, if set , these parameters would override the FSMTT parameter and also would disable the auto-tuning of the incremental checkpointing which is there because of FSMTT.
    HTH
    Aman....

  • Why is it that when I set the preference to always show the tab bar, it refuses to stay checked after I quit Firefox and restart it?

    Using Mac OSX10.6.7 and FF 4.0.1, I'm having a problem with the preference to always show the tab bar. I want it to always show. I check this in the Preferences under the "tab" window, and everything is fine until I quit FF and when I restart FF the tab bar is gone again. I go into preferences, and that option is now unchecked. How can I fix this so that my preference is saved?

    That hasn't helped the last ten times I tried. I posted before. I deleted the preferences file, I tried changing the preferences file, I went into about:config and changed the autoHide preference there. No dice. Firefox is not saving my preference for that one thing.

  • Two WMI filters are true when one has to be false. Why?

    Here are two WMI filters and only one should be true.
    Select * from win32_PhysicalMemory where (FormFactor = 12)
    Select * from win32_PhysicalMemory where (FormFactor != 12)
    One of our Laptops (the only Asus we have) shows both of these are true.  That can not be because either FormFactor is or is not equal to 12.
    We used PowerShell and determined FormFactor is indeed 12.
    Any ideas?

    > Anybody have any ideas.  Read many site saying there is not way to
    > create a negative wmi filter that is true if the query is false.
    That's right. But you can use a trick with GPP Environment and Item
    Level Targeting:
    http://evilgpo.blogspot.de/2012/05/inverting-wmi-filters.html
    Martin
    Mal ein
    GUTES Buch über GPOs lesen?
    NO THEY ARE NOT EVIL, if you know what you are doing:
    Good or bad GPOs?
    And if IT bothers me - coke bottle design refreshment :))

  • When set dataGrid showHeader = false, dataGrid.rowCount then +1, this bug can solve?

    When I set DataGrid.showHeader=false, then
    DataGrid.rowCount+1.
    My code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical">
    <mx:Script><![CDATA[
    import mx.collections.ArrayCollection;
    [Bindable]
    private var Arc:ArrayCollection = new ArrayCollection([
    {a:1,b:12,c:13},{a:2,b:22,c:23},{a:3,b:32,c:33}]);
    [Bindable]
    private var RowCount:int = 3;
    ]]></mx:Script>
    <mx:DataGrid id="DtgShowHeader" dataProvider="{Arc}"
    rowCount="{RowCount}" horizontalGridLines="true"
    horizontalGridLineColor="black"
    showHeaders="true">
    <mx:columns>
    <mx:DataGridColumn dataField="a" headerText="a"/>
    <mx:DataGridColumn dataField="b" headerText="b"/>
    <mx:DataGridColumn dataField="c" headerText="c"/>
    </mx:columns>
    </mx:DataGrid>
    <mx:Label id="LblDtgShowHeaderRowCount"/>
    <mx:Button label="ShowHeader=True RowCount"
    click="LblDtgShowHeaderRowCount.text = 'DtgShowHeader.RowCount=' +
    DtgShowHeader.rowCount.toString();"/>
    <mx:DataGrid id="DtgHiddenHeader" dataProvider="{Arc}"
    rowCount="{RowCount}" horizontalGridLines="true"
    horizontalGridLineColor="black"
    showHeaders="false">
    <mx:columns>
    <mx:DataGridColumn dataField="a" headerText="a"/>
    <mx:DataGridColumn dataField="b" headerText="b"/>
    <mx:DataGridColumn dataField="c" headerText="c"/>
    </mx:columns>
    </mx:DataGrid>
    <mx:Label id="LblDtgHiddenHeaderRowCount"/>
    <mx:Button label="ShowHeader=False RowCount"
    click="LblDtgHiddenHeaderRowCount.text =
    'DtgHideenHeader.RowCount=' +
    DtgHiddenHeader.rowCount.toString();"/>
    </mx:Application>
    Anyone meet this problem?

    Possibly this?
    http://bugs.adobe.com/jira/browse/SDK-14463
    Peter

  • Set  the visibility false on click PopUp

    Hi,
    I want to set the visibility false of my component on the click of popup
    but the problem is when i generate the Pop Up on Page then it lost the control of all the child's on that Page and when i set the visibility false of component then it is not set
    Please guide.
    Thanks,

    You could use PopupFetchListener - to set the visibility of the button to false.
    Here, is a sample based on your use-case.
    Sample.jspx:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:panelFormLayout id="pfl1">
    <f:facet name="footer"/>
    *<af:commandButton text="CommandButton" id="cb2"*
    *binding="#{SampleBean.button}"/>*
    *<af:commandButton text="Show Popup" id="cb1" partialSubmit="true">*
    *<af:showPopupBehavior triggerType="action" popupId="p1"/>*
    *</af:commandButton>*
    </af:panelFormLayout>
    *<af:popup id="p1" popupFetchListener="#{SampleBean.popupFetchListener}"*
    *contentDelivery="lazyUncached">*
    *<af:dialog id="d2" title="Sample Dialog">*
    *<af:outputText value="Popup Contents" id="ot1"/>*
    *</af:dialog>*
    *</af:popup>*
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    *SampleBean.java:*
    import oracle.adf.view.rich.component.rich.nav.RichCommandButton;
    import oracle.adf.view.rich.context.AdfFacesContext;
    import oracle.adf.view.rich.event.PopupFetchEvent;
    public class SampleBean {
    private RichCommandButton button;
    public SampleBean() {
    public void setButton(RichCommandButton button) {
    this.button = button;
    public RichCommandButton getButton() {
    return button;
    *public void popupFetchListener(PopupFetchEvent popupFetchEvent) {*
    *this.getButton().setVisible(false);*
    *AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();*
    *adfFacesContext.addPartialTarget(this.getButton());*
    Thanks,
    Navaneeth

  • Why is it that it would take a very long time [if ever] to change or adjust the tempo of a loop in the audio track when i set it to adjust regions to locators? Until now the spinning wheel of death is still very much spinning. thanks for any help.   Is th

    Why is it that it would take a very long time [if ever] to change or adjust the tempo of a loop in the audio track when i set it to adjust regions to locators? Until now the spinning wheel of death is still very much spinning. thanks for any help.
    Is there another way to adjust tempo of loops the faster way, any other technique?

    No clue why the final processes have suddenly started to take so long. Two things I'd try: a) capture from an older tape to see if some problem with the new tape is at fault.  And b) check the health of your RAM and the hard drive.
    The red frame sounds a bit like a glitch we used to have in OnLocation (actually in its predecessor HDV Rack) which was caused by a partial GOP. But that was a product of HDV Rack recording from the live video stream. It turned out that HDV cameras intentionally interrupt the data stream for an instant upon starting to record--specifically to avoid recording a partial GOP to tape. So my gut says that the tape has partial GOPs at the points where you stopped/started recording.

  • Why when I set up my Country or Region on my iPhone 5, the default language of the phone is the country's and not the one I selected when I set up my preferred language?

    Why when I set up my Country or Region on my iPhone 5, the default language of the phone is the country's and not the one I selected when I set up my preferred language?

    Go to Settings/General/Reset and choose Reset All Content and Settings. This will erase everything on the iPhone and allow you to set it up again as new with the proper Apple ID.

  • HT2534 why they didnt ask me for a credit card when i set up my apple id

    Why they didnt ask me for a credit card.when i set up my apple id.

    I am having the same problem. I don't have a credit card and want to set up home sharing. HELP

  • Why when i set up folders for my photos do they also appear in the photo library can I only have them appear in the folders???

    Why when i set up folders for my photos do they also appear in the photo library can I only have them appear in the folders and not duplicated in the photo library???

    Not sure about the missing photos from the Photo Stream section of 'Recent', however to stop photos populating the events, turn off Automatic Import (iPhoto Preferences > Photo Stream)

  • Punch in problem-Why does cycle mode activate and snap to somewhere else when I set up a punch?

    Punch in problem-Why does cycle mode activate and snap to somewhere else when I set up a punch?

    Because whoever programmed it must be ********, I've dealt with this issue long enough.  I've sent Apple feedback on this issue long ago and nothing has been done yet.  The only work around is to try and remember that every time you double click in the punch line to hit the c button to turn it off before you start recording or you have to drag your punch line around all the time, what a pain in the ***.

  • When I set my screen saver to iLibrary it defaults to national geographic,why and how can I stop it

    when I set my screen saver to iLibrary it defaults to national geographic,why and how can I stop it

    Back up all data. Quit System Preferences if it's running.
    Triple-click anywhere in the line below on this page to select it, then copy the text to the Clipboard by pressing the key combination command-C:
    ~/Library/Preferences/ByHost
    In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar. Paste into the box that opens (command-V), then press return. A folder named "ByHost" should open. Look inside it for a file with a long name that begins "com.apple.screensaver". There may be several such files. Move them all to the Trash.
    Log out or restart the computer. Test. If the problem is resolved, empty the Trash and recreate your settings in the Screen Saver tab.

  • Why when i set my mac in sleep it starts alone and also complete stop without I do anything (Mac mini Mid 2011 - Yosemite)

    Why when i set my mac in sleep it starts alone and also complete stop without I do anything (Mac mini Mid 2011 - Yosemite)

    in response to lllaass
    here what I copied from Console:
    27/12/2014 02:29:58,457 WindowServer[185]: WSGetSurfaceInWindow : Invalid surface 1336265605 for window 268
    27/12/2014 02:30:02,516 WindowServer[185]: WSBindSurface : Invalid surface 1040636110 for window 266
    27/12/2014 02:30:17,370 com.apple.xpc.launchd[1]: assertion failed: 14B25: launchd + 160118 [55B9FF23-B298-321A-B776-CF7676586C04]: 0xe
    27/12/2014 02:30:17,371 com.apple.xpc.launchd[1]: assertion failed: 14B25: launchd + 160118 [55B9FF23-B298-321A-B776-CF7676586C04]: 0xe
    27/12/2014 02:30:18,819 Office365Service[2012]: WARNING: The Gestalt selector gestaltSystemVersion is returning 10.9.1 instead of 10.10.1. Use NSProcessInfo's operatingSystemVersion property to get correct system version number.
    Call location:
    27/12/2014 02:30:18,819 Office365Service[2012]: 0   CarbonCore                          0x901777e7 ___Gestalt_SystemVersion_block_invoke + 135
    27/12/2014 02:30:18,819 Office365Service[2012]: 1   libdispatch.dylib                   0x960dc130 _dispatch_client_callout + 50
    27/12/2014 02:30:18,819 Office365Service[2012]: 2   libdispatch.dylib                   0x960dc0b5 dispatch_once_f + 251
    27/12/2014 02:30:18,819 Office365Service[2012]: 3   libdispatch.dylib                   0x960dd0d8 dispatch_once + 31
    27/12/2014 02:30:18,819 Office365Service[2012]: 4   CarbonCore                          0x90109fb8 _Gestalt_SystemVersion + 1050
    27/12/2014 02:30:18,819 Office365Service[2012]: 5   CarbonCore                          0x90109b69 Gestalt + 150
    27/12/2014 02:30:18,819 Office365Service[2012]: 6   Office365Service                    0x000589a3 Office365Service + 358819
    27/12/2014 02:30:29,794 warmd[36]: [_bootcachectl_playlist_for_file:3197] Unable to generate playlist for file: 2 No such file or directory
    27/12/2014 02:30:29,794 warmd[36]: [_bootcachectl_playlist_for_file:3197] Unable to generate playlist for file: 2 No such file or directory
    27/12/2014 02:30:29,797 warmd[36]: [_bootcachectl_playlist_for_file:3197] Unable to generate playlist for file: 2 No such file or directory
    27/12/2014 02:30:29,797 warmd[36]: [_bootcachectl_playlist_for_file:3197] Unable to generate playlist for file: 2 No such file or directory
    27/12/2014 02:30:29,797 warmd[36]: [_bootcachectl_playlist_for_file:3197] Unable to generate playlist for file: 2 No such file or directory
    27/12/2014 02:30:29,799 warmd[36]: [_bootcachectl_playlist_for_file:3197] Unable to generate playlist for file: 2 No such file or directory
    27/12/2014 02:30:29,801 warmd[36]: [_bootcachectl_playlist_for_file:3197] Unable to generate playlist for file: 2 No such file or directory
    27/12/2014 02:30:30,870 xscertd-helper[2020]: ldap_search_ext_s returned -1 - Can't contact LDAP server when searching for bdb suffix, exiting
    27/12/2014 02:30:30,883 com.apple.xpc.launchd[1]: (com.apple.xscertadmin[2020]) Service exited with abnormal code: 1
    27/12/2014 02:30:30,928 coreaudiod[1249]: 2014-12-27 02:30:30.927642 AM [AirPlay] Power: SystemWillSleep
    27/12/2014 02:30:30,928 coreaudiod[1249]: 2014-12-27 02:30:30.927798 AM [AirPlay] BTLE client stopping to browse for AirPlay Solo Target Presence.
    27/12/2014 02:30:30,928 coreaudiod[1249]: 2014-12-27 02:30:30.928007 AM [AirPlay] BTLE discovery removing all devices
    27/12/2014 02:30:30,929 coreaudiod[1249]: 2014-12-27 02:30:30.929458 AM [AirPlay] BTLE client stopped to browse for AirPlay Solo Target Presence.
    27/12/2014 02:30:30,931 watchdogd[162]: [watchdog_daemon] @(         pm_callback) - ref=0x0 msg_type=0xe0000280 msg=0x2a0005
    27/12/2014 02:30:30,931 watchdogd[162]: [watchdog_daemon] @(    wd_daemon_thread) - events buffer: 65r1069 3634s1069
    27/12/2014 02:30:30,965 Office365Service[2012]: System shutdown notification
    27/12/2014 02:30:31,001 WindowServer[185]: device_generate_desktop_screenshot: authw 0x0(0), shield 0x7fbf43423ed0(2001)
    27/12/2014 02:30:31,044 identityservicesd[1311]: <IMMacNotificationCenterManager: 0x7ffac2c4fef0>: notification observer: com.apple.iChat   notification: __CFNotification 0x7ffac2d4efa0 {name = _NSDoNotDisturbEnabledNotification}
    27/12/2014 02:30:31,044 imagent[1305]: <IMMacNotificationCenterManager: 0x7fde8a42c1e0>: notification observer: com.apple.FaceTime   notification: __CFNotification 0x7fde8a54a860 {name = _NSDoNotDisturbEnabledNotification}
    27/12/2014 02:30:31,089 WindowServer[185]: device_generate_lock_screen_screenshot: authw 0x0(0)[inf, inf, 0, 0] shield 0x7fbf43423ed0(2001), dev [1680,1050]
    27/12/2014 02:30:31,000 kernel[0]: PM response took 168 ms (1194, UserEventAgent)
    27/12/2014 02:30:31,105 WindowServer[185]: device_generate_desktop_screenshot: authw 0x0(0), shield 0x7fbf43423ed0(2001)
    27/12/2014 02:30:31,180 apsd[59]: Peer [pid=1203] requested push wake but lacks APSPushWakeEntitlement
    27/12/2014 02:30:31,228 imagent[1305]: <IMMacNotificationCenterManager: 0x7fde8a42c1e0>:    NC Disabled: NO
    27/12/2014 02:30:31,228 identityservicesd[1311]: <IMMacNotificationCenterManager: 0x7ffac2c4fef0>:    NC Disabled: NO
    27/12/2014 02:30:31,237 imagent[1305]: <IMMacNotificationCenterManager: 0x7fde8a42c1e0>:   DND Enabled: YES
    27/12/2014 02:30:31,237 identityservicesd[1311]: <IMMacNotificationCenterManager: 0x7ffac2c4fef0>:   DND Enabled: YES
    27/12/2014 02:30:31,237 imagent[1305]: <IMMacNotificationCenterManager: 0x7fde8a42c1e0>: Updating enabled: NO   (Topics: (null))
    27/12/2014 02:30:31,237 identityservicesd[1311]: <IMMacNotificationCenterManager: 0x7ffac2c4fef0>: Updating enabled: NO   (Topics: (null))
    27/12/2014 02:30:31,237 identityservicesd[1311]: <IMMacNotificationCenterManager: 0x7ffac2e30040>: notification observer: com.apple.iChat   notification: __CFNotification 0x7ffac2c43f40 {name = _NSDoNotDisturbEnabledNotification}
    27/12/2014 02:30:31,244 identityservicesd[1311]: <IMMacNotificationCenterManager: 0x7ffac2e30040>:    NC Disabled: NO
    27/12/2014 02:30:31,249 identityservicesd[1311]: <IMMacNotificationCenterManager: 0x7ffac2e30040>:   DND Enabled: YES
    27/12/2014 02:30:31,249 identityservicesd[1311]: <IMMacNotificationCenterManager: 0x7ffac2e30040>: Updating enabled: NO   (Topics: (null))
    27/12/2014 02:30:31,000 kernel[0]: PM response took 347 ms (71, blued)
    27/12/2014 02:30:49,000 kernel[0]: PM response took 3456 ms (31, powerd)
    27/12/2014 02:30:49,000 kernel[0]: Failed to get hibernate image filename
    27/12/2014 02:30:49,000 kernel[0]: AirPort_Brcm43xx::powerChange: System Sleep
    All that is really chinese for me Do you know where i could get anything to be teached about all that
    Thanks

  • Why is it when you set a calender event in outlook 2010 (in UK) with a reminder alarm for 30mins prior) and have the iphone set to keep the appointment time relative to the local country time that you travelled to, the alarm time is still at uk time ?????

    why is it when you set a calendar event in outlook 2010 (whilst i am in UK) with a reminder alarm for 30mins prior to the appointment time) and have the iPhone set to keep the appointment time relative to the new country time that i have travelled to (this works OK), the alarm time is still relative to the UK time and not in sync with the local country time like the main appointment is.
    Does anyone know the answer please.

    This has to do with the Time Zone Support selected in your phone. If you check in Settings>Mail, Contact, Calendars, there is a setting for Time Zone Support at the bottom of the page under Calendars. If that is turned to off, the calendar should support the local time. Because time is set to Automatic (since you say the time is correct on the iPhone), it is reflecting the local time. That information comes from the carrier, not the iPhone itself. You can check, however the iPhone says that if you turn off the Time Zone support, it should reflect in the local time. Do a test, if possible,  and see if that will do what you are asking.

Maybe you are looking for

  • V.V.Urgent( IDOC to SOAP)

    Hi, I am Integrating SAP R/3  and WebBrowser using XI. In SAP R/3 I am Using IE02( Change Equipment) ,When Ever we made a change in Equipment and save it should trigger automatically and post the data. I need the Infpirmation How to Trigger Automatic

  • Using isight in windows on intel mac

    hi everybody, just wondering if i buy a macbook or macbook pro and open windows on it, can i use the isight built-in camera to video chat with someone using a pc on skype?? thanks (hope this question isn't too confusing!)

  • How do you make square brackets with the keyboard on this thing?

    Needed for Matlab!

  • Partial correct caption displaying text from Success caption

    Hi, as the title of my post suggests the Partial correct caption is displaying the text from my Success caption. To my knowledge I have correctly configured these in Quiz > Quiz Preferences > Default Labels with all fields having unique text entered

  • ICal keeps moving all my entries down

    I'm using iCal 6.0 on a MacBook Pro, OS X 10.8.5, and repeatedly running into this problem where all my entries will move down slowly, as in they all move to later and later times.  I'm not sure what and when the incremental moves take place, I've ca