Difference between Control Template and DataTemplate in WPF
What is difference between a ControlTemplate and a DataTemplate in WPF? 7 Answers 7
What is difference between a ControlTemplate and a DataTemplate in WPF? 7 Answers 7
I have a list (see below) contained in a window. The window’s DataContext has two properties, Items and AllowItemCommand. How do I get the binding for the Hyperlink‘s Command property needs to resolve against the window’s DataContext? <ListView ItemsSource=”{Binding Items}”> <ListView.View> <GridView> <GridViewColumn Header=”Action”> <GridViewColumn.CellTemplate> <DataTemplate> <StackPanel> <TextBlock> <!– this binding is not working –> … Read more
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for … Read more
What I am trying to do is show a window, that does not explicitly have a height/width, (both values omitted or set to Auto). I was guessing that the window would find out its size by auto – calculating all contained usercontrols sizes, but this doesn’t actually work! Instead I get a big window with … Read more
I’m currently using the TextBlock below to bind the value of a property named Name: <TextBlock Text=”{Binding Name}” /> Now, I want to bind another property named ID to the same TextBlock. Is it possible to bind two or more values to the same TextBlock? Can it be done with simple concatenation, like Name + … Read more
How do I assign vertical center alignment to the text inside a TextBlock? I found TextAlignment property but it is for horizontal text alignment. How do I do it for vertical text alignment? 16 Answers 16
How to allow TextBlock‘s text to be selectable? I tried to get it to work by displaying the text using a read-only TextBox styled to look like a textblock but this will not work in my case because a TextBox does not have inlines. In other words, how to make it selectable? 18 Answers 18
Creating a relatively simple data entry form, and just want to separate certain sections with a horizontal line (not unlike an HR tag in HTML) that stretches the full length of the form. I have tried this: <Line Stretch=”Fill” Stroke=”Black” X2=”1″/> Because the parent control is not a fixed width, this line causes the window … Read more
I need to search a WPF control hierarchy for controls that match a given name or type. How can I do this? 20 Answers 20
I want the user to select a directory where a file that I will then generate will be saved. I know that in WPF I should use the OpenFileDialog from Win32, but unfortunately the dialog requires file(s) to be selected – it stays open if I simply click OK without choosing one. I could “hack … Read more