I'm looking into creating custom controls for WPF and I've found some reasonably useful blogs and such that vaguely go into enough detail but I'm still struggling a bit.
Basically, what I'm trying to create is something akin to the infamous 'Coda Slider' but i just don't know enough to get started properly. Can anyone either point me i...
We are moving from windows forms to wpf for the next version of the product I work on. We are using wise owl to do our obfuscation and I am wondering if anyone has had experience with this.
...
Hi, I am new to WPF development, I have a ListView and I want to freeze the header row so that it won't scroll off the screen when the user scrolls the list.
The xaml code, I have inherited, looks something like this:
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<DockPanel>
<forms:Bindable...
Hello Everyone,
I have a wpf window that has a height of 2000 with an actual desktop height of about 1000. Obviously about half of the window is off screen. Even though the window extends below the screen, the mouse will not move down to that area. I do want this content to be off-screen, and I want the mouse to be able to move over ...
I am binding a WPF ComboBox to a nullable property of type MyEnum? (where MyEnum is an enumerated type)
I am programmatically populating the ComboBox items like this:
// The enum type being bound to
enum MyEnum { Yes, No }
// Helper class for representing combobox listitems
// (a combination of display string and value)
class ComboIt...
Hello world,
I'm new to WPF and don't know how to implement what I need.
My problem:
I've got a data bound WPF gridview displaying the results of an SQL query.
Some of the columns present repeated data that I'd like to hide.
This:
occupancy name room
--------- --------- -----
Occupied Bob 1
Occupied Ted ...
I'm getting some unexpected behavior in WPF. Here's my scenario:
I have a UserControl on a Window. Let's call it "Surface". It has a Canvas on it.
I have a second UserControl. Let's call it "PlayingCard".
I have the PlayingCard UserControl added as a Child of the Surface's Canvas. Visually it displays just as it should, on top of th...
I am publishing a .Net 3.5 SP1 WPF application through ClickOnce. By default, when the user clicks on the published link the application gets installed and a menu and shortcut are added to the client's Start/All Programs menu.
How can I prevent the shortcut/menu from being created? (users need to run the application solely by clicking ...
The obvious solution would be to have a row number property on a ModelView element, but the drawback is that you have to re-generate those when you add records or change sort order.
Is there an elegant solution?
...
If I call SelectAll from a GotFocus event handler, it doesn't work with the mouse - the selection disappears as soon as mouse is released.
EDIT: People are liking Donnelle's answer, I'll try to explain why I did not like it as much as the accepted answer.
It is more complex, while the accepted answer does the same thing in a simpler w...
I am using WPF and have a Table inside a RichTextBox control. I need to get the background colour of the table cell to change it gets the focus. My problem is that I can't get the GotFocus or any other events to fire for the TableCell.
<RichTextBox>
<FlowDocument>
<Table>
<Table.Columns>
<TableColumn...
I try to refactor such XAML by introducing new user control:
<Window ...>
<ComboBox ItemsSource="{Binding Greetings}" />
</Window>
After adding a control I have
ControlA XAML:
<UserControl ...>
<ComboBox ItemsSource="{Binding Items}" />
</UserControl>
ControlA C#:
public static readonly DependencyProperty ItemsProperty =
Wp...
Why does the following animation flicker and act goofy on MouseLeave? If it can be repro-ed, I'll post a screencast.
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Canvas>
<Path Fill="Blue" Margin="15,15,15,15">
<Path.Data>
<!...
Hello,
I would like to apply a style on a WPF Expander Header. In the following XAML I have an Expander but the style is for all of it not just for the header.
Thanks.
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="640"
>
<StackPanel>
<Stac...
I'm creating a UserControl and I just can't remember the name of the attribute which you use to decorate the property which you want to act as the default content property.
To give a concrete example, say i have a property called 'Title' which i can set using property syntax like this -
<local:myControl Title="the title"/>
But the...
Hi,
I have a WPF ListView bound to a CollectionViewSource. The source of that is bound to a property, which can change if the user selects an option.
When the list view source is updated due to a property changed event, everything updates correctly, but the view is not refreshed to take into account any changes in the CollectionViewSou...
Hi,
I have a WPF ListBox control. It can have a long list of items.
When i am working with the normal screen resolution i.e 1024 * 768, it shows the listbox with scrollbar properly, if I mention the MinHeight and MaxHeight for the listbox.
and when I switch to another resolution, which is 1280 * 1024, ideally, the listbox should fit to...
I have a UserControl which I'm using to display a list of UIElements. The control consists of a single ItemsControl with it's ItemPanelTemplate switched for a horizontal StackPanel, its ItemsSource bound to a DependencyProperty exposed by the UserControl and its ItemTemplate set in the UserControl.Resources.
Everything works fine exc...
For example:
<Grid Name="TestGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Name="TestColumnName" Width="*" />
</Grid.ColumnDefinitions>
</Grid>
I would like to be able to access the column definition in code using the name 'TestColumnName'.
...
I've decoupled events in this WPF application in the following way.
What is the best way to continue decoupling?
Shell.xaml:
<Button x:Name="btnProcess"
Content="Process"
Margin="10"/>
Bootstrapper.cs:
public void Run()
{
Shell shell = new Shell(new Customer());
shell.Show();
}
Shell.xaml.cs:
public Shell...