How can I go about specifying absolute Offsets for the GradientStops in my LinearGradientBrush?
I have a GridView with a LinearGradientBrush as the background:
<Grid.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<LinearGradientBrush.GradientStops>
<GradientStop Offset="0" Color="White" />
...
I want to capture an image of the screen, however there are some wpf controls in my application that I do not want to appear in the screenshot. Using the code below, the hidden controls will sometimes still appear in the screenshot. How do I ensure that this doesn't happen?
Window window = new Window();
Button button = new Button();
vo...
I'm creating a WPF application in c# and I have an image control with an image. I want it to show an tooltip with image and text when the mouse if hovering over it. So how do I make a tooptip with an image when the mouse is hovering over it. Thanks in advance to any help.
...
I have a wpf program in c# that has a combobox with various colors to choose from. It looks something like this
? Text
I am making a configurator that can change the color of certain texts in another program. So if the user opens the program and he doesn't like the description text color, he can open up the configurator and change the...
I am implementing the WPF DataGrid (very new to WPF). I followed tutorials that showed how to bind the comboboxcolumn using staticresources. However, the databinding for a few columns in my datagrid will not be known until runtime.
Because of this, I can't bind them with the staticresource. Is there any other way to databind the combobo...
I'm trying to get a Window's datacontext to be set to itself, but I can't figure out what the syntax should be.
<Window x:Class=" ...
DataContext="{Binding Self}"
Doesn't seem to work.
Any ideas?
Thanks!
...
Hello all.
Let me start off by saying that I am completely new with WPF (this is my first project and I have been working in it for less than a week). With that being said, please be easy on me!
I have three list boxes that are being bound to ObservableCollections from a LINQ queries. In the beginning, everything is fine, all three a...
How can I get information about the source image of a WPF <Image> element?
My <Image> element has its Source bound to an ImageSource property, which changes frequently. In my code behind, I need to be able to access the actual width of the current source image file (in regular pixels), for mathematical purposes. My application will pe...
Windows 7 has a really nice onscreen keyboard program/control for touchscreens. I have a touchscreen app that was originally written for, and will be deployed on, XP. Is it possible to incorporate this keyboard directly into my app, rather than me using a custom control? I can find no programmatic information about it, so any links wo...
I have two text boxes, one for a billing address field and one for a shipping address field. When the user types something into the the billing address text box the shipping address text box gets the same value due to the following binding scenario:
<TextBox Name="txtBillingAddress" Text="{Binding BillingAddress, UpdateSourceTrigger=Pro...
In WPF (C#) is there a way to set the tooltip's height and width dynamically (meaning in code). Thanks for the help.
System.Windows.Controls.Image td = new System.Windows.Controls.Image();
BitmapImage myBitmapImage = new BitmapImage();
myBitmapImage.BeginInit();
myBitmapImage.UriSource = new Uri(Directory.GetCur...
Why would a dependency-property implementation crash my application when I provide a default value?
This segment of code is in the class declaration for my UserControl object. Everything works fine - it compiles and runs perfectly.
public static System.Windows.DependencyProperty DepProp
= System.Windows.DependencyProperty.Regis...
I know ListView pretty well, but never looked at DataGrid.
My question is simple - if you do not need editing in the list, does DataGid provide any benefits comparing to ListView?
Also, are there disadvantages of using DataGrid (more complex, performance, bugs, hard to style, etc...)?
...
Hi,
I've set the itemsource of my WPF Datagrid to a List of Objects returned from my DAL. I've also added an extra column which contains a button, the xaml is below.
<toolkit:DataGridTemplateColumn MinWidth="100" Header="View">
<toolkit:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Click="Button_C...
In WPF/Silverlight, can I get the calculated value of a UIElement after a transformation is applied?
(Per the comment below):
I've got a stack panel and I've applied a TranformGroup to it. There are two translate and one scale transforms in this group.
(warning, psuedo code ahead)
groupTransform.children.add(new TranslateTransform())...
Hi,
I want to load my WPF UserControl with dynamic rows. My scenario is as follows.
1. When the UserControl gets loaded, I will populate my List<string> object with some values which I will get from a database.
2. I need to create equal number of rows in my UserControl which matches the number of items in the List<string> object. The d...
I am inserting TreeViewItems into a TreeView control and setting the style for each at the time of insertion. I am assigning different styles (predefined in XAML), depending on the type of node (TreeViewItem) I want to insert. Some of the styles include a ContextMenu.
My problem is that I am unable to use Click="MyHandler" on the MenuI...
Using XAML, I am trying to get a list box to display the list of system fonts.
I am not sure exactly what to type in the Bindings string.
Here's my attempt:
<Window x:Class="ListDataBinding.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmln...
Hi!
I'm doing a list of contacts for a person.
I have an ItemsControl which uses DataTemplates for different types of contact information. E.g. Phone number, Email... etc
In case of phone number, I want user to have 4 TextBoxes where he can edit the number. 4 because of the format (he can edit numbers only, the format is generated aut...
Hi,
When I use a ListView in WPF it always generates one extra column at the end of the ListView. For example, if I define two columns in my listview and when I run it it generates those two columns plus one empty column header. Any idea how I can remove that?
Sample ListView XAML
<ListView ItemsSource="{Binding Path=SearchAttributes}...