I need to use a DialogBox called by a UserControl. Is it any possibility to call a DialogBox and return the result to the UserControl?  private void Button_Click_1(object sender, RoutedEventArgs e) {             bool? result;              Dialog1 dlg = new Dialog1();             dlg.Owner = this;             dlg.ShowDialog();             //dlg.Show();              result = dlg.DialogResult; }   Supose that this button click event is inside a wpf UserControl. In this case I can't use "dlg.Owner = this;" to return the result to the caller.
I have a user control that I load into a MainWindow at runtime. I cannot get a handle on the containing window from the UserControl.   I have tried this.Parent, but it's always null. Does anyone know how to get a handle to the containing window from a user control in WPF?  Here is how the control is loaded:  private void XMLLogViewer_MenuItem_Click(object sender, RoutedEventArgs e) {     MenuItem application = sender as MenuItem;     string parameter = application.CommandParameter as string;     string controlName = parameter;     if (uxPanel.Children.Count == 0)     {         System.Runtime.Remoting.ObjectHandle instance = Activator.CreateInstance(Assembly.GetExecutingAssembly().FullName, controlName);         UserControl control = instance.Unwrap() as UserControl;         this.LoadControl(control);     } }  private void LoadControl(UserControl control) {     if (uxPanel.Children.Count &gt; 0)     {         foreach (UIElement ctrl in uxPanel.Children)         {             if (ctrl.GetType() != control.GetType())             {                 this.SetControl(control);             }         }     }     else     {         this.SetControl(control);     } }  private void SetControl(UserControl control) {     control.Width = uxPanel.Width;     control.Height = uxPanel.Height;     uxPanel.Children.Add(control); }
I have learned about the correspondence of radians and degrees so 360° degrees equals $2\pi$ radians. Now we mostly use radians (integrals and so on)  My question: Is it just mathematical convention that radians are much more used in higher maths than degrees or do radians have some intrinsic advantage over degrees?  For me personally it doesn't matter if I write $\cos(360°)$ or $\cos(2\pi)$. Both equals 1, so why bother with two conventions? Proving that $\sum\limits_{k=0}^{n} {{m+k} \choose{m}} = { m+n+1 \choose m+1 }$ I have to prove that:     $$\sum_{k=0}^{n} {{m+k} \choose{m}} = { m+n+1 \choose m+1 }$$   I tried to open up the right side with Pascal's definition that: $$ { n \choose k} = {n-1 \choose {k}} + {n-1 \choose {k-1}}$$  Here is what I came up with, and I am sure it is wrong because it does not equal the left side:  $$ {m+n+1 \choose m+1} = {m+n \choose m+1} + {m+n \choose m} = ... ={m+n \choose m+1} + {m+n-1 \choose m} + {m+n-2 \choose m-1} + ... + {m \choose m+1} = \sum_{k=0}^{n} {m+k \choose m+k-n+1 }  $$  Which, again, probably is wrong because it is not equal $\sum_{k=0}^{n} { m+k \choose m}$. Any help is appreciated we are currently experiencing some issues with the ambiguity feature of apa for biblatex/biber (we use biber) in TexLive 2012.  What would be correct with the ambiguity feature:  Doe J., Peters M., Kramer N., Conan B. (2012) Doe J., Mayer M., Smith N., Walker J. (2012)  Citations in text (subsequent ones) - AS IS AND CORRECT Doe, Peters et al (2012) Doe, Mayer et al (2012)   But in case of different years, it shouldn't actually do this ...  Doe J., Peters M., Kramer N., Conan B. (2012) Doe J., Mayer M., Smith N., Walker J. (2009)  Citations in text (subsequent ones) - AS IS: Doe, Peters et al (2012) Doe, Mayer et al (2009)  Citations in text (subsequent ones) - HOW IT SHOULD BE: Doe et al (2012) Doe et al (2009)   Can anyone help here?  Thank you! I am working on a proof about Dedekind cuts on the positive rational numbers. I have been stuck for a while on the following point and would appreciate any help.  Given $x\in \mathbb{Q}^+$ such that $x^2&lt;2$, how to find $y\in \mathbb{Q}^+$ such $y&gt;x$ and $y^2&lt;2$? Citing papers, that are cited within a paper? I am reading a paper which discussing the change in a specific idea in a field of science over time. I would like to basically summarize the points in the paper but in a smaller fashion by taking some quotes and explaining how they relate to my situation.   For instance, in the paper I am reading the author said "in 2002, Stanley and Miikkulainen [SM02b] argued that the topology of a neural network also affects their functionality" where the tag [SM02b] is a reference to a entry in the author's bibliography.   Is it sufficient to only cite the author of the paper, or do I need to cite both the author of the paper and the author of the paper the author cited in the paper? How do I select all the columns in a table that only contain NULL values for all the rows?  I'm using MS SQL Server 2005.  I'm trying to find out which columns are not used in the table so I can delete them. For $n\geq 3$ there exist $x,y\in S_n$ such that $x$ and $y$ have order $2$ and $xy$ has order $n$. Assume that $n\geq 3$. Let $S_n$ be the symmetric group with $n!$ elements. Prove that there exists $x$ and $y$ in $S_n$ such that $x$ and $y$ have order $2$ and $xy$ has order $n$.  For $n=3$, it is easy to see that $x=(1, 2)$ and $y=(1, 3)$ works. How to prove it for the general case? After seeing a question regarding the acquisition of Data's cat Spot, the point was brought up that Data's  midway through the series.  My question is, how? I have thought up two possibilities (see below to my own answer) but I'm wondering if there aren't possibly others that might fit better. Exhibit A- Spot the Younger  Exhibit B- Spot the Older I am trying to create an Apex Trigger that performs a Rollup from a custom object to Contacts.   Here is the error that I am receiving:      Didn't understand relationship 'Assignments__r' in FROM part of query   call. If you are attempting to use a custom relationship, be sure to   append the '__r' after the custom relationship name. Please reference   your WSDL or the describe call for the appropriate names.   The child relationship name is Assignments.  Below is the code:      trigger RollupActiveAssigmentLevelsToContact on pse__Assignment__c (after insert, after update, after delete) {      set&lt;Id&gt; set_id = new set&lt;Id&gt;();      List&lt;Contact&gt; con_list = new List&lt;Contact&gt;();      if(trigger.isInsert || trigger.isUpdate){         for(pse__Assignment__c myAssignment : trigger.New) {             set_id.add(myAssignment.pse__Resource__c);         }     }     else if(trigger.isDelete){         for(pse__Assignment__c myAssignment : trigger.Old){             set_id.add(myAssignment.pse__Resource__c);         }     }      if(trigger.isAfter &amp;&amp; (trigger.isInsert || trigger.isUpdate || trigger.isDelete)){         con_list = [SELECT id,Total_Levels__c, (SELECT id,name FROM Assignments__r WHERE Active_Assignment__c = TRUE) FROM Contact WHERE id IN :set_id];          for(Contact con : con_list){             if(con.Assignments__r.size()&gt;0)                 con.Total_Levels__c = con.Assignments__r.size();             else                 con.Total_Levels__c = 0;         }         if(!con_list.isEmpty())         update con_list;     } }   Below is a snap of the Child Relationship name: Arriving at a different port of entry in the same state in USA? I am a girl in my early twenties traveling to USA from India and in my visa application I have provided the contact address for a relative in San Francisco, and their invitation letter. I would like to visit LA first. Will I face problems during immigration if I land in LA (with an immediate on wards ticket to SF)? I dont plan to get on the flight from LA to SFO.  Initially I was planning to fly to SFO from India and then fly to LA immediately after completing immigration at SFO airport. Your Mileage May Vary In the United States we have a saying, "your mileage may vary", which means "your experience may be different".  In English-speaking countries that don't use Imperial miles, is there an equivalent expression? Trying to find the original story (I read it in Russian translation, original was most likely English unless it was Lem).  The story plot had artificial birds designed to serve as cops. The birds started attacking humans who were percieved as being aggressive towards anything alive. So they created more advanced birds to protect against the first ones. This worked for a while until the second kind started attacking humans as well. It ended with the idea that they would need another generation to attack the second-generation birds.  The story wasn't very long. I read it a while back (mid-1980s, which means the original was written even earlier, probably before 1980).  Despite a somewhat Asimov-like "misbehaving robots" topic, I'm pretty sure it wasn't Asimov. I am having trouble with (a) and (b):  I evaluated (a) and I got that sun of the first three terms does not equal $\ln(5/8)$. I got that it is equal to $\ln(3/4) + \ln(2/3) + \ln(15/16)$ which is not equal to $\ln(5/8)$.  I am also having trouble with part (b). I cannot figure out how to calculate the math to cancel out the $(k+1)^2$ and turn it into $2(n  +1)$.  Any help would be amazing. How can I send an email by Java application using GMail, Yahoo, or Hotmail? Is it possible to send an email from my Java application using a GMail account?  I have configured my company mail server with Java app to send email, but that's not going to cut it when I distribute the application. Answers with any of using Hotmail, Yahoo or GMail are acceptable. System installation is stalled on Compaq Presario R3000 There are $k$ penguins, $k\ge 3$. They are all different heights. How many ways are there to order the penguins in a line, left to right, so that we cannot find any three that are arranged tallest to shortest (in left to right order)? The penguin triples do not have have to be adjacent.  This problem is courtesy of someone I know only as "DaMancha." Install button in the software center is grayed out when trying to install .debs without an internet connection I just installed ubuntu 11.10 from a usb stick.   After installation, none of the software which I had collected and run on 11.10 or 11.04 runs on it. Even my newly downloaded opera or chrome installations does not work.  I do not have a internet connection.  Whenever i try to install any .deb file by double clicking it,software center opens up but the install button is grayed out. How can I press "Insert" on a keyboard without that key? Why is `enjoy to [verb]` incorrect I can say:     I love to read. I hate to read.   But it must be:     I enjoy to read. I enjoy reading.   What is enjoy so different? Movie Identification - 1990s VHS Sci-Fi/Horror