When the "x" is pressed in the title bar of a WPF form, where does the control go to? Is there a way of capturing this selection so that certain things can be done (like closing db connections) before exiting the code? Thanks for your help! VR
...
I have a wrap panel displaying items but I cant get a scroll bar to work properly any idea's whats wrong ?
<ScrollViewer>
<ItemsControl Name="itemsControl">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel ItemWidth="{Binding ElementName=sizeSlider, Path=Value}"
...
Hello All,
I am beginner on WPF and need your help.
Problem:
I have 4 buttons on the form and need to apply 2 different style on pair of 2 buttons.
Is there any way we can achive this ?
please provide me sample if possible...
Thanks in advance...
...
What is the difference between the two properties?
In what context is which property used?
Can you also provide a code example for each?
...
I am trying to clip a 4:3 image with a circle within a grid control.
I need the circle clip to reveal the image from the middle in a perfect circle. See below.
The circle should dynamically re-size with the image.
I have tried Canvas.Clip and Ellipse+VisualBrush without achieving the correct behavior.
Thanks!
...
I have had the problem described in the question Tiling rectangles seamlessly in WPF, but am not really happy with the answers given there.
I am painting a bar chart by painting lots of rectangles right next to each other. Depending on the scale of the canvas containing them, there are small gaps visible between some of them as a result...
When i write something like this:
<Style x:Key="panelS">
<Setter Property="Orientation" Value="Horizontal" />
<Setter Property="DockPanel.Dock" Value="Top" />
</Style>
I get the error that says: Cannot resolve the Style Property 'Orientation'. Verify that the owning type is the Style's TargetType, or use C...
Hi,
I have a TabControl
<TabControl
Name="myTabControl"
IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding}">
<TabControl.ItemTemplate>
<DataTemplate>
<DockPanel Width="120">
<Button Na...
I need to be able to change the style of a control when a property and data value are true. For example, my bound data has an IsDirty property. I would like to change the background color of my control when IsDirty is true AND the control is selected. I found the MultiTrigger and MultiDataTrigger classes...but in this case I need to some...
I've got a WPF UserControl containing a DependencyProperty (MyProperty).
The DependencyProperty is bound to a Property in the DataContext.
Now in the UserControl I want to change the value of the bound property. But if I assign MyProperty = NewValue the Binding is lost and replaced by NewValue.
What I want to achieve is change the Dat...
Right now you have to double click or click the + icon. Is there any way to make it so if a user clicks anywhere on the node it expands?
...
I am trying to figure out how to get the mouse scroll working on a wpf window with a scrollviewer and a datagrid within it. The WPF and C# code is below
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefiniti...
I am making a customized menu, with customized menu Items. Changing control templates and styles have been oke, but now I would like to change the way mouse events effect the menuItems visibility.
By default, when you click a MenuItem within the pop up of a parent menu item, the pop up will collapse. When the mouse leaves the pop up sta...
A ListView with Datatemplate in GridViewColumn:
<ListView Name ="LogDataList" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding LogDataCollection}" Background="Cyan">
<ListView.View>
<GridView AllowsColumnReorder="true"
ColumnHeaderToolTip="Event Log Information">
...
Is there a way to get the current rendered location of a WPF control its window after all of the current RenderTransforms have been applied? I may just be blind, but I'm not seeing an obvious method.
...
i know this question was asked before but i have this very weird beginner problem:
i want to update a list of actors by an id in which film they played (only one film)
DataClasses1DataContext db = new DataClasses1DataContext();
var old = from a in db.Actors
where a.id == 1
select a;
...
Hi,
I've got an little tool similar to the Windows Control Panel. The tool allows us to manage users, configure databases, manage scripts, etc.
The home page presents all the sub categories of the application.
When you click on a link, it loads the view of this category in the right panel and a small left panel shows the tasks available...
I'm working on my first WPF app, using VS 2008. I'm also using Matthew MacDonald's book Pro WPF in C# 2008: Windows Presentation Foundation with .NET 3.5, Second Edition. In it Matt has a class for implementing masked text boxes. I've used it in my WPF page, to handle things like social security numbers and phone numbers, and it works...
I have the following XAML:
<Grid x:Name="LayoutRoot" Background="White" DataContext="{Binding Source={StaticResource MyDataKey}}">
<TextBox Name="_myId" Text="{Binding MyDictionary[(Textbox.Name)]}" />
</Grid>
But it thinks the key in my dictionary is called "(Textbox.Name)", instead of "_myId". The format below works, where I have a...
Hello
I have been playing around with the WPF GridView control (DesktopUI not Silverlight) and I need to be able to select a specific row and only have the data for that row returned for viewing within a new control such as a list box.
In addition, once the data from a row has been selected the ability to select or add additional data...