wpf

Custom WPF Databinding

I have a List of DataItem's. DataItem has a RowId, ColumnId and Value. These dataitems essentially describe the contents of a user definable "table". Now I need to bind this data to a datagrid in such a way that it represents the "table". i.e. the DataItem Value's should be displayed in a grid using their RowId and ColumnId. Any help...

WPF Polyline relative point values and stretch for drawing a graph

I'm trying to create a pretty simple graphing component that consists of a series of Polylines within the same grid cell that represent graph lines. My strategy is to look at all the points in my set, determine the min and max, and then calculate a number between 0 to 1 accordingly and use Stretch="Fill" to stretch each Polyline to fill...

WPF - How to apply effect to a cropped image?

I have an image being clipped like so: <Image Width="45" Grid.Column="0" Source="{Binding Photo}" <Image.Clip> <RectangleGeometry Rect="0,0,45,55" RadiusX="8" RadiusY="8" /> </Image.Clip> </Image> How can I apply a drop shadow effect to it? UPDATE: As pointed out by Ray, the best solution is the one proposed by Anderson...

WPF Data Binding Error in ListBox

I have a listbox <ListBox x:Name="HistogramListBox" Grid.Column="1" Margin="8,2,8,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Template="{StaticResource HistogramListBoxControlTemplate}" ItemContainerStyle="{StaticResource HistogramListBoxItem}" ItemTemplate="{DynamicResour...

WPF Keep column sorting with Datagrid

Hi, I have several datagrid where I need to update the informations. Things is, since more than one person works on the system at the same time, the datagrid need to be refreshed on a regular basis. When I refresh, I lose the sorting that user had. Is there a way to keep it? thanks ...

WPF - call a window function from a child page

I have WPF window that uses a dockpanel and the menu control. I have the code to create the menu options based on a user ID. Within this window, I have a frame that contains a WPF page. I carry out all the authentication on the page and then have a user ID for the window to use. However, I cannot get the parent window to "refresh" and c...

Key press inside of textbox MVVM

I am just getting started with MVVM and im having problems figuring out how I can bind a key press inside a textbox to an ICommand inside the view model. I know I can do it in the code-behind but im trying to avoid that as much as possible. Update: The solutions so far are all well and good if you have the blend sdk or your not having p...

Avalon Control in WPF : change date format

I downloaded the Avalon Controls Library that includes a DatePicker and a MaskedTextBox. Our company would like to force the date format of the DatePicker to something else than Short or Long. Is there a way to do this? Thanks. ...

WPF - using CroppedBitmap in DataTemplate

The following xaml works ok inside a Window: <Border Width="45" Height="55" CornerRadius="10" > <Border.Background> <ImageBrush> <ImageBrush.ImageSource> <CroppedBitmap Source="profile.jpg" SourceRect="0 0 45 55"/> </ImageBrush.ImageSource> </ImageBrush> </Border.Background> </Border> But when ...

WPF Dynamic Binding X and Y Co-ordinates

Hi, I have a question on WPF dynamic positioning. I want to place Elipses on the screen based on X and Y co-ordinates that i have stored in a collection in C#. I have been made aware of the drawing ability in WPF which you do from C# using the Windows.Media and Windows.Shapes. Now what i actually want to do is use these namespaces...

Create a mp3 file using System.Speech.dll in WPF

I understand that the SpeechSynthesizer (System.Speech.dll) can be used to convert text to speech. I am working on an application that requires the ability of saving the text as mp3 and wav file. Is this possible using WPF? ...

What is the difference between Window Presentation Foundation and WCF? Which is newer?

So which one is the newer one, and why would I use one over the other. Or more importantly, over Windows Forms? ...

Viewport2DVisual3D with multiple materials

Hi All, I have a Viewport2DVisual3D control that contains a MaterialGroup as its Viewport2DVisual3D.Material property: <Viewport2DVisual3D.Material> <MaterialGroup> <DiffuseMaterial Brush="{DynamicResource ImageBrush1}"/> <DiffuseMaterial Viewport2DVisual3D.IsVisualHostMaterial="True" Brush="White"/> </MaterialGroup> </Viewport2DVi...

How to make WPF Pages have common interface

We develop a wizard-like WPF application that has a Frame that navigates to various Pages. I define each Page in a separate xaml and xaml.cs file, and then have the application make the frame navigate between the page. All of my pages currently inherit from Page. I would like to have a common interface to all my pages, so I can access t...

Need help hooking up XML file to WPF DataGrid

Here's what I've done so far: In my App class, I declare a new XmlDataProvider and set the source to a valid XML file (whose Build Action is set to Content/Copy Always). public partial class App : Application { public App() { InitializeComponent(); var services = new XmlDataProvider(); services.Source =...

how to show properties of the custom control in visual studio IDE 2008 properties window?

hi guys, i have created a custom graph control in WPF, now i want to show it's properties in the properties window in visual studio IDE 2008, so a user can change the properties at the design time.how can i do it in WPF custom controls?? please help me guys?? regards, rangana. ...

xaml: trigger dialog 'Apply' button state

I want to enable 'Apply' dialog button when content of some textboxes in this dialog changes. Here what I came up with <Window.Resources> <ResourceDictionary> ... <Style x:Key="SettingTextBoxStyle" TargetType="{x:Type TextBox}"> <Style.Triggers> <EventTrigger RoutedEvent="TextBox.TextChan...

How to arrange controls based on their size? (without inheriting from Panel)

Scope I am trying to have my application arrange lines of some complex controls and split those lines into pages. Something like this: Much like a word processor would do, only there are complex controls instead of words. Note that the requirement of splitting into pages is essential. Also note that the obvious solution of inheritin...

WPF Binding to Combo Box

Hi a quick question really in WPF. Does anyone know how i can bind a combo box that will sit in a grid to a dataset that i have. The dataset contains several columns and numerious rows but i want to take one of the columns, lets say ProcessID and just show that in the comobo box. Has anyone done this before or know how it can be don...

Image loading memory leak with C#

Hi, I have a memory leak issue in my application which loads a large amount of images. I'm rather new to C#, and thought my days of memory leak issues were past. I can't figure out the problem - maybe I'm using some unmanaged modules which I'm not handle correctly? To illustrate my problem I've simplified the core of what causes the p...