wpf

How to control placement ordering when using arrangeoverride to extend WPF controls

I am extending the WPF textbox in order to place a custom image on it. I want to capture mouse clicks on this image. So far i have been able to use arrangeOverride to place the image in where i need it but since it happens to be placed "inside" the text box, whenever i try clicking it the text box captures the click and the event that is...

Binding a WPF Listbox to Xml in Button_Click event?

Hi, I am trying to bind a ListBox to Xml in Button_Click event in xaml.cs. my Xml is simple <books> <book>ABC/book> <book>XYZ</book> </books> Here's what I am doing.. in xaml.cs XmlDocument x = new XmlDocument(); x.LoadXml(e.Result.ToString()); listbox1.ItemsSource = x; and Xaml ...

Programmatically set ComboBox SelectedItem in WPF (3.5sp1)

I have been confused while setting SelectedItem programmaticaly in wpf applications with Net Framework 3.5 sp1 installed. I have carefully read about hundred posts \topics but still confused(( My xaml: <ComboBox name="cbTheme"> <ComboBoxItem>Sunrise theme</ComboBoxItem> <ComboBoxItem>Sunset theme</ComboBoxItem> </ComboBox> ...

DataBinding and Timer in WPF ?

Hi, I'm gonna write a code with DataBinding and a Timer to change an Image sequentially. e.g: in each two seconds. below is my C# code : public class GenerateRandomImagePath { Random random = new Random((int)DateTime.Now.Ticks); readonly int MinInt; readonly int MaxInt; readonly string PrefixImagesName; readonly s...

To set CommandTarget of WPF control as Textbox which is written in Win form user Control

i want to set the CommandTarget property of menu item to the TextControl which is written in win form or just tell me any way which can execute the command lets say cut copy paste on the control which is written in win form user control and added to xaml through WindowsFormsHost ...

WPF Path Resizing

Hi ! This is my Path: <Style x:Key="MyPath" TargetType="{x:Type Path}"> <Setter Property="SnapsToDevicePixels" Value="true" /> <Setter Property="Stroke" Value="Blue" /> <Setter Property="Data" Value="M0,100 L 80,40 160,100 M 40,80 L 40,160 120,160 120,80" /> </Style> <Pat...

Turn off Tooltip of WPF Toolkit chart control

Hi all I am using WPF ToolKit Chart Control to create a columneries chart. Whenever I move mouse to my Chart, the tooltip value will be displayed. I dont need this tooltip, So How can I turn off this. ...

Child control view model event

Hi, I seem to have got stuck in a situation where I have a parent and child usercontrol. I want to be able to raise an event in the child and have the parent handle this event. How do I trigger the event in my child view model and handle it in the parent view model. If anybody has a simple example that would be really good. Thanks v...

HowTo animate filtering of items displayed in an ItemsControl (WPF)

Hi, I'm currently creating a control that is mainly just an ItemsControl displaying some items. In addition I have some controls which allows the user to filter the items in that ItemsControl. What I'm trying to do is to make it better visible to the user which items are removed when the filter is applied. So what I did was instead of...

WPF Canvas: centered origin, scaled axes (and y inverted), responding to mouse events

In a simple code-only WPF application I'm writing, I would like to have a custom Canvas. I've found questions similar to this one here in StackOverflow, but couldn't find exactly this one, nor a simple way to adapt another answer to my specific problem (please note that I have not much experience in WPF). In my canvas, I'd like it to h...

DwmExtendFrameIntoClientArea without Aero Glass

Using the DwmExtendFrameIntoClientArea API call with Aero Glass enabled works just fine. However, I want it to work when Aero Glass is disabled as well, like how it works in the Windows control panel: Notice how the frame has extended into the client area, even though Aero Glass is disabled? When I make the DwmExtendFrameIntoClientAre...

INotifyPropertyChanged and calculated property

Suppose I have simple class Order, that have a TotalPrice calculated property, which can be bound to WPF UI public class Order : INotifyPropertyChanged { public decimal ItemPrice { get { return this.itemPrice; } set { this.itemPrice = value; this.RaisePropertyChanged("ItemPrice"); this.RaiseProper...

How to develop an application looks like VS.NET in WPF?

I want to develop Error List Control present in VS.NET into my application using WPF Help me Thank u!!!!!!!!1 ...

How to find seleced item from menuitem

Hi, I have a contextmenu in which i binded some items as menuitem at runtime. I have subscribed an click event also. Now how to find wwhich item was cliked from the binded item in the event? Thanks, ...

Screen Resolution Problem In WPF ?

I'm gonna detect the resolution with the following code in WPF : double height = System.Windows.SystemParameters.PrimaryScreenHeight; double width = System.Windows.SystemParameters.PrimaryScreenWidth; Current resolution of my screen is 1920*1200, but height is 960.0 and width is 1536.0 !!! What's wrong with it ? Thanks in advance. ...

Fade any control using a WPF animation

I want to toggle the opacity of a control (Button, TextBox, Panel, etc) in my WPF project and wanted to check to see if I had done it correctly. My question is: Is this the type of functionality that you’d normally write in XAML or would you use code similar to that below to achieve the fade in/fade out result? internal static class ...

WPF Canvas Scaling/Transform to Fit

I'm reposting this question as I didn't get much of a response last time, hopefully a bit of re-wording might help... Essentially what I'm trying to do is to create a databound canvas, that will automatically scale its contents to 'fill' up the available space. Sort of like a zoom to fit operation. Unfortunately my WPF skills aren't yet...

form resizing and mazimizing problem

my form gets the black effect while resizing or maximizing the form i want to remove that black screen effect can someone help in that ...

How to save WPF 3d MeshGeometry3D to resource

i'm inserting *.obj to main windows. But 3d object contains too many coordinate. My xaml file was very big. How to insert 3d object (.obj) to resource and call from them? ...

How do I replace the default style of a WPF control?

So that when I apply additional typed styles in my application I don't have to do the BasedOn thing in order for them to be merged with my custom global style. You know, like happens with Microsoft's own styles. Essentially, I want to apply my style at number 9 instead of 8. If that's relevant: I also want to completely ignore themes an...