I'm working with a WPF ListBox and inside the ItemTemplate I have a StackPanel.  I'm trying to bind the width of the StackPanel to the ViewportWidth of the ListBox but I'm not able to find a way to do so.  If I bind the ActualWidth it's close, but since the vertical scrollbar is included in the ActualWidth I still end up with things hidden behind it and a horizonal scroll bar.  Please see the XAML below:  &lt;ListBox x:Name="MessagesGrid" Grid.Column="2" HorizontalContentAlignment="Stretch"&gt; &lt;ListBox.ItemTemplate&gt;     &lt;DataTemplate&gt;         &lt;Grid Width="{Binding Path=ActualWidth, ElementName=MessagesGrid}" HorizontalAlignment="Stretch"&gt;             &lt;StackPanel Name="ToMe"  HorizontalAlignment="Stretch" Visibility="{Binding IsFromMe, Converter={StaticResource BooleanToHiddenConverter}}"&gt;                 &lt;TextBlock Text="{Binding Date}" FontSize="8" TextWrapping="Wrap" Padding="0,0,60,0"/&gt;                 &lt;TextBlock Text="{Binding Text}" FontSize="12" TextWrapping="Wrap" Padding="0,0,60,0"/&gt;             &lt;/StackPanel&gt;             &lt;StackPanel Name="FromMe" HorizontalAlignment="Stretch" Visibility="{Binding IsFromMe, Converter={StaticResource BooleanToVisibleConverter}}"&gt;                 &lt;TextBlock Text="{Binding Date}" HorizontalAlignment="Right" FontSize="8" TextWrapping="Wrap" Padding="60,0,0,0"/&gt;                 &lt;TextBlock Text="{Binding Text}" HorizontalAlignment="Right"  FontSize="12" TextWrapping="Wrap" Padding="60,0,0,0"/&gt;             &lt;/StackPanel&gt;         &lt;/Grid&gt;     &lt;/DataTemplate&gt; &lt;/ListBox.ItemTemplate&gt; &lt;/ListBox&gt;
I have a ListBox DataTemplate in WPF. I want one item to be tight against the left side of the ListBox and another item to be tight against the right side, but I can't figure out how to do this.  So far I have a Grid with three columns, the left and right ones have content and the center is a placeholder with it's width set to "*". Where am I going wrong?  Here is the code:  &lt;DataTemplate x:Key="SmallCustomerListItem"&gt;     &lt;Grid HorizontalAlignment="Stretch"&gt;         &lt;Grid.RowDefinitions&gt;             &lt;RowDefinition/&gt;         &lt;/Grid.RowDefinitions&gt;         &lt;Grid.ColumnDefinitions&gt;             &lt;ColumnDefinition/&gt;             &lt;ColumnDefinition Width="*"/&gt;             &lt;ColumnDefinition/&gt;         &lt;/Grid.ColumnDefinitions&gt;         &lt;WrapPanel HorizontalAlignment="Stretch" Margin="0"&gt;             &lt;!--Some content here--&gt;             &lt;TextBlock Text="{Binding Path=LastName}" TextWrapping="Wrap" FontSize="24"/&gt;             &lt;TextBlock Text=", " TextWrapping="Wrap" FontSize="24"/&gt;             &lt;TextBlock Text="{Binding Path=FirstName}" TextWrapping="Wrap" FontSize="24"/&gt;          &lt;/WrapPanel&gt;         &lt;ListBox ItemsSource="{Binding Path=PhoneNumbers}" Grid.Column="2" d:DesignWidth="100" d:DesignHeight="50"      Margin="8,0" Background="Transparent" BorderBrush="Transparent" IsHitTestVisible="False" HorizontalAlignment="Stretch"/&gt;     &lt;/Grid&gt; &lt;/DataTemplate&gt;
Photon energy - momentum in matter If $p,q,r$ are all primes,and $p|qr-1$,$q|pr-1$ and $r|pq-1$,find all possible values of $pqr$. If $p,q,r$ are all primes,and $p|qr-1$$~~~~~~~~~~~~~$$q|pr-1$$~~~~~~~~~~$ and $~r|pq-1$. Find all possible values of $pqr$.    My work: $qr-1=pk_1$ $pr-1=qk_2$ $pq-1=rk_3$ From the above equations, we can conclude that either $k_1,k_2,k_3$ are all even or one of the primes is $2$. I can also get that, $p^2q^2r^2=(pk_1+1)(qk_2+1)(rk_3+1)$ Now, I cannot proceed. Please help! Are there any versions of t-SNE for streaming data? My understanding of  and the Barnes-Hut approximation is that all data points are required so that all force interactions can be calculated at the same time and each point can be adjusted in the 2d (or lower dimensional) map.  Are there any versions of t-sne that can efficiently deal with streaming data? So if my observations are arriving one at a time, it will find the best location on the 2d map to place the new observation, or continuously update all points on the 2d map to account for ht new observation.  Would this even make sense or does it go against the setup of t-sne. Pluralization of names If I were to use the sentence "There are lots of John Smiths" in the world, would that be the correct use for saying that there are a lot of people named John Smith in the world?  I don't think there should be an apostrophe as that would imply ownership of something.  If my first example is correct, then what would you do if the name referenced already ended with an 's'? A photon emitted from a receding source (Doppler redshift) has less energy when detected at an observer's location. Please explain the energy loss from the perspective of energy conservation. A better answer was posted long after accepting another. Should I accept the new one? Is there a way to save all my typed terminal commands and view it like history in a log book? Getting "Not found" message when running a 32-bit binary on a 64-bit system How Do I Apply to Become a Marketplace Creator? So I wanted to make some minecoins and I also heard that anyone become a marketplace creator could but I don't know where to apply. I'm in Minecraft Pocket Edition 1.14.30. Can you tell me where I can apply? Is there a difference between "" and {} in BibTeX? How do I perform a Perl substitution on a string while keeping the original? Proving by induction that $ \sum_{k=0}^n{n \choose k} = 2^n$ Prove by induction that for all $n \ge 0$:  $${n \choose 0} + {n \choose 1} + ... + {n \choose n} = 2^n.$$  In the inductive step, use Pascal’s identity, which is:  $${n+1 \choose k} = {n \choose k-1} + {n \choose k}.$$  I can only prove it using the binomial theorem, not induction. How to convert strings into integers in Python? I have my Xbox One set up to automatically download and install updates, the rest of my settings are shown below:    Is there a reason my games will show an update symbol on their tile, but they still don't download the update until I start the game manually? Will I still receive OTA updates after rooting my Nexus 5? Difference between negative and positive temperatures written as absolute value or the negative integer? **In a chemistry class, students were learning about boiling point of various elements.Reuben has compiled a table that gives boiling points of each of various elements.  The lowest boiling point is of Element X: – 200 degrees Fahrenheit. The highest boiling point is of Element Y: 550 degrees Fahrenheit  Find the difference between the lowest and highest boiling point**    I know how to calculate the difference. -200 – 550 = -750.  I am not sure if the answer is written as a negative or positive. Isn’t difference in temperature always written as its absolute value? Will the answer be – 750 F or 750 F ?  Would greatly appreciate if you could explain what the correct answer is. Where can I find out about Stack Overflow history? I'd like to know how Stack Overflow and other sites started - which was first, who initiated it (OK, that's on the link below) and why, how the different sites evolved, how the rules evolved, etc.  Where can I find such information?  Of course, I know I can look at  for a brief overview but I'm wondering if there is info on this site, particularly more detailed.. I've read a new study which suggests that yawning may help you keep a cool head. Also, the findings might hold some hope for sufferers of insomnia, migraines, and even epilepsy.  Is there any conclusion about what the function of yawning is and why do we yawn? Can you use another material as input to material nodes in cycles? $f'(x) = [f(x)]^{2}$. Prove $f(x) = 0 $ Let $f:\mathbb{R} \rightarrow \mathbb{R}$ be a differentiable function such that $f(0) = 0$ and $f'(x) = [f(x)]^{2}$, $\forall x \in \mathbb{R}$. Show that $f(x) = 0$,  $\forall x \in \mathbb{R} $.  I first (unsuccessfully) tried using the Mean Value Theorem, but this is in the Integrals chapter so the solution probably involves them. Can't really see where integrals come in here though.  What I've got so far:   (i) Since $f$ is differentiable, thus it is continuous and, hence,  integrable. Therefore $f^2$ is also integrable and as $f'=f^2$, $f'$ is too.   (ii) $f' \geq 0$, $\forall x \in \mathbb{R}$