wpf

Single click and double click on the same Image control(wpf)

I am trying to have different behaviours when single clicking and double clicking the wpf Image control. Unfortunately the single click is fired first, so the double click is ignored. ...

System.IO.IOException in PresentationFramework.dll on instantiation of a user control in WPF

I have a user control UserControl which is in an assembly Assembly. I have a WPF application which instantiates UserControl in a programmatic way. I have already added a reference to Assembly. However, during runtime I get the ff. exception: Cannot locate resource 'usercontrol.xaml'. at MS.Internal.AppModel.ResourcePart.GetStreamC...

Any tips on debugging focus issues in WPF?

Specifically, I have a button that opens a nonmodal child window. Something in the main window steals the focus away from the child window as it opens. The fully general approach is to comment out parts of code until the problem goes away. I'm looking for faster methods. ...

Focus on Label, TextBlock and Border

Hi I want to create a flat button with rounded right top and bottom corners. This button needs to have the background changed on clicked and on mouse over. Currently my Markup looks like this: <Border x:Name="MyButton" Height="25" Margin="0,5,0,0" CornerRadius="0 5 5 0" BorderThickness="1" BorderBrush="Gray" Style="{StaticResource...

Silverlight. Bind style items to datacontext.

I have button with custom style and i want to bind style items to button datacontext. How to do that? My tries: <UserControl.Resources> <Style x:Key="ButtonStyle1" TargetType="Button"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Grid> <TextBlock TextWrapping="Wrap" Te...

How to fire new SelectionChanged Event

Hi. I'd like to fire a SelectionChangedEvent. What I have is this: Fluent.ComboBox fcb = elt as Fluent.ComboBox; fcb.RaiseEvent( new SelectionChangedEventArgs( null, new List<double>() { (double)fcb.SelectedItem }, new List<double>() { fontSize }) ); My question is what I have to insert for the null parameter. The constructor expe...

How do i reset a DependencyProperty back to it's default value in xaml

question as above ...

WPF Style Triggers from another control

Hi, I have an image that i want to make it when the user hover with mouse over it, another image next to it will be displayed. The code below, doesn't work: <Image Source="volumen.png"> <Image.Style> <Style> <Style.Triggers> <Trigger Pro...

WPF MenuItem header text is partially hidden

Hi, I templated the way items shows up in a menu, but, for an unknown reason, I am having trouble displaying the whole text in the MenuItem. Here is a screen capture of the problem: Here is the markup code I used to template it: <ItemsPanelTemplate x:Key="SideBarItemsPanelTemplate"> <StackPanel Orientation="Vertical"/> </ItemsPan...

Why would adding an x:Name attribute to a user control cause a compilation error?

I really need some more ideas as to what's causing this, currently it's driving me up the wall. I have a Xaml user control which contains another user control like this : <UserControl x:Class="MyModule.View.MainView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2...

WPF ListBox, how to hide border and change selected item background color?

Hi, I'd like to hide the border of ListBox, and make background of selected item the same as unselected ones. How do I do this? Thx! ...

Does WPF RichTextBox support squiggly underline and inline images?

I need and editable component that supports these 2 features: inline images squiggly underlines that can have custom collor (different to text above them). Does WPF RichTextBox support that? If not, what does? ...

MVVM DESIGN PATTERN

Hi All, Am very much new to this MVVM DESIGN PATTERN.Am doing a small project in this pattern In my project i have a button,if i click on that button it will create a new button at run time and we can create any number of buttons there. Creating mutliple buttons is working and now am trying to move that controls at runtime where ever...

Overlay two bitmap images in WPF.

Hi there, I need to overlay two images (say, JPEG and PNG with transparency). Input: - JPEG image - PNG image Output: - JPEG image with PNG applied. What is the best approach to do that? Thank you in advance for the replies and hints! Cheers ...

wpf Dependency property before changing event?

Hi all, I have a dependency property on a control which is a custom class. Now is there an event that gets raised BEFORE the value is being changed? I know that OnPropertyChanged is raised after the property has already changed. I need some event before so that I can cancel the changing....in order to preserve the state of the contro...

WPF: Is there a possibility to "route" ordinary mouse events to touch events in Windows 7

I'm currently developing a touch screen application using C# (.NET 4.0) and WPF for Windows 7. My problem is that the driver of the touch screen I have available at the moment only generates mouse events. (The manufacturer unfortunately does not provide a genuine Windows 7 driver) So, currently I'm not able to do tests properly. Is ther...

How to turn off animations in WPF Toolkit charts

Is there a way to turn off the animations in Xaml directly? The animations are really sluggish as my chart has many points. ...

WPF Navigation Between Windows

I have designed 5 windows and all of them are having tab controls. Is there a better way or other ways to navigate between them ? I am now doing it like window1 w = new Window1(); w.Show(); this.Close(); also I am serializing an ApplicationContext class to an xml file which I have created to store all of the information of the appli...

WPF button background in windows 7

Hi I had windows xp before and setting the wpf button background always worked but since windows 7 the background is always set to blue. How could i fix this? ...

Condition in an EventTrigger

Can I check condition inside an event trigger? how can I do something like that using only XAML? <EventTrigger RoutedEvent="MouseDown"> <Trigger Property="IsPressed" Value="true"> <Setter Property = "Foreground" Value="Green"/> ...