I have a listbox data template in WPF. I want one item to be tight against the left side of the listbox and another item to be tight against the right side, but I can't figure out how to do this.
So far I have a grid with three columns, the left and right ones have content and the center is a placeholder with it's width set to "*". Wher...
In WPF, we are creating custom controls that inherit from button with completely drawn-from-scratch xaml graphics. We have a border around the entire button xaml and we'd like to use that as the location for updating the background when MouseOver=True in a trigger. What we need to know is how do we update the background of the border i...
Hi
We are using the standard method for our controls to report broken BO rules. This is done via the interface IDataError in our BO’s and in XAML the control is bound to the BO’s property etc. This approach works OK. But we need to show 2 types of visuals in the UI depending on the type (or category if you like) of the invalidation erro...
I want to make the text displayed in the Witty, an open source Twitter client, selectable. It is currently displayed using a custom textblock. I need to use a TextBlock because I'm working with the textblock's inlines to display and format the @username and links as hyperlinks. A frequent request is to be able to copy-paste the text. In...
I'm learning WPF, and I'd love to see some good WPF training videos.
I would bet there have been some great user group presentations or conference talks that have been recorded, so please submit or vote on your favorite.
...
I have a Window where I have put a Frame. I would like to add a Page to the Frame when I click a button that is also on the Window but not in the Frame. There are several buttons in the Window and each click on a button should load a different Page in the Frame.
Since I'm a total newbie on this WPF stuff it's quite possible that this ap...
In WPF, I want to create a hyperlink that navigates to the details of an object, and I want the text of the hyperlink to be the name of the object. Right now, I have this:
<TextBlock><Hyperlink Command="local:MyCommands.ViewDetails" CommandParameter="{Binding}">Object Name</Hyperlink></TextBlock>
But I want "Object Name" to be bound t...
Is there a way to add a resource to a ResourceDictionary from code without giving it a resource key?
For instance, I have this resource in XAML:
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type xbap:FieldPropertyInfo}"
ItemsSource="{Binding Path=Value.Values}">
<TextBlock Text="{Binding Path=Name...
What is the best way to specify a property name when using INotifyPropertyChanged?
Most examples hardcode the property name as an argument on the PropertyChanged Event. I was thinking about using MethodBase.GetCurrentMethod.Name.Substring(4) but am a little uneasy about the reflection overhead.
...
I have a simple message box in a WPF application that is launched as below:
private void Button_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("Howdy", "Howdy");
}
I can get white to click my button and launch the message box.
UISpy shows it as a child of my window I couldn't work out the method to access it.
How do ...
We use a grid control from Infragistics at work. Are there others? Pay or free?
...
For the most part you just take whatever Visual Studio sets it for you as a default.. I'm referring to the BuildAction Property for each file selected in your solution explorer. There are a number of options and its difficult to know what each one of them will do.
...
I need to change the DataTemplate for items in a ListBox depending on whether the item is selected or not (displaying different/more information when selected).
I don't get a GotFocus/LostFocus event on the top-most element in the DataTemplate (a StackPanel) when clicking the ListBox item in question (only through tabbing), and I'm out ...
I'm running into an unusual problem in my unit tests. The class I'm testing creates a dependency property dynamically at runtime and the type of that dependency property can vary depending on the circumstances. While writing my unit tests, I need to create the dependency property with different types and that leads to errors because you ...
Under the View-Model-ViewModel pattern for WPF, I am trying to databind the Heights and Widths of various definitions for grid controls, so I can store the values the user sets them to after using a GridSplitter. However, the normal pattern doesn't seem to work for these particular properties.
Note: I'm posting this as a reference quest...
I've got the following user control:
<TabItem
x:Name="Self"
x:Class="App.MyTabItem"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:app="clr-namespace:App"
>
<TabItem.Header>
<!-- This works -->
<TextBlock Text="{B...
I'm benchmarking a WPF application on various platforms and I need an easy way to determine if WPF is using hardware or software rendering.
I seem to recall a call to determine this, but can't lay my hands on it right now.
Also, is there an easy, code based way to force one rendering pipeline over the other?
...
I'm using a WPF MediaElement to render HD video in an application. When the size of the MediaElement gets over about 300 units square the video stutters and the computer is nearly totally unresponsive. I need to render the video full screen.
Has anybody had success rendering fullscreen video using the WPF MediaElement?
What were the ...
I have a defined MenuItem that I would like to share between two different menus on one page. The menu contains functionallity that is the same between both menus and I do not want two copies of it. Is there anyway to define a MenuItem in the Page.Resources and reference it in the ContextMenu XAML below?
<Page.Resources>
<MenuItem x...
The project I'm working on needs to render an ESRI shape file, which can have a large number of polygons/shapes. When I add all these polygons, lines, points, etc to the canvas I'm using, it gets really slow.
To draw the shapes on the map, I'm creating a Path object, and setting it's Data property to a StreamGeometry. I originally use...