Windows Presentation Foundation (WPF) ForumHow to use Windows Presentation Foundation (WPF) productively to create visually appealing and differentiating applications and to improve user experience.43e1b4ad-eb8d-427f-90a9-161e7af74457© 2009 Microsoft Corporation. All rights reserved.2009-11-24T05:32:17Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/cbcad206-11e6-4394-be74-6a8349cabcc0TextWriterProxy ... A little bit closer! How to make this global?2009-11-20T15:52:09Z2009-11-24T05:32:16ZMDMourahttp://social.msdn.microsoft.com/Profile/en-US/?user=MDMouraHello,<br/> <br/> I am trying to display on my WPF window the same output as it goes to the Console. For this I am using a TextWriterProxy.<br/> <br/> In my Window1.xaml.cs I have:<br/> <br/> <pre lang="x-c#"> DockPanel content = new DockPanel(); TextBlock output = new TextBlock(); TextWriterProxy proxy = new TextWriterProxy(); proxy.Add(Console.Out); StringBuilder sb = new StringBuilder(); StringWriter resultStringWriter = new StringWriter(sb); proxy.Add(resultStringWriter); Console.SetOut(proxy); proxy.WriteLine(&quot;Start&quot;); PackService.Run(); proxy.WriteLine(&quot;Finish&quot;); output.Text = sb.ToString(); DockPanel.SetDock(output, Dock.Bottom); content.Children.Add(output); Content = content; </pre> <br/> <br/> So now I see on my TextBlock the same as I see in my Console:<br/> <br/> Start<br/> Writing output to C:\Scripts\WCA.Site.min.js<br/> Writing output to C:\Scripts\JQuery-1.3.2.Plugins.min.js<br/> Writing output to C:\Styles\WCA.Base.min.css<br/> Finish <br/> <br/> The 3 middle lines are result of PackService.Run();<br/> <br/> However, if I click a menu button on my window that calls PackService.Run() nothing is showed on the window.<br/> <br/> Basically, I would like to make the proxy and Console.SetOut global to all application.<br/> And of course its association to the the TextBlock.<br/> <br/> Does anyone knows how to make this work globally?<br/> <br/> Please?<br/> <br/> My TextProxyWriter code is as follows:<br/> <br/> <pre lang="x-c#"> public class TextWriterProxy : TextWriter { private List&lt;TextWriter&gt; _writers = new List&lt;TextWriter&gt;(); public override Encoding Encoding { get { return Encoding.Default; } } // Encoding public override string NewLine { get { return base.NewLine; } set { foreach (TextWriter tw in _writers) tw.NewLine = value; base.NewLine = value; } } // NewLine public void Add(TextWriter writer) { if (!_writers.Contains(writer)) _writers.Add(writer); } // Add public bool Remove(TextWriter writer) { return _writers.Remove(writer); } // Remove public override void Write(char value) { foreach (TextWriter tw in _writers) tw.Write(value); base.Write(value); } // Write public override void Close() { foreach (TextWriter tw in _writers) tw.Close(); base.Close(); } // Close protected override void Dispose(bool disposing) { foreach (TextWriter tw in _writers) tw.Dispose(); base.Dispose(disposing); } // Dispose public override void Flush() { foreach (TextWriter tw in _writers) tw.Flush(); base.Flush(); } // Flush } // TextWriterProxy</pre> <br/> <br/> Thanks,<br/> Miguel<br/> <br/> <br/>http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/4e851a49-81ae-4f31-8913-2499dd50baeaBlackish Background on when opacity is reduced.2009-11-24T05:11:55Z2009-11-24T05:31:43Zrupeshchankyhttp://social.msdn.microsoft.com/Profile/en-US/?user=rupeshchankyHi All,<br/><br/>I am using following code for fade out effect on window.<br/>But somehow the window is fading out with blackish effect.<br/><br/><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small"><font size=2 color="#0000ff"><font size=2 color="#0000ff"> <p>private</p> </font></font></span><font size=2 color="#0000ff"> <p> </p> </font></span> <p><span style="font-size:x-small"> </span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">void</span></span><span style="font-size:x-small"> window1_MouseLeave(</span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">object</span></span><span style="font-size:x-small"> sender, </span><span style="color:#2b91af;font-size:x-small"><span style="color:#2b91af;font-size:x-small">MouseEventArgs</span></span><span style="font-size:x-small"> e) <p>{</p> <font size=2> <p> </p> </font></span></p> <p><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">try</span></span></p> <span style="font-size:x-small"> <p>{</p> <font size=2> <p>Window1Timer.Interval =</p> </font></span> <p><span style="color:#2b91af;font-size:x-small"><span style="color:#2b91af;font-size:x-small">TimeSpan</span></span><span style="font-size:x-small">.FromMilliseconds(200); <p>Window1Timer.Start();</p> <font size=2> <p>Window1Timer.Tick +=</p> </font></span></p> <p><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">new</span></span><span style="font-size:x-small"> </span><span style="color:#2b91af;font-size:x-small"><span style="color:#2b91af;font-size:x-small">EventHandler</span></span><span style="font-size:x-small">(Window1Timer_Tick); <p>}</p> <font size=2> <p> </p> </font></span></p> <p><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">catch</span></span><span style="font-size:x-small"> (</span><span style="color:#2b91af;font-size:x-small"><span style="color:#2b91af;font-size:x-small">Exception</span></span><span style="font-size:x-small"> exc) <p>{</p> </span></p> <span style="font-size:x-small"> <p>}</p> <font size=2> <p> </p> </font></span> <p><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">}<br/><br/>void</span></span><span style="font-size:x-small"> Window1Timer_Tick(</span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">object</span></span><span style="font-size:x-small"> sender, </span><span style="color:#2b91af;font-size:x-small"><span style="color:#2b91af;font-size:x-small">EventArgs</span></span><span style="font-size:x-small"> e) <p>{</p> <font size=2> <p> </p> </font></span></p> <p><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">try</span></span></p> <span style="font-size:x-small"> <p>{</p> <font size=2> <p> </p> </font></span> <p><span style="color:#2b91af;font-size:x-small"><span style="color:#2b91af;font-size:x-small">window1</span></span><span style="font-size:x-small">.Dispatcher.BeginInvoke(</span><span style="color:#2b91af;font-size:x-small"><span style="color:#2b91af;font-size:x-small">DispatcherPriority</span></span><span style="font-size:x-small">.Send, (</span><span style="color:#2b91af;font-size:x-small"><span style="color:#2b91af;font-size:x-small">DispatcherOperationCallback</span></span><span style="font-size:x-small">)</span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">delegate</span></span><span style="font-size:x-small">(</span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">object</span></span><span style="font-size:x-small"> o) <p>{</p> <p> </p> <font size=2> <p> </p> </font></span></p> <p><span style="color:#008000;font-size:x-small"><span style="color:#008000;font-size:x-small">//Following code kept for Fade in Fade out effect of window<br/></span></span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">this</span></span><span style="font-size:x-small">.Opacity = </span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">this</span></span><span style="font-size:x-small">.Opacity - 0.005; <p> </p> <font size=2> <p> </p> </font></span></p> <p><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">if</span></span><span style="font-size:x-small"> (</span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">this</span></span><span style="font-size:x-small">.Opacity == 0.0) <p>{</p> <font size=2> <p> </p> </font></span></p> <p><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">this</span></span><span style="font-size:x-small">.Close(); <p>}</p> <font size=2> <p> </p> </font></span></p> <p><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">return</span></span><span style="font-size:x-small"> </span><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">null</span></span><span style="font-size:x-small">;<font size=2> <p>},</p> </font></span></p> <p><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">null</span></span><span style="font-size:x-small">); <p>}</p> <font size=2> <p> </p> </font></span></p> <p><span style="color:#0000ff;font-size:x-small"><span style="color:#0000ff;font-size:x-small">catch</span></span><span style="font-size:x-small"> (</span><span style="color:#2b91af;font-size:x-small"><span style="color:#2b91af;font-size:x-small">Exception</span></span><span style="font-size:x-small"> exc) <p>{</p> </span></p> <span style="font-size:x-small"> <p>}</p> <p>}</p> </span>http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/cfb1a0e7-262a-41b4-a528-68d70d7abe26Custom control and data binding in generic.xaml2009-10-21T08:00:10Z2009-11-24T05:22:35Zxkrjahttp://social.msdn.microsoft.com/Profile/en-US/?user=xkrjaI'm starting out with custom controls in WPF and I don't understand how to create data binding in the generic.xaml. This is an example generic.xaml I have:<br/> <br/> <pre lang=x-xml>&lt;ResourceDictionary xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot; xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot; xmlns:local=&quot;clr-namespace:EngineBase&quot; xmlns:d=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;&gt; &lt;Style TargetType=&quot;{x:Type local:CustomControl1}&quot;&gt; &lt;Setter Property=&quot;Template&quot;&gt; &lt;Setter.Value&gt; &lt;ControlTemplate TargetType=&quot;{x:Type local:CustomControl1}&quot;&gt; &lt;Grid x:Name=&quot;grid&quot; Background=&quot;Transparent&quot; RenderTransformOrigin=&quot;0.5,0.5&quot;&gt; &lt;TextBlock Margin=&quot;8&quot; Text=&quot;{Binding MyText}&quot; Name=&quot;textblock1&quot; TextWrapping=&quot;Wrap&quot; Foreground=&quot;White&quot;/&gt; &lt;/Grid&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Style&gt; &lt;/ResourceDictionary&gt;</pre> As you can see I want to bind the 'Text' property of 'textblock1' to a property called 'MyText'. So, in the cs-file I have this:<br/> <br/> <pre lang="x-c#">using System.Windows; using System.Windows.Controls; namespace EngineBase { public class CustomControl1 : Button { public static readonly DependencyProperty MyTextProperty = DependencyProperty.Register(&quot;MyText&quot;, typeof(string), typeof(CustomControl1), new PropertyMetadata(new PropertyChangedCallback(CustomControl1.OnMyTextPropertyChanged))); public string MyText { get { return (string)GetValue(MyTextProperty); } set { SetValue(MyTextProperty, value); } } static CustomControl1() { DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomControl1), new FrameworkPropertyMetadata(typeof(CustomControl1))); } private static void OnMyTextPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { CustomControl1 myControl = d as CustomControl1; //Now what??? } } } </pre> But this doesn't seem to be enough to cause 'textblock1' to bind to the 'MyText' property. Do I need to inherit the 'INotifiyPropertyChanged' interface to the 'MyText' wrapper or is there another way when I'm creating custom dependency properties? <br/> <br/> Thanks for help!http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/2c394879-c9bd-47d8-b30f-3352bf2117d4Listview with expander2009-11-24T04:36:09Z2009-11-24T04:36:10Zxl3khttp://social.msdn.microsoft.com/Profile/en-US/?user=xl3kI am trying to create a table where a set of rows could be expanded/collapsed. I believe I should be using the ListView control (gridview mode) and the Expander control. A step by step guide on how to do it would be extremely helpful.<br/><br/>Things I am particularly stuck at are:<br/>1. How to add the expander control to the listview<br/>2. How to handle the expand/collapse messages<br/>3. How to do thigs in the code as I expect rows to be dynamically added/removed from the table.<br/><br/>Thanks in advance!http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/9663baea-1f1e-41ea-80fc-10f98d051a5bStrange behaviour when running application in two windows instead of one2008-12-15T10:30:11Z2009-11-24T04:23:25ZMatjaž Kofolhttp://social.msdn.microsoft.com/Profile/en-US/?user=Matja%u017e%20Kofol <p align=left>Hello,<br> <br> We have user control that is our multimedia Player (that use MediaElement to play content) and we are using two monitors (1920x1200px) on one Nvidia graphic card 9500GT (Dual DVI) to run our application on both monitors. System is Windows Vista with latest updates.<br> <br> <b>CASE 1:</b></p> <ul> <li>We have application that has two windows running in whole screen 2 x (1920x1200px) mode. </li> <li>On each monitor (window) our player (user control) plays multimedia content - mostly video.</li> <li>Second window is shifted left for the 1920px (resolution of the first screen) so it is showed on other monitor in extended destop mode).</li> <li>When we have this configuration then strange green pixels <a href="http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/c01b30e1-11b0-4e9d-b22c-72b24a41edc4">I wrote about them here</a> are shown on second monitor at the beginning of some videos (totally random - sometimes they are clear but mostly they have green pixels at the beginning). <br> <b></b></li> </ul> <p><b>CASE 2:<br> </b></p> <ul> <li>Then we created only one window application that has size 3840x1200px </li> <li>We put two user controls (players) inside this big window to simulate previous two windows behaviour </li> <li>With this configuration there are no green pixels at all, but CPU resources are maybe doubled (31% instead of 16% on Quad Core) then in case 1 when we had two windows.</li> </ul> <p><b>QUESTIONS:</b></p> <ul> <li>What is the catch about these green pixels? Why they are shown when we have twowindows instead of one?</li> <li>Why it is working in second case without green pixels, and why is the second case more CPU demanding </li> </ul> <p>(twice)?<br> <br> Regards<br> Matjaž</p> wpf, green pixels, window, player, media elementhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/a5343d7a-5248-4d3b-ac18-ef38e200d597WPF DataGrid Refresh Problem after sorting2009-11-16T07:30:18Z2009-11-24T04:23:23Zksvimalhttp://social.msdn.microsoft.com/Profile/en-US/?user=ksvimal<p>Hi,<br/><br/><br/>I have used the following code to bind the list to my DataGrid. The Data are displayed correcttly in the datagrid. Consider 5 items in the list. So all 5 items are displayed in the DataGrid.</p> <p>XAML:<br/>&lt;my:DataGrid x:Name=&quot;DataGrid1&quot; ItemSource=&quot;{Binding}&quot; AutoGenerateColumns=&quot;True&quot; /&gt;<br/><br/>C#:<br/>List&lt;I_Account&gt; AccountList;<br/>DataGrid1.DataContext = AccountList</p> <p>Problem:<br/>By using the following code, if i delete any item from the AccountList then it is immediately reflecting in the DataGrid1.<br/><br/>But if I apply sorting on any of the column in the WPF DataGrid and if i delete any item from the AccountList,  then it is not reflecting in the DataGrid1. In debug mode, I am able to see the count decreased to 4 in both List and DataGrid1. But it is not reflecting only in the UI.<br/><br/>This only happens after sorting. Please help me how to solve this.</p> <p>Code To Remove the Item:<br/>AccountList.Remove(Selecteditem);<br/>DataGrid1.Items.Refresh();</p>http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/1becaac1-dd43-4a70-a47c-39f5a494a8a0Changing datagrid cell background according to value2009-11-11T08:43:50Z2009-11-24T04:11:47ZRuiLopeshttp://social.msdn.microsoft.com/Profile/en-US/?user=RuiLopesHi all, <br/> <br/> I think the title says it all.. I would like to change a datagrid background cell evreytime the content has a specific value..<br/> <br/> I currently have this:<br/> <br/> <pre lang=x-xml> &lt;toolkit:DataGrid.CellStyle&gt; &lt;Style TargetType=&quot;toolkit:DataGridCell&quot; &gt; &lt;Style.Triggers&gt; &lt;Trigger Property=&quot;HasContent&quot; Value=&quot;True&quot;&gt; &lt;Setter Property=&quot;Background&quot; Value=&quot;SeaGreen&quot;/&gt; &lt;/Trigger&gt; &lt;/Style.Triggers&gt; &lt;/Style&gt; &lt;/toolkit:DataGrid.CellStyle&gt; </pre> which works fine.. however, when I try to adapt it and change the property to &quot;Content&quot; and the Value to &quot;10&quot; I get nothing!!!!<br/> <br/> Can you guys help me?<br/> <br/> PS: I'm working with the toolkit datagrid and the data source is an array of doubles..<br/> <br/> Thanks in advance<br/> <br/>http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/29b4cd22-b60f-4980-bb8f-1092a12b7823Why the IsEnabled for the style of ComboBoxItem does not work unless the dropdown list is showed?2009-11-24T03:51:24Z2009-11-24T03:51:30ZJetsunhttp://social.msdn.microsoft.com/Profile/en-US/?user=JetsunFollowing is the XAML and data, the IsEnabled property of ComboboxItem is binding to the value in the data.<br/> The disabled item still can be selected when user roll the mouse wheel in the textbox of ComboBox.<br/> But after the dropdown list is showed, then the disabled items will not be able to selected by scroll the mouse wheel in the textbox of combobox.<br/> <br/> There is another problem, the disabled item can be selected if the combobox is Editable, and user input the disabled item.<br/> <br/> <pre lang=x-xml> &lt;Window.Resources&gt; &lt;ResourceDictionary&gt; &lt;Style TargetType=&quot;{x:Type ComboBoxItem}&quot;&gt; &lt;Setter Property=&quot;IsEnabled&quot; Value=&quot;{Binding Path =[1]}&quot;/&gt; &lt;/Style&gt; &lt;/ResourceDictionary&gt; &lt;/Window.Resources&gt; &lt;Grid&gt; &lt;ComboBox Margin=&quot;46,72,31,0&quot; Name=&quot;ComboBox1&quot; Height=&quot;28&quot; VerticalAlignment=&quot;Top&quot; IsEditable=&quot;True&quot; TextSearch.TextPath=&quot;[0]&quot; DisplayMemberPath=&quot;[0]&quot; SelectedValuePath=&quot;[0]&quot; &gt; &lt;/ComboBox&gt;</pre> <pre lang=x-vbnet> Private Sub Window_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Dim combList As New List(Of String()) combList.Add(New String() {&quot;1 Item1&quot;, &quot;True&quot;}) combList.Add(New String() {&quot;2 Item2&quot;, &quot;False&quot;}) combList.Add(New String() {&quot;3 Item3&quot;, &quot;True&quot;}) combList.Add(New String() {&quot;4 Item4&quot;, &quot;False&quot;}) combList.Add(New String() {&quot;5 Item5&quot;, &quot;True&quot;}) Me.ComboBox1.ItemsSource = combList End Sub</pre>http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/c8f6b2ab-7650-450e-9ac2-ccc631802604Grid, viewbox and layout issues2009-11-23T01:36:39Z2009-11-24T03:41:08ZNumber Sevenhttp://social.msdn.microsoft.com/Profile/en-US/?user=Number%20SevenAlright.<br/> <br/> I have the following setup in my code, shown by the screenshot on ths link: http://omploader.org/vMnU1ag/screen.png<br/> <br/> The code is the following:<br/> <br/> <pre lang=x-xml>&lt;Window xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot; xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot; xmlns:d=&quot;http://schemas.microsoft.com/expression/blend/2008&quot; xmlns:mc=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot; x:Class=&quot;WpfApplication2.MainWindow&quot; Title=&quot;NexusMC&quot; Height=&quot;600&quot; Width=&quot;800&quot; WindowStartupLocation=&quot;CenterScreen&quot; BorderThickness=&quot;0&quot; x:Name=&quot;Window&quot; Background=&quot;Black&quot;&gt; &lt;Window.Resources&gt; &lt;Style TargetType=&quot;{x:Type ListBoxItem}&quot;&gt; &lt;Setter Property=&quot;FocusVisualStyle&quot; Value=&quot;{x:Null}&quot; /&gt; &lt;Setter Property=&quot;Template&quot;&gt; &lt;Setter.Value&gt; &lt;ControlTemplate TargetType=&quot;{x:Type ListBoxItem}&quot;&gt; &lt;Border x:Name=&quot;Border&quot; CornerRadius=&quot;5&quot; BorderThickness=&quot;5&quot; BorderBrush=&quot;Black&quot; Margin=&quot;10&quot;&gt; &lt;ContentPresenter /&gt; &lt;/Border&gt; &lt;ControlTemplate.Triggers&gt; &lt;Trigger Property=&quot;IsSelected&quot; Value=&quot;true&quot;&gt; &lt;Setter Property=&quot;BorderBrush&quot; TargetName=&quot;Border&quot; Value=&quot;White&quot; /&gt; &lt;/Trigger&gt; &lt;Trigger Property=&quot;IsSelected&quot; Value=&quot;false&quot;&gt; &lt;Setter Property=&quot;BorderBrush&quot; TargetName=&quot;Border&quot; Value=&quot;Black&quot; /&gt; &lt;/Trigger&gt; &lt;/ControlTemplate.Triggers&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Style&gt; &lt;Style TargetType=&quot;{x:Type ListBox}&quot;&gt; &lt;Setter Property=&quot;Background&quot;&gt; &lt;Setter.Value&gt; &lt;SolidColorBrush Opacity=&quot;0.50&quot; Color=&quot;Black&quot;/&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;Setter Property=&quot;BorderThickness&quot; Value=&quot;0&quot;/&gt; &lt;Setter Property=&quot;ScrollViewer.HorizontalScrollBarVisibility&quot; Value=&quot;Hidden&quot;/&gt; &lt;Setter Property=&quot;ScrollViewer.VerticalScrollBarVisibility&quot; Value=&quot;Hidden&quot;/&gt; &lt;Setter Property=&quot;ScrollViewer.CanContentScroll&quot; Value=&quot;true&quot;/&gt; &lt;Setter Property=&quot;VerticalContentAlignment&quot; Value=&quot;Center&quot;/&gt; &lt;Setter Property=&quot;Template&quot;&gt; &lt;Setter.Value&gt; &lt;ControlTemplate TargetType=&quot;{x:Type ListBox}&quot;&gt; &lt;Border x:Name=&quot;Bd&quot; Background=&quot;{TemplateBinding Background}&quot; BorderBrush=&quot;{TemplateBinding BorderBrush}&quot; BorderThickness=&quot;{TemplateBinding BorderThickness}&quot; Padding=&quot;1&quot; CornerRadius=&quot;10&quot;&gt; &lt;ScrollViewer Padding=&quot;{TemplateBinding Padding}&quot; Margin=&quot;0&quot;&gt; &lt;ItemsPresenter /&gt; &lt;/ScrollViewer&gt; &lt;/Border&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Style&gt; &lt;Storyboard x:Key=&quot;Fade&quot; x:Name=&quot;Fade&quot; Completed=&quot;Fade_Completed&quot;&gt; &lt;DoubleAnimation Duration=&quot;0:0:0.5&quot; From=&quot;0&quot; To=&quot;1&quot; Storyboard.TargetName=&quot;imgBack&quot; Storyboard.TargetProperty=&quot;Opacity&quot; FillBehavior=&quot;Stop&quot; Completed=&quot;Fade_Completed&quot; /&gt; &lt;DoubleAnimation Duration=&quot;0:0:0.5&quot; From=&quot;1&quot; To=&quot;0&quot; Storyboard.TargetName=&quot;imgFront&quot; Storyboard.TargetProperty=&quot;Opacity&quot; FillBehavior=&quot;Stop&quot; Completed=&quot;Fade_Completed&quot; /&gt; &lt;/Storyboard&gt; &lt;/Window.Resources&gt; &lt;Grid Name=&quot;g&quot;&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height=&quot;5*&quot;/&gt; &lt;RowDefinition Height=&quot;70*&quot;/&gt; &lt;RowDefinition Height=&quot;20*&quot;/&gt; &lt;RowDefinition Height=&quot;5*&quot;/&gt; &lt;/Grid.RowDefinitions&gt; &lt;Viewbox x:Name=&quot;VBox&quot; Grid.Row=&quot;2&quot; Stretch=&quot;Fill&quot; Margin=&quot;0,0,0,0&quot;&gt; &lt;ListBox BorderThickness=&quot;0&quot; Margin=&quot;0&quot; x:Name=&quot;lstMenu&quot; Width=&quot;{Binding RowDefinitions[2].Width, ElementName=g, Mode=Default}&quot; Height=&quot;{Binding RowDefinitions[2].Height, ElementName=g, Mode=Default}&quot; VerticalContentAlignment=&quot;Center&quot; ScrollViewer.CanContentScroll=&quot;True&quot;&gt; &lt;ListBox.Resources&gt; &lt;SolidColorBrush x:Key=&quot;{x:Static SystemColors.HighlightBrushKey}&quot; Color=&quot;Transparent&quot; /&gt; &lt;SolidColorBrush x:Key=&quot;{x:Static SystemColors.HighlightTextBrushKey}&quot; Color=&quot;Transparent&quot; /&gt; &lt;SolidColorBrush x:Key=&quot;{x:Static SystemColors.ControlBrushKey}&quot; Color=&quot;Transparent&quot; /&gt; &lt;/ListBox.Resources&gt; &lt;ListBox.ItemsPanel&gt; &lt;ItemsPanelTemplate&gt; &lt;WrapPanel /&gt; &lt;/ItemsPanelTemplate&gt; &lt;/ListBox.ItemsPanel&gt; &lt;ListBoxItem Content=&quot;O&quot; Foreground=&quot;White&quot; IsSelected=&quot;True&quot;/&gt; &lt;ListBoxItem Content=&quot;OMG&quot; Foreground=&quot;White&quot;/&gt; &lt;ListBoxItem Content=&quot;OMG&quot; Foreground=&quot;White&quot;/&gt; &lt;ListBoxItem Content=&quot;OMG&quot; Foreground=&quot;White&quot;/&gt; &lt;/ListBox&gt; &lt;/Viewbox&gt; &lt;/Grid&gt; &lt;/Window&gt;</pre> <br/> <br/> The problem is: I'm using a viewbox to keep the elements proportionally sized so the app is resolution-independent. However, I'm having a problem with the listbox.<br/> <br/> I need the listbox to fill the 3rd row (as shown by the screenshot) BUT its items must not be stretched. I don't have much idea why they are being stretched, as I need them to be of around 10-15% WIDE relative to the window size, as I know that if I only set the width, the height will autosize, or visceversa. The thing is, they must be rectangular, more tall than wide, and start from the left.<br/> <br/> In short, it should behave this way: http://omploader.org/vMnU1cA/screen4.jpg BUT the listbox should fill the 3rd row wide, and the items should be proportionally sized like that. <br/> <br/> I've been working on this for two days straight and haven't found a solution so that's why I'm asking, as I know some of you could guide me in the right path.<br/> <br/> Thanks in advance! :D<br/> <br/> -N7http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/9e6a8a17-50b2-4780-9010-3a88dcd9998bUsing Code Behind Property as parameter in markup extension constructor2009-11-19T12:05:07Z2009-11-24T02:57:51ZEbbe Hundborghttp://social.msdn.microsoft.com/Profile/en-US/?user=Ebbe%20Hundborg<p>I don't know how to pass a value from my code behind to a markup extension call in my xaml. I'm sure it's matter of simple syntax but I haven't been able to find it. Please help.</p> <p><br/>MyClass.xaml.cs</p> <p>...</p> <p>public int ID { get; set; }</p> <p>// Constructor that takes an int as input param<br/>public MyClass(int id) {<br/>    ID = id;<br/>}</p> <p>...</p> <p><br/>MyClass.xaml</p> <p>...</p> <p>&lt;!-- Invoke the Markup Extension Constructor with the value of the ID property from the code behind --&gt;<br/>&lt;!-- This is where I mess things up - I don't know to insert the ID property value here - this doesn't work... --&gt;<br/>&lt;Label Content=&quot;{REF:MyMarkupExtension <span style="text-decoration:underline"><strong>ID</strong></span>}&quot; /&gt;</p> <p><br/>...</p> <p><br/>MyMarkupExtension.cs</p> <p>...</p> <p>// Constructor<br/>public MyMarkupExtension(int id) {<br/>    // Do stuff with id...<br/>}</p> <p>...</p>http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/87fde09a-eb5c-4afe-b09a-e98cb230ebe7XAML and 3D Application using sliverlight2009-11-23T23:41:51Z2009-11-24T02:07:59ZSatish Pawashehttp://social.msdn.microsoft.com/Profile/en-US/?user=Satish%20PawasheI am looking for a XAML and source code example for how Microsoft developed an web application in sliver-light with 3D interactivity. Here is the site..<br/> https://zunestore.net/us/catalog/index.aspx<br/> <br/> Is there a way get the sample code?http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/be7163f6-2521-40b0-8463-1419130284ddSaving an image2009-11-12T03:12:43Z2009-11-24T01:38:25ZC F D Ghttp://social.msdn.microsoft.com/Profile/en-US/?user=C%20%20F%20%20D%20%20GHello everyone, <div><br/></div> <div>I am working on a program, of which I would like the user to be able to click a button, and when that button is clicked, it will take a Screen Shot of the screen, use code to copy that off of the clipboard, prompt the user where to save it, and save it as a Bitmap picture file.</div> <div><br/></div> <div>How can this be done?</div> <div><br/></div> <div>Sincerely,</div> <div><br/></div> <div>- Jake M.</div>http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/83a02948-e8bc-4d36-b851-420928a62305Render Mode: Software or Hardware?2009-11-10T09:26:29Z2009-11-24T01:33:45Zda Vincihttp://social.msdn.microsoft.com/Profile/en-US/?user=da%20VinciUsing Preforator tool ( <a href="http://msdn.microsoft.com/en-us/library/aa969767.aspx#perforator">http://msdn.microsoft.com/en-us/library/aa969767.aspx#perforator</a> ) you can see software rendering with purple tint. How to determinate whether the given control is rendered in software mode in the code? <br/><br/>P.S. I use D3DImage and have to know it so D3DImage doesn't draw anything in software mode.http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/e2921a5b-2129-4360-a263-77114ef7fd48WPFFontCache_v0400.exe Is Hogging CPU2009-11-11T16:28:11Z2009-11-24T01:19:23Zgwanhttp://social.msdn.microsoft.com/Profile/en-US/?user=gwanHello Sir,<br/> i have installed Visual Studio Beta 2 Ultimate on my system, Windows XP 32 Bit, 1 GB RAM, Intel Processor etc.<br/> <br/> the installation of beta 2 goes successfully.<br/> <br/> i can open the IDE Easily.<br/> <br/> but after creating/opening a project, my system becomes very slow, i thought that devenv.exe is taking a lot of memory and CPU, but when i opened Task Manager, i saw this WPFFontCache_v0400.exe taking 100 % CPU and close to 3 MB of memory.<br/> It is showing my CPU Usage to 100 % all the time, this exe is running.<br/> <br/> now my question is that why this exe is hogging my CPU.<br/> <br/> Kindly please help me in this.<br/> <br/> Looking for favorable replies.<br/> <br/> Thankshttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b0f77818-dcd9-4922-b525-77ccaf333181concurrency violation the deletecommand affected 0 of the expected 1 records.for C# using WPF dataset to sql2009-11-24T00:10:23Z2009-11-24T00:10:25ZStevenIBhttp://social.msdn.microsoft.com/Profile/en-US/?user=StevenIBHello,<br/><br/>sorry for the long Title, but as said i am getting error message: concurrency violation the deletecommand affected 0 of the expected 1 records., this happens when i go and add a new/ or insert new to sql database using Dataset/dataadaptor, I am using WPF as for the Gui interface and using C# for the backend programming, here is the code right now i got that error's out on sqlda.Update(sqlds, &quot;Workers&quot;); and i seen there are ways of fixing this but i only seen it fixed for VB and sadly i dont know VB to well. so if anyone can let me know how to fix in C# that would be awesome, here is the code below of the delete event:<br/><br/> <pre> private void btn_delete_Click(object sender, RoutedEventArgs e) { if (Listview1.SelectedItems.Count &gt; 0) { if (MessageBox.Show(&quot;Are you sure you want to delete &quot; + (Listview1.SelectedItem as DataRowView)[&quot;First_Name&quot;].ToString() + &quot; &quot; +(Listview1.SelectedItem as DataRowView)[&quot;Last_Name&quot;].ToString(), &quot;Are you sure?&quot;, MessageBoxButton.YesNo) == MessageBoxResult.Yes) { SqlCommandBuilder sq = new SqlCommandBuilder(sqlda); sqlds.Tables[&quot;Workers&quot;].Rows[Listview1.SelectedIndex].Delete(); MessageBox.Show(&quot;Record Deleted Successfully&quot;); //sqlds.AcceptChanges(); sqlda.Update(sqlds, &quot;Workers&quot;); } } else MessageBox.Show(&quot;Please select then click on delete button&quot;); }</pre> Thank youhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/42b242a4-4221-4e58-b742-b259a8849993binding to xml 2009-11-23T23:10:42Z2009-11-23T23:55:54Ztomer70http://social.msdn.microsoft.com/Profile/en-US/?user=tomer70<p><br/>Hi<br/><br/>How do i binds to a xml document while selecting the type of clr object to be created?<br/><br/>for example,i have the following xml document</p> <p>&lt;ClassInfo Title='A' X=100 Y=200&gt;<br/>&lt;ClassInfo Title='B' X=100 Y=200&gt;</p> <p><br/>and the following class<br/><br/>class ClassDetails<br/>{<br/>   string Name;<br/>   ClassDetails(string name);<br/>}<br/><br/><br/>during the binding i want to create a ClassDetails instance for each ClassInfo,<br/>and draw the ClassDetails on a canvas at position X and Y.<br/><br/>The name of the instance should be initialized with the 'Title' attribuute<br/><br/>X and Y should not be part of ClassDetails class<br/><br/>Thanks in advance<br/><br/></p>http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/904b190a-1943-480e-a970-8b0255201f81Synchronizing animations in virtualizing stackpanel2009-11-23T23:42:51Z2009-11-23T23:42:51ZTimmyGRhttp://social.msdn.microsoft.com/Profile/en-US/?user=TimmyGRI have a ListView where the first column of each row will display an animation given certain conditions.<br/><br/>However, I want the animations for each row to be running on the same timeline (i.e. want them all to start at the same time).  Depending on when the datatemplate is generated, the animations are out of sync.  The virtualizing nature causes significant issues (using a non-virtualizing panel is an option, but I'd rather not take the performance hit).<br/><br/>Can anyone think of a way to get the animations to have the same BeginTime? http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/5992b0eb-bc5d-4249-9b6c-4eb99208c3e2Listview data binding question2009-11-23T19:52:47Z2009-11-23T23:31:33Zsesn2000http://social.msdn.microsoft.com/Profile/en-US/?user=sesn2000Hi,<br/> <br/> I have created a listview and I have bound it to ObservableCollection(Of UserInfo) list. The listview has 2 columns and I have bound the columns to properties in my object. When I add items to the collection I see them in my listview but the SourceUpdate event never gets fired. Is there anything specially needs to be done to get the event fired. I need to do more stuff once the user added to the list. Some code snippet below<br/> <br/> XAML:<br/>                 &lt;ListView ItemsSource=&quot;{Binding Source={StaticResource UsersListDataSource}, NotifyOnSourceUpdated=true}&quot; IsSynchronizedWithCurrentItem=&quot;True&quot; Margin=&quot;4,9,5,9&quot; Name=&quot;lvUserList&quot; SelectionMode=&quot;Single&quot; SelectionChanged=&quot;OnListViewSelectionChanged&quot; SourceUpdated=&quot;OnSourceUpdated&quot; TargetUpdated=&quot;OnTargetUpdated&quot;&gt;<br/>                     &lt;ListView.View&gt;<br/>                         &lt;GridView&gt;<br/>                             &lt;GridViewColumn DisplayMemberBinding=&quot;{Binding Path=UserName, Mode=OneWay}&quot; Width=&quot;158&quot; Header=&quot;User Name&quot;/&gt;<br/>                             &lt;GridViewColumn DisplayMemberBinding=&quot;{Binding Path=UserType, Mode=OneWay}&quot; Width=&quot;158&quot; Header=&quot;Autority Level&quot;/&gt;<br/>                         &lt;/GridView&gt;<br/>                     &lt;/ListView.View&gt;<br/>                 &lt;/ListView&gt;<br/>http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/e64f2015-be16-4cd1-8535-e410022de36fListView/GridView hyperlink columns for ID fields2009-11-23T23:25:35Z2009-11-23T23:25:36ZMSearleshttp://social.msdn.microsoft.com/Profile/en-US/?user=MSearlesHi, <div><br/></div> <div>I'm trying to create a ListView/GridView that will display the results of a database query, and show any ID column as a hyperlink, which, when clicked, will open a new View of a the object. This wouldn't be too tricky except that I'm working on a database with about 30 tables, and the query is completely dynamic. Ie, could have any of the fields in the database in it. I'm OK with creating a list of commands for the hyperlinks, testing to see if the field <em>should</em> become a hyperlink, and executing the command if the hyperlink is clicked, but I'm not sure of how to create the appropriate ItemsSource. </div> <div><br/></div> <div>The query returns a DataTable... I don't know which or how many fields there will be, so how can I create an ItemsSource or DataTemplate that will allow the ID columns to be displayed as Hyperlinks?</div> <div><br/></div> <div>Warm regards,</div> <div>Matt</div> <div><br/></div> <div>Image : http://tinypic.com/r/312isk3/6  // Did this with a Grid object, but its far from ideal</div> <div><br/></div>http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/1bf01a90-e7b6-48e6-b0a4-1ad8f305ba0cBinding to XML in WPF2009-11-13T03:24:42Z2009-11-23T23:07:22ZRussell_Eubankshttp://social.msdn.microsoft.com/Profile/en-US/?user=Russell_EubanksI have an XML column in a table in a SQL Server database. I want to read this column, then two-way databind its fields into WPF controls or a WPF DataGrid. What is the best .NET object to use for this and what would be the proper syntax? I'm using VS 2010 Beta 2.http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/98d95f9a-7504-4184-9079-f28998b770a3about WPF 3D Transparency Depth-Order Sorting 2009-11-20T07:40:15Z2009-11-23T22:59:26ZWency Louhttp://social.msdn.microsoft.com/Profile/en-US/?user=Wency%20LouI have seen the artical posted here <a href="http://blogs.msdn.com/pantal/archive/2007/07/23/sorting-for-wpf-3d-transparency.aspx">http://blogs.msdn.com/pantal/archive/2007/07/23/sorting-for-wpf-3d-transparency.aspx</a>   but how to sort the intersect planes?http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/704f6b19-4df5-4466-8ee3-c1de6f87a737Making a Grid the content of a RowDetailsTemplate DataTemplate in a WPF DataGrid2009-11-23T22:44:13Z2009-11-23T22:44:14ZRussell_Eubankshttp://social.msdn.microsoft.com/Profile/en-US/?user=Russell_EubanksI have built a Grid of content dynamically in code and I want this Grid to be used as the DataTemplate in the RowDetailsTemplate of a WPF DataGrid. The DataGrid looks like this:<br/><br/> <pre lang=x-xml>&lt;DataGrid Name=&quot;dataGridHouseholdMembers&quot; Grid.Row=&quot;0&quot; Grid.Column=&quot;0&quot; ItemsSource=&quot;{Binding HouseholdMembers}&quot; AutoGenerateColumns=&quot;False&quot; Style=&quot;{StaticResource dataGridStyle}&quot; RowDetailsVisibilityMode=&quot;VisibleWhenSelected&quot;&gt; &lt;DataGrid.Columns&gt; &lt;DataGridComboBoxColumn x:Name=&quot;dataGridComboBoxColumnRelationship&quot; ClipboardContentBinding=&quot;{Binding Path=RelationshipToPrimaryContact}&quot; Header=&quot;Relationship&quot; SelectedItemBinding=&quot;{Binding Path=RelationshipToPrimaryContact}&quot; SelectedValueBinding=&quot;{Binding Path=RelationshipToPrimaryContact}&quot; TextBinding=&quot;{Binding Path=RelationshipToPrimaryContact}&quot; /&gt; &lt;DataGridTextColumn Binding=&quot;{Binding FirstName}&quot; ClipboardContentBinding=&quot;{x:Null}&quot; Header=&quot;First Name&quot; /&gt; &lt;DataGridTextColumn Binding=&quot;{Binding MiddleName}&quot; ClipboardContentBinding=&quot;{x:Null}&quot; Header=&quot;Middle Name&quot; /&gt; &lt;DataGridTextColumn Binding=&quot;{Binding LastName}&quot; ClipboardContentBinding=&quot;{x:Null}&quot; Header=&quot;Last Name&quot; /&gt; &lt;DataGridComboBoxColumn x:Name=&quot;dataGridComboBoxColumnSuffix&quot; ClipboardContentBinding=&quot;{Binding Path=Suffix}&quot; Header=&quot;Suffix&quot; SelectedItemBinding=&quot;{Binding Path=Suffix}&quot; SelectedValueBinding=&quot;{Binding Path=Suffix}&quot; TextBinding=&quot;{Binding Path=Suffix}&quot; /&gt; &lt;DataGridTextColumn Binding=&quot;{Binding DateOfBirth, StringFormat=d}&quot; ClipboardContentBinding=&quot;{x:Null}&quot; Header=&quot;Birth Date&quot; /&gt; &lt;DataGridComboBoxColumn x:Name=&quot;dataGridComboBoxColumnGender&quot; ClipboardContentBinding=&quot;{Binding Path=Gender}&quot; Header=&quot;Gender&quot; SelectedItemBinding=&quot;{Binding Path=Gender}&quot; SelectedValueBinding=&quot;{Binding Path=Gender}&quot; TextBinding=&quot;{Binding Path=Gender}&quot;&gt; &lt;DataGridComboBoxColumn.ItemsSource&gt; &lt;col:ArrayList&gt; &lt;sys:String&gt;F&lt;/sys:String&gt; &lt;sys:String&gt;M&lt;/sys:String&gt; &lt;sys:String&gt;X&lt;/sys:String&gt; &lt;/col:ArrayList&gt; &lt;/DataGridComboBoxColumn.ItemsSource&gt; &lt;/DataGridComboBoxColumn&gt; &lt;/DataGrid.Columns&gt; &lt;DataGrid.RowDetailsTemplate&gt; &lt;DataTemplate&gt; &lt;GroupBox Name=&quot;groupBoxPersonDemographics&quot;&gt;&lt;/GroupBox&gt; &lt;/DataTemplate&gt; &lt;/DataGrid.RowDetailsTemplate&gt; &lt;/DataGrid&gt;</pre> I want to do something like: <span style="font-family:Consolas;font-size:x-small"><span style="font-family:Consolas;font-size:x-small"> <p>groupBoxPersonDemographics.Content = _gridPersonDemographics;<br/><br/>but when I try to do so I get the message that groupBoxpersonDemographics is not in context.<br/><br/>What is the proper syntax to load the grid as the content of the DataTemplate? Can I do it prior to loading any data into the DataGrid (I only want the row details to be visible for the SelectedItem) or must I do it when the <span style="font-family:Consolas;font-size:x-small"><span style="font-family:Consolas;font-size:x-small">RowDetailsVisibilityChanged event fires for the DataGrid?</span></span></p> </span></span>http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/0a1873f5-5e8b-45c7-a921-d32aec8aa88eDisable Hardware Acceleration Registry entry does not exist in Windows 72009-11-20T15:22:47Z2009-11-23T22:43:47ZWPFDechttp://social.msdn.microsoft.com/Profile/en-US/?user=WPFDecI am running Windows 7 Enterprise, and am trying to disable hardware acceleration for testing purposes. But, the registry entry mentioned at <a title="hardware acceleration" href="http://beta.blogs.microsoft.co.il/blogs/janiv/archive/2009/06/07/hardware-acceleration-in-wpf.aspx">http://beta.blogs.microsoft.co.il/blogs/janiv/archive/2009/06/07/hardware-acceleration-in-wpf.aspx</a> does not exist in my registry. <div><br/></div> <div>I can drill down to <a href="http://hkey_current_user/SOFTWARE/Microsoft/Avalon.Graphics">HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics</a>, but there no key/value for DisableHWAcceleration<br/> <div> <div><span style="font-family:Tahoma, Arial, Helvetica;font-size:14px"> <p><strong></strong></p> <pre>Disable Hardware Acceleration Option [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics\DisableHWAcceleration] The disable hardware acceleration option enables you to turn off (set its DOWRD value to 1) hardware acceleration for debugging and test purposes. When you see rendering artifacts in an application, try turning off hardware acceleration. If the artifact disappears, the problem might be with your video driver.  A value of 0 enables hardware acceleration.</pre> </span></div> </div> </div>http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/bd41ea92-dddb-498b-975a-61982f6d75ccBitMapImage constructed from Uri always has PixelWidth and PixelHeight of 1?2009-11-22T16:46:04Z2009-11-23T22:42:09ZDejasPerhttp://social.msdn.microsoft.com/Profile/en-US/?user=DejasPerHi,<br/> <br/> I tried initializing a BitMapImage to a graphic on the internet, however the graphic's width and height are not being respected by the BitMapImage.  For example, if I constructed a BitMapImage as:<br/> <br/> <pre lang="x-c#"> BitmapImage image = new BitmapImage(new Uri(&quot;http://www.google.com/intl/en_ALL/images/logo.gif&quot;)); </pre> The image.PixelWidth and imagePixelHeight properties are 1 even though the dimensions of that graphic are actually 276x110.  Is there a way to preserve the original dimensions when construction the image instance?<br/> <br/> Thankshttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/4c0be78c-1c18-4f4f-9572-9cb0962f1d9aListView with GridView Problem (Properties not being set?)2009-11-23T22:32:25Z2009-11-23T22:32:25ZChromeCompasshttp://social.msdn.microsoft.com/Profile/en-US/?user=ChromeCompassWhen I put my usercontrol into the listview gridview header, the properties defined in the tag don't get set.  When I use the same usercontrol outside of the header definition, it's fine.  <br/> <br/> An example here I made tries to set the background of the usercontrol &quot;MyControl&quot; to blue.  It does not succeed in the gridview header definition??<br/> <br/> <pre lang=x-xml>&lt;Window x:Class=&quot;ListViewTest.Window1&quot; xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot; xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot; xmlns:local=&quot;clr-namespace:ListViewTest&quot; Title=&quot;Window1&quot; Height=&quot;300&quot; Width=&quot;300&quot;&gt; &lt;Grid&gt; &lt;StackPanel&gt; &lt;TextBlock Text=&quot;Inside Of ListView GridView&quot; /&gt; &lt;ListView Name=&quot;ListView1&quot;&gt; &lt;ListView.View&gt; &lt;GridView&gt; &lt;GridView.Columns&gt; &lt;GridViewColumn Header=&quot;Values&quot; Width=&quot;150&quot;&gt; &lt;GridViewColumn.CellTemplate&gt; &lt;DataTemplate&gt; &lt;StackPanel&gt; &lt;TextBox Background=&quot;Red&quot; Width=&quot;100&quot;/&gt; &lt;local:MyControl Background=&quot;Blue&quot; Width=&quot;100&quot; /&gt; &lt;/StackPanel&gt; &lt;/DataTemplate&gt; &lt;/GridViewColumn.CellTemplate&gt; &lt;/GridViewColumn&gt; &lt;/GridView.Columns&gt; &lt;/GridView&gt; &lt;/ListView.View&gt; &lt;/ListView&gt; &lt;TextBlock Margin=&quot;0,15,0,0&quot; Text=&quot;Outside Of ListView GridView&quot; /&gt; &lt;TextBox Background=&quot;Red&quot; Width=&quot;100&quot;/&gt; &lt;local:MyControl Background=&quot;Blue&quot; Width=&quot;100&quot; /&gt; &lt;/StackPanel&gt; &lt;/Grid&gt; &lt;/Window&gt; </pre> <br/> <br/> <pre lang=x-xml>&lt;UserControl x:Class=&quot;ListViewTest.MyControl&quot; xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot; xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot; Height=&quot;20&quot; Width=&quot;300&quot; Background=&quot;Yellow&quot;&gt; &lt;Grid&gt; &lt;/Grid&gt; &lt;/UserControl&gt; </pre> <br/>http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/4c6d216a-0011-4202-aa7e-2fccef3cc355Determining which CustomPopupPlacement was used2009-11-23T21:58:13Z2009-11-23T21:58:13ZJohn Dunnhttp://social.msdn.microsoft.com/Profile/en-US/?user=John%20DunnI have a Popup which contains something that looks like a speech balloon - a rectangular area with a descender which points to the 'source' of the Popup. Using PlacementMode.Custom, I'm able to position my Popup so it either shows up on the upper right, or if there's not enough room to the right, the upper left. If the bubble is shown to the right, the descender is on the left. If the bubble is shown to the left the descender is drawn on the right. I have a DependecyProperty of my Balloon class which tells it where to draw the descender. The positioning is working without an problem - the issue is that I don't see a way to determine which CustomPopupPlacement was used when the CustomPopupPlacementCallback was called. If I had that information it would be trivial to set the DependencyProperty on the Balloon. Is there a way to get that information? Or another way to solve this problem?http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/143e88c6-090d-4b00-85ac-b4f529e2a1b4Multi-line label in window should resize2009-11-23T21:54:25Z2009-11-23T21:54:26Zz0nd0rhttp://social.msdn.microsoft.com/Profile/en-US/?user=z0nd0rHello,<br/> <br/> i have a WPF window and i'm using DockPanel for the layout. The window should fit its contents, so i put SizeToContent=&quot;WidthAndHeight&quot;.<br/> That window contains a multi-line label which docks at the bottom of the DockPanel (DockPanel.Dock=&quot;Bottom&quot;) and which contains a rather long text.<br/> I set the text of that label in the code behind as follows:<br/> <br/> <pre lang="x-c#">AccessText text = new AccessText(); text.Text = &quot;A rather long text.&quot;; text.TextWrapping = TextWrapping.WrapWithOverflow; this.lbl_description.Content = text;</pre> <br/> (In reality my window is more complex. I just want to focus on the problem i have.)<br/> <br/> Now i have to following problem:<br/> I want the window to have a width of 400 (so that the text wraps) and if i resize the window, the label should resize too.<br/> So that if i enlarge the window, the label enlarges too and vice versa.<br/> How can i do that?<br/> I tryed a lot of things, like setting the width of the window and/or the label and some other things, but nothing worked :/<br/> <br/> <br/> Regards<br/> z0nd0rhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/41ff86a1-9106-44ef-affd-dab8b5a3c1f6Bubbling Events not Occurring2009-11-18T22:26:17Z2009-11-23T21:33:45Zdtheesehttp://social.msdn.microsoft.com/Profile/en-US/?user=dtheeseHello All,<br/><br/>In the code below, I am seeing the tunneling events occurring but am not seeing the corresponding bubbling events occurring. Why might this be?<br/><br/><br/> <pre>&lt;Window x:Class=&quot;TestRoutedEvents.Window1&quot; xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot; xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot; Title=&quot;Window1&quot; Height=&quot;300&quot; Width=&quot;300&quot; PreviewMouseUp=&quot;Window_PreviewMouseUp&quot; MouseUp=&quot;Window_MouseUp&quot;&gt; &lt;Grid Background=&quot;Brown&quot; Margin=&quot;30&quot; PreviewMouseUp=&quot;Grid_PreviewMouseUp&quot; MouseUp=&quot;Grid_MouseUp&quot;&gt; &lt;TextBlock Text=&quot;Press me&quot; HorizontalAlignment=&quot;Center&quot; VerticalAlignment=&quot;Center&quot; Background=&quot;LightGray&quot; Padding=&quot;3&quot; PreviewMouseUp=&quot;TextBlock_PreviewMouseUp&quot; MouseUp=&quot;TextBlock_MouseUp&quot;/&gt; &lt;/Grid&gt; &lt;/Window&gt; </pre> <br/><br/><br/><br/> <pre>namespace TestRoutedEvents { /// &lt;summary&gt; /// Interaction logic for Window1.xaml /// &lt;/summary&gt; public partial class Window1 : Window { public Window1() { InitializeComponent(); } private void TextBlock_PreviewMouseUp(object sender, MouseButtonEventArgs e) { MessageBox.Show(&quot;TextBlock_PreviewMouseUp&quot;); } private void Grid_PreviewMouseUp(object sender, MouseButtonEventArgs e) { MessageBox.Show(&quot;Grid_PreviewMouseUp&quot;); } private void Window_PreviewMouseUp(object sender, MouseButtonEventArgs e) { MessageBox.Show(&quot;Window_PreviewMouseUp&quot;); } private void TextBlock_MouseUp(object sender, MouseButtonEventArgs e) { MessageBox.Show(&quot;TextBlock_MouseUp&quot;); } private void Grid_MouseUp(object sender, MouseButtonEventArgs e) { MessageBox.Show(&quot;Grid_MouseUp&quot;); } private void Window_MouseUp(object sender, MouseButtonEventArgs e) { MessageBox.Show(&quot;Window_MouseUp&quot;); } } } </pre> <br/><br/><br/>Thanks,<br/>Dave<br/>http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/ac9e74d4-1dc5-4028-b3cf-398b9559936aButton on WPF Dialog Window erroneously causing DialogResult.Ok to fire...2009-11-20T20:00:25Z2009-11-23T21:32:34ZBruCruhttp://social.msdn.microsoft.com/Profile/en-US/?user=BruCruI have created a window class that displays on ShowDialog code from another window.  I have a button on window that fires code to add some data to a datagrid.  However, once the code executes it returns execution back to the parent window with a Null result.  I do not wish to exit or terminate the window at this time.  How do I stop this from occurring?<br/><br/>Chrishttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/c924073e-2d4e-431e-b4ca-674ce8695454Hiding Focus Selection of the object when it is hidden in a storyboard?2009-11-19T00:09:07Z2009-11-23T21:20:46Zvladc77http://social.msdn.microsoft.com/Profile/en-US/?user=vladc77I am wondering if there is a solution to hide a focus selection of a hyperlink which initiated by using tab key (focus selection) when the animation hided that hyperlink. Now, after the animation hidded the hyperlink the selection line of the focus is staying in the place of the hyperlink. I assigned 'collapsed' property to the hyperlink and it did not help. <br/>Any ideas? <br/>Thank you in advance.http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/1096dd0f-8cee-4ca1-a059-164c1c83e0a4UserControl not clipping first added visual2009-11-23T20:48:58Z2009-11-23T20:49:00ZJeff Braunhttp://social.msdn.microsoft.com/Profile/en-US/?user=Jeff%20BraunSo I'm writing a new UserControl that has an internal VisualCollection object and I've overridden the GetVisualChild and VisualChildrenCount methods.  When I add the visual objects in my UserControl constructor, I set the visuals ClipToBounds=True.  However, the very first visual isn't getting clipped for some odd reason.<br/><br/>Why would the very first added visual not get clipped but all other visuals added later would be?http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/eff2deeb-a769-40cd-950d-8df60d01cd63Borderless WPF Window Flashes when Taskbar is docked on top2009-11-23T11:52:04Z2009-11-23T19:59:43Zhijackerhttp://social.msdn.microsoft.com/Profile/en-US/?user=hijackerGreetings my friends! I've got a HUGE problem, let's see who will be able to help me. <div><br/></div> <div>I have a borderless window, and when you maximize this window it fills out the screen available space. So far so good.</div> <div>The problem happens after you maximized the window, and moved the taskbar docking position to TOP, the borderless window starts flashing till it crashes. When it flashes all you can see are white stripes generated on the screen.</div> <div><br/></div> <div>Since we can't attach anything within this post, if you wanna see some print screens showing how the problem behaves, enter this url:</div> <div><a href="http://cid-44e7950c87d54827.skydrive.live.com/browse.aspx/SOCIAL">http://cid-44e7950c87d54827.skydrive.live.com/browse.aspx/SOCIAL</a></div> <div><br/></div> <div>Please, if anybody knows why this happens or how to solve this issue, let me know.</div> <div><br/></div> <div>Thanks in advance.</div> <div><br/></div> <div>H1·J4CK3R</div> <hr class=sig> Thnx !http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/86c30ccc-b66f-46e9-ba16-e108b2ed5ffbUnable to Get Element Inside DataTemplate2009-11-03T23:44:52Z2009-11-23T19:35:17ZVintageDeveloperhttp://social.msdn.microsoft.com/Profile/en-US/?user=VintageDeveloperI read through the &quot;WPF XAML Namespaces&quot; article at http://msdn.microsoft.com/en-us/library/ms746659.aspx so I thought I understood the namescoping issues involved in obtaining elements inside templates, but I am still unable to get it to work.<br/> <br/> For instance, I have the following deliberately-simplistic XAML which creates a TabControl and a Button under it. The TabControl’s resources include a DataTemplate, intended for use with TabItems. When the Button is clicked, it should add a new TabItem, templated on the DataTemplate, to the TabControl:<br/> <br/> <br/> <pre lang=x-xml>&lt;Window x:Class=&quot;Test.wndMain&quot; xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot; xmlns:src=&quot;clr-namespace:Test&quot; xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot; Height=&quot;300&quot; Width=&quot;300&quot;&gt; &lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height=&quot;4*&quot;/&gt; &lt;RowDefinition Height=&quot;*&quot;/&gt; &lt;/Grid.RowDefinitions&gt; &lt;TabControl Grid.Row=&quot;0&quot; Name=&quot;ctrlTab_Room&quot;&gt; &lt;TabControl.Resources&gt; &lt;DataTemplate x:Key=&quot;templTab_Cabinet&quot;&gt; &lt;TextBlock Name=&quot;txtCup&quot;/&gt; &lt;/DataTemplate&gt; &lt;/TabControl.Resources&gt; &lt;/TabControl&gt; &lt;Button Grid.Row=&quot;1&quot; Name=&quot;btnAddNewCabinet&quot; Click=&quot;btnAddNewCabinet_Click&quot; Content=&quot;Add New Cabinet&quot;/&gt; &lt;/Grid&gt; &lt;/Window&gt;</pre> <br/> <br/> Now, I have a Cabinet.cs class file which defines the bare-bones Cabinet class:<br/> <br/> <br/> <pre lang="x-c#">using System; namespace Test { class Cabinet { } }</pre> <br/> <br/> <br/> And in the code-behind for the window, I have (the code is roughly based on and modified from Microsoft’s own example code given at http://msdn.microsoft.com/en-us/library/system.windows.frameworktemplate.findname.aspx):<br/> <br/> <br/> <pre lang="x-c#">using System; using System.Windows; // Necessary for windows using System.Windows.Controls; // Necessary for controls using System.Windows.Media; // Necessary for VisualTreeHelper namespace Test { public partial class wndMain : Window { public wndMain() { InitializeComponent(); } private void btnAddNewCabinet_Click(object objSender, RoutedEventArgs args) { // Create cabinet tab TabItem tabCabinet_New = new TabItem(); tabCabinet_New.ContentTemplate = (DataTemplate)ctrlTab_Room.FindResource(&quot;templTab_Cabinet&quot;); tabCabinet_New.Content = new Cabinet(); // Get cup in cabinet tabCabinet_New.ApplyTemplate(); ContentPresenter objContentPresenter = FindVisualChild&lt;ContentPresenter&gt;(tabCabinet_New); DataTemplate templTab_Cabinet = objContentPresenter.ContentTemplate; TextBlock txtCup = (TextBlock)(templTab_Cabinet. FindName(&quot;txtCup&quot;, objContentPresenter)); txtCup.Text = &quot;foobar&quot;; // Add cabinet to room ctrlTab_Room.Items.Add(tabCabinet_New); } private childItem FindVisualChild&lt;childItem&gt;(DependencyObject obj) where childItem : DependencyObject { for (int i = 0; i &lt; VisualTreeHelper.GetChildrenCount(obj); i++) { DependencyObject child = VisualTreeHelper.GetChild(obj, i); if (child != null &amp;&amp; child is childItem) return (childItem)child; else { childItem childOfChild = FindVisualChild&lt;childItem&gt;(child); if (childOfChild != null) return childOfChild; } } return null; } } }</pre> <br/> <br/> <br/> When I run this and try to click the button, I get a NullReferenceException at the FindName() line in the button handler because templTab_Cabinet is null. I tried changing the<br/> <br/> <br/> <pre lang="x-c#">DataTemplate templTab_Cabinet = objContentPresenter.ContentTemplate;</pre> <br/> <br/> line to:<br/> <br/> <br/> <pre lang="x-c#">DataTemplate templTab_Cabinet = tabCabinet_New.ContentTemplate;</pre> <br/> <br/> or to:<br/> <br/> <br/> <pre lang="x-c#">DataTemplate templTab_Cabinet = (DataTemplate)(ctrlTab_Room.FindResource(&quot;templTab_Cabinet&quot;));</pre> <br/> <br/> instead, but either way instead gets me an InvalidOperationException (&quot;This operation is valid only on elements that have this template applied.&quot;) on the FindName() line.<br/> <br/> How can I get this to work? What am I doing wrong? Thanks in advance.<br/>http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/a2af3dc4-00b7-49a3-819f-fb562db33348 Converter question?2009-11-23T01:13:20Z2009-11-23T19:28:15ZZest4Questhttp://social.msdn.microsoft.com/Profile/en-US/?user=Zest4Quest<p>I am using An Observable collection of custom type as the DataContext of a MenuItem and then through  binding i have set one of the properties which is a collection in my CustomType to be set as ItemsSource to display a subMenu of Items.Now that works fine. The requirement is that when the user selects one item in the submenu i have a string property in the CustomType that needs to be set with the Header of SubMenu..and when the user opens the menu again i want that item to be checked by comparing the Header name with the &quot;SelectedHeader&quot; property on my custom type... Could someone tell me how to achieve this? I have spent too much time trying to figure this out... <br/>Thanks in Advance...</p>http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/99f9547d-9e23-4717-ae68-b636a3dd9f5bDefining triangles in MeshGeometry2009-11-20T16:44:26Z2009-11-23T19:13:07Zjoenunshttp://social.msdn.microsoft.com/Profile/en-US/?user=joenunsHello all!<br/> <br/> My question is: How are the vertices and triangles defined in WPF ? I thought I could specify a &quot;cloud&quot; of vertices and then make the triangles by assigning the indexes. I see that i need to define the vertices as triangles, so for complex objects i have to repeat several of them. Is that true ? I have a model which has ~90 vertices in Blender, but in WPF has more than 900 :S ... this has to be that way ?<br/> <br/> I hope to hear from you soon<br/> <br/> Best regards,<br/> <br/> Jose'http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/07408b1c-55e1-41dc-9622-9d8f5b6666ccWpf Ribbon:2009-11-23T16:51:03Z2009-11-23T18:56:18ZMarcoABhttp://social.msdn.microsoft.com/Profile/en-US/?user=MarcoAB<br/>I downloaded the VS2010 Beta2 and I discovered that Ribbon control isn't in WPF 4.0.<br/>I have working with Codeplex Ribbon since last year and I expected to find it in the<br/>next version of Visual Studio as now I find the DataGrid...<br/><br/>What is the reason of this fact ?<br/>Can anybody explain the Microsoft strategy about the Wpf Ribbon ?<br/><br/>Thank you very much<br/>Marco<hr class="sig">MarcoABhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/a14cf732-0c61-4dea-a60d-48a52d419a3bMultibinding Problem2009-11-23T18:55:04Z2009-11-23T18:55:05ZMayrunDhttp://social.msdn.microsoft.com/Profile/en-US/?user=MayrunDHey<br/> <br/> I have an XmlDataProvider that refers to an XML file and a specific node, and a TextBlock which it's Text property is bind to an element.<br/> So far so good, everything works and I can see the element's value in the TextBlock.<br/> <br/> What I'm trying to do is to forward that value into a method that will return me a string value that I have to pass into an Image control.<br/> <br/> So I added an ObjectDataProvider that is bind to a method and a <span style="text-decoration:underline">OneWayToSource</span> binding to the TextBlock, and finally made sure that the Image control's Source property would be bind to the ObjectDataProvider.<br/> <br/> But for some reason this is not working propertly, I've been trying to figure it out for few hours without any success.<br/> <br/> Please your advice.<br/> <br/> <pre> &lt;XmlDataProvider x:Key=&quot;xmlProvider&quot; XPath=&quot;/Posts/Post[1]&quot; IsAsynchronous=&quot;False&quot; IsInitialLoadEnabled=&quot;True&quot; Source=&quot;C:\posts.xml&quot; /&gt; &lt;ObjectDataProvider ObjectType=&quot;{x:Type local:SPProfileQuery}&quot; MethodName=&quot;GetPictureByDisplayName&quot; x:Key=&quot;odp1&quot;&gt; &lt;ObjectDataProvider.MethodParameters&gt; &lt;/ObjectDataProvider.MethodParameters&gt; &lt;/ObjectDataProvider&gt; &lt;Image x:Name=&quot;imgUser&quot; Source=&quot;{Binding Source={StaticResource odp1}}&quot;/&gt; &lt;TextBlock x:Name=&quot;tbPostUserName&quot;&gt; &lt;TextBlock.Text&gt; &lt;MultiBinding StringFormat=&quot;{}{0}&quot; UpdateSourceTrigger=&quot;PropertyChanged&quot;&gt; &lt;Binding Source=&quot;{StaticResource xmlProvider}&quot; XPath=&quot;Author&quot; Mode=&quot;OneWay&quot;&gt;&lt;/Binding&gt; &lt;Binding Source=&quot;{StaticResource odp1}&quot; Path=&quot;MethodParameters[0]&quot; BindsDirectlyToSource=&quot;True&quot; Mode=&quot;OneWayToSource&quot; UpdateSourceTrigger=&quot;PropertyChanged&quot;/&gt; &lt;/MultiBinding&gt; &lt;/TextBlock.Text&gt; &lt;/TextBlock&gt;</pre>http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/3fd23613-6f1d-4ae6-a279-b99d6fdbc374DataTrigger Binding on DataType2009-10-09T21:52:06Z2009-11-23T18:50:21ZNick Leuchtenberghttp://social.msdn.microsoft.com/Profile/en-US/?user=Nick%20Leuchtenberg<div>Anyone know why the below DataTrigger doesn't work? &nbsp;I get a XamlParseException (Must specify both Binding and Value for DataTrigger):</div> <div><br /></div> <div>&lt;DataTrigger Binding="{Binding MainWindow.Host.ControlType, ElementName=userControl}" Value="{x:Type ui:ProjectSearchControl}"&gt;</div> <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;Setter Property="Visibility" Value="Collapsed"/&gt;</div> <div>&lt;/DataTrigger&gt;</div><hr class="sig">Nick Leuchtenberg - Software Developer, Morton Buildings, Inc.http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/e7f2e5e6-c598-4253-b6e3-4ab9aa6f319bPresentationHost crashing on any XBAP2009-11-17T11:00:51Z2009-11-23T18:12:28ZWouter Demuynckhttp://social.msdn.microsoft.com/Profile/en-US/?user=Wouter%20Demuynck<p>We have a client PC on which PresentationHost.exe crashes upon launching <strong>any</strong> XBAP application.<br/><br/>For example: <a href="http://weathernews.com/wpfglobal.xbap">http://weathernews.com/wpfglobal.xbap</a><br/><br/>The client pc has McAfee anti-virus installed. We suspect that this is the cause, but cannot disable the program to test.<br/><br/>The XBAP deployment error is listed below:<br/><br/>--------------------------<br/><br/>PLATFORM VERSION INFO<br/> Windows    : 5.1.2600.196608 (Win32NT)<br/> Common Language Runtime  : 2.0.50727.3603<br/> System.Deployment.dll   : 2.0.50727.3053 (netfxsp.050727-3000)<br/> mscorwks.dll    : 2.0.50727.3603 (GDR.050727-3600)<br/> dfshim.dll    : 2.0.50727.3053 (netfxsp.050727-3000)</p> <p>SOURCES<br/> Deployment url   : <a>file:///C:/Documents%20and%20Settings/id080426/Local%20Settings/Temporary%20Internet%20Files/Content.IE5/GN30HU1G/wpfglobal%5B1%5D.xbap</a></p> <p>IDENTITIES<br/> Deployment Identity  : wpfglobal.application, Version=1.1.10.0, Culture=neutral, PublicKeyToken=703b1573bd1c2389, processorArchitecture=msil</p> <p>APPLICATION SUMMARY<br/> * Online only application.</p> <p>ERROR SUMMARY<br/> Below is a summary of the errors, details of these errors are listed later in the log.<br/> * An exception occurred while downloading the manifest. Following failure messages were detected:<br/>  + Downloading <a>file:///C:/Documents</a> and Settings/id080426/Local Settings/Temporary Internet Files/Content.IE5/GN30HU1G/wpfglobal.exe.manifest did not succeed.<br/>  + Could not find file 'C:\Documents and Settings\id080426\Local Settings\Temporary Internet Files\Content.IE5\GN30HU1G\wpfglobal.exe.manifest'.<br/>  + Could not find file 'C:\Documents and Settings\id080426\Local Settings\Temporary Internet Files\Content.IE5\GN30HU1G\wpfglobal.exe.manifest'.<br/>  + Could not find file 'C:\Documents and Settings\id080426\Local Settings\Temporary Internet Files\Content.IE5\GN30HU1G\wpfglobal.exe.manifest'.</p> <p>COMPONENT STORE TRANSACTION FAILURE SUMMARY<br/> No transaction error was detected.</p> <p>WARNINGS<br/> There were no warnings during this operation.</p> <p>OPERATION PROGRESS STATUS<br/> No phase information is available.</p> <p>ERROR DETAILS<br/> Following errors were detected during this operation.<br/> * [17/11/2009 10:34:59] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)<br/>  - Downloading <a>file:///C:/Documents</a> and Settings/id080426/Local Settings/Temporary Internet Files/Content.IE5/GN30HU1G/wpfglobal.exe.manifest did not succeed.<br/>  - Source: System.Deployment<br/>  - Stack trace:<br/>   at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)<br/>   at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()<br/>   at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)<br/>   at System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri&amp; sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ServerInformation&amp; serverInformation)<br/>   at System.Deployment.Application.DownloadManager.DownloadManifest(Uri&amp; sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ManifestType manifestType, ServerInformation&amp; serverInformation)<br/>   at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri&amp; appSourceUri, String&amp; appManifestPath)<br/>   at System.Deployment.Application.DeploymentManager.BindCore(Boolean blocking, TempFile&amp; tempDeploy, TempDirectory&amp; tempAppDir, FileStream&amp; refTransaction, String&amp; productName)<br/>   at System.Deployment.Application.DeploymentManager.BindAsyncWorker()<br/>  --- Inner Exception ---<br/>  System.Net.WebException<br/>  - Could not find file 'C:\Documents and Settings\id080426\Local Settings\Temporary Internet Files\Content.IE5\GN30HU1G\wpfglobal.exe.manifest'.<br/>  - Source: System<br/>  - Stack trace:<br/>   at System.Net.FileWebRequest.EndGetResponse(IAsyncResult asyncResult)<br/>   at System.Net.FileWebRequest.GetResponse()<br/>   at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)<br/>  --- Inner Exception ---<br/>  System.Net.WebException<br/>  - Could not find file 'C:\Documents and Settings\id080426\Local Settings\Temporary Internet Files\Content.IE5\GN30HU1G\wpfglobal.exe.manifest'.<br/>  - Source: System<br/>  - Stack trace:<br/>   at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)<br/>   at System.Net.FileWebRequest.GetResponseCallback(Object state)<br/>  --- Inner Exception ---<br/>  System.IO.FileNotFoundException<br/>  - Could not find file 'C:\Documents and Settings\id080426\Local Settings\Temporary Internet Files\Content.IE5\GN30HU1G\wpfglobal.exe.manifest'.<br/>  - Source: mscorlib<br/>  - Stack trace:<br/>   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)<br/>   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)<br/>   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)<br/>   at System.Net.FileWebStream..ctor(FileWebRequest request, String path, FileMode mode, FileAccess access, FileShare sharing, Int32 length, Boolean async)<br/>   at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)</p> <p>COMPONENT STORE TRANSACTION DETAILS<br/> No transaction information is available.<br/><br/>---------------------------------------</p> <p><br/>It's odd that the deployment URL lists a local path instead of <a href="http://.../">http://.../</a> as well<br/><br/>Any ideas?<br/></p>http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/39676bc4-ab83-4b3f-93b2-a7fe3f30dcd6ListView ContentPresenter does not scale correctly2009-08-27T13:52:52Z2009-11-23T17:57:58Zpaulsinnemahttp://social.msdn.microsoft.com/Profile/en-US/?user=paulsinnemaHi,<br/><br/>We use a ListView for displaying Custom Controls that bind to a list of Items. In our project it is called KLIBEditableListView. In the Theme we've added a Template for this Control.<br/><br/> <div style="background-color:white;color:black"> <pre> <span style="color:blue">&lt;!--</span><span style="color:green"> KLIB Editable ListView Template</span><span style="color:blue">--&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">ControlTemplate</span> <span style="color:red">x:Key</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">KLIBEditableListViewControlTemplate</span><span style="color:black">&quot;</span> <span style="color:red">TargetType</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">{x:Type sc:KLIBEditableListView}</span><span style="color:black">&quot;</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">Grid</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">Grid.ColumnDefinitions</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBColumnDefinition</span> <span style="color:red">Width</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">*</span><span style="color:black">&quot;</span> <span style="color:blue">/&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBColumnDefinition</span> <span style="color:red">Width</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">auto</span><span style="color:black">&quot;</span> <span style="color:blue">/&gt;</span> <span style="color:blue">&lt;/</span><span style="color:#a31515">Grid.ColumnDefinitions</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">Grid.RowDefinitions</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBRowDefinition</span> <span style="color:red">Height</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">auto</span><span style="color:black">&quot;</span> <span style="color:blue">/&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBRowDefinition</span> <span style="color:red">Height</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">10</span><span style="color:black">&quot;</span> <span style="color:blue">/&gt;</span> <span style="color:blue">&lt;/</span><span style="color:#a31515">Grid.RowDefinitions</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBBorder</span> <span style="color:red">BorderBrush</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Gray</span><span style="color:black">&quot;</span> <span style="color:red">BorderThickness</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">1</span><span style="color:black">&quot;</span> <span style="color:red">CornerRadius</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">7</span><span style="color:black">&quot;</span> <span style="color:red">Padding</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">1</span><span style="color:black">&quot;</span> <span style="color:red">Background</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">White</span><span style="color:black">&quot;</span> <span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBBorder.ContextMenu</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBContextMenu</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBMenuItem</span> <span style="color:red">Header</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Insert</span><span style="color:black">&quot;</span> <span style="color:red">Command</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Paste</span><span style="color:black">&quot;</span> <span style="color:blue">/&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBMenuItem</span> <span style="color:red">Header</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Add</span><span style="color:black">&quot;</span> <span style="color:red">Command</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">cl:Commands.AddItemCommand</span><span style="color:black">&quot;</span> <span style="color:blue">/&gt;</span> <span style="color:blue">&lt;/</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBContextMenu</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;/</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBBorder.ContextMenu</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBItemsPresenter</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBItemsPresenter.ContextMenu</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBContextMenu</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBMenuItem</span> <span style="color:red">Header</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Cut</span><span style="color:black">&quot;</span> <span style="color:red">Command</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Cut</span><span style="color:black">&quot;</span> <span style="color:blue">/&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBMenuItem</span> <span style="color:red">Header</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Copy</span><span style="color:black">&quot;</span> <span style="color:red">Command</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Copy</span><span style="color:black">&quot;</span> <span style="color:blue">/&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBMenuItem</span> <span style="color:red">Header</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Paste</span><span style="color:black">&quot;</span> <span style="color:red">Command</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Paste</span><span style="color:black">&quot;</span> <span style="color:blue">/&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBMenuItem</span> <span style="color:red">Header</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Delete</span><span style="color:black">&quot;</span> <span style="color:red">Command</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Delete</span><span style="color:black">&quot;</span> <span style="color:blue">/&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBMenuItem</span> <span style="color:red">Header</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Add</span><span style="color:black">&quot;</span> <span style="color:red">Command</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">cl:Commands.AddItemCommand</span><span style="color:black">&quot;</span> <span style="color:blue">/&gt;</span> <span style="color:blue">&lt;/</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBContextMenu</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;/</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBItemsPresenter.ContextMenu</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;/</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBItemsPresenter</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;/</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBBorder</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBStackPanel</span> <span style="color:red">Grid.Row</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">0</span><span style="color:black">&quot;</span> <span style="color:red">Grid.Column</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">1</span><span style="color:black">&quot;</span> <span style="color:red">Orientation</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Horizontal</span><span style="color:black">&quot;</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBButton</span> <span style="color:red">Name</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">AddButton</span><span style="color:black">&quot;</span> <span style="color:red">IsTabStop</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">True</span><span style="color:black">&quot;</span> <span style="color:red">VerticalAlignment</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Bottom</span><span style="color:black">&quot;</span> <span style="color:red">Width</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">25</span><span style="color:black">&quot;</span> <span style="color:red">Command</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">cl:Commands.AddItemCommand</span><span style="color:black">&quot;</span> <span style="color:red">Visibility</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">{TemplateBinding CanAdd, Converter={StaticResource BooleanToVisibility}}</span><span style="color:black">&quot;</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBImage</span> <span style="color:red">Source</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">{StaticResource ImagePlusSign}</span><span style="color:black">&quot;</span> <span style="color:red">Height</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">15</span><span style="color:black">&quot;</span> <span style="color:blue">/&gt;</span> <span style="color:blue">&lt;/</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBButton</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;/</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBStackPanel</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;/</span><span style="color:#a31515">Grid</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;/</span><span style="color:#a31515">ControlTemplate</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">Style</span> <span style="color:red">x:Key</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">{x:Type sc:KLIBEditableListView}</span><span style="color:black">&quot;</span> <span style="color:red">TargetType</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">{x:Type sc:KLIBEditableListView}</span><span style="color:black">&quot;</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">Setter</span> <span style="color:red">Property</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Template</span><span style="color:black">&quot;</span> <span style="color:red">Value</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">{DynamicResource KLIBEditableListViewControlTemplate}</span><span style="color:black">&quot;</span><span style="color:blue">/&gt;</span> <span style="color:blue">&lt;/</span><span style="color:#a31515">Style</span><span style="color:blue">&gt;</span> </pre> </div> <br/>Here's (part of the XAML) in the Mask.<br/><br/> <div style="background-color:white;color:black"> <pre> <span style="color:blue">&lt;</span><span style="color:#a31515">ad</span><span style="color:blue">:</span><span style="color:#a31515">KLIBAddressBaseData</span> <span style="color:red">Background</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Green</span><span style="color:black">&quot;</span> <span style="color:red">Grid.Row</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">3</span><span style="color:black">&quot;</span> <span style="color:red">Grid.Column</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">1</span><span style="color:black">&quot;</span> <span style="color:red">Grid.ColumnSpan</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">2</span><span style="color:black">&quot;</span><span style="color:blue">/&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBDockPanel</span> <span style="color:red">Grid.Row</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">4</span><span style="color:black">&quot;</span> <span style="color:red">Grid.Column</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">0</span><span style="color:black">&quot;</span> <span style="color:red">LastChildFill</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">False</span><span style="color:black">&quot;</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBHistoryToggler</span> <span style="color:red">x:Name</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">AddressToggler</span><span style="color:black">&quot;</span> <span style="color:red">DockPanel.Dock</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Top</span><span style="color:black">&quot;</span> <span style="color:red">IsChecked</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">False</span><span style="color:black">&quot;</span><span style="color:blue">/&gt;</span> <span style="color:blue">&lt;/</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBDockPanel</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBEditableListView</span> <span style="color:red">x:Name</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Address</span><span style="color:black">&quot;</span> <span style="color:red">Grid.Row</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">4</span><span style="color:black">&quot;</span> <span style="color:red">Grid.Column</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">1</span><span style="color:black">&quot;</span> <span style="color:red">Grid.ColumnSpan</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">2</span><span style="color:black">&quot;</span> <span style="color:red">IsSynchronizedWithCurrentItem</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">True</span><span style="color:black">&quot;</span> <span style="color:red">Header</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Address</span><span style="color:black">&quot;</span> <span style="color:red">IsHistoryVisible</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">{Binding Path=IsChecked, ElementName=AddressToggler}</span><span style="color:black">&quot;</span> <span style="color:red">ItemsSource</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">{Binding Path=VMEntity.AddressValidItems}</span><span style="color:black">&quot;</span> <span style="color:red">VerticalAlignment</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Bottom</span><span style="color:black">&quot;</span> <span style="color:red">ItemFactory</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">{Binding Path=VMEntity.ContactAddressFactory}</span><span style="color:black">&quot;</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBEditableListView.View</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBGridView</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBGridViewColumn</span> <span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">GridViewColumn.CellTemplate</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">DataTemplate</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;</span><span style="color:#a31515">ad</span><span style="color:blue">:</span><span style="color:#a31515">KLIBAddressBaseData</span> <span style="color:red">Background</span><span style="color:blue">=</span><span style="color:black">&quot;</span><span style="color:blue">Red</span><span style="color:black">&quot;</span><span style="color:blue">/&gt;</span> <span style="color:blue">&lt;/</span><span style="color:#a31515">DataTemplate</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;/</span><span style="color:#a31515">GridViewColumn.CellTemplate</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;/</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBGridViewColumn</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;/</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBGridView</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;/</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBEditableListView.View</span><span style="color:blue">&gt;</span> <span style="color:blue">&lt;/</span><span style="color:#a31515">sc</span><span style="color:blue">:</span><span style="color:#a31515">KLIBEditableListView</span><span style="color:blue">&gt;</span> </pre> </div> We've got a problem with scaling. In the Image below you can see the Custom Control outside the ListView (Green) and inside the ListView (Red). Both should scale the same but they don't. It seems that the Content of the ListView does not scale exactly the same as it does outside the ListView. Somehow the Content is not allowed to grow to the full width of the ItemPresenter. The ItemPresenter itself has the full size but it's content does not.<br/><br/><br/><img src="http://www.sinnema.ch/Diartis/ListViewProblem.png" alt=""><br/><br/><br/>Who can tell us what is wrong in the code above. There is no code in the code-behind that has influence on the width of the Controls.<br/><br/>Regards,<br/>Paul Sinnema. <hr class=sig> Take a look at my blog: <a href="http://paul.sinnema.ch">http://paul.sinnema.ch</a>