wpf

Best not sealed UI element to derive from in Silverlight

Hello, I am currently creating a few test controls. In WPF everything is fine, I can subclass e.g. Border or ScrollViewer. In Silverlight this is not possible, so I have to do a little trick (multi-targeting)... I am deriving my test element from StackPanel and add the content as child. I could, of course, also derive from WrapPanel, Ca...

start animation that begins with current value (handoff)

I have a WPF Datatemplate that contains a some DataTriggers that start animating the color of a visual. How can I start the animation beginning with the actual value the color propery currently has? Since there might be another animation currently acitve I can not start a new one but when I remove the animation using DataTriggers ExitAct...

WPF :: Copying an image to folder in application directory.

Good day all, In my application I am allowing the user to browse their computer for an image. I then want to copy the selected file to a directory ("Images") within the application. This is what is causing me trouble. I tried using string root = AppDomain.CurrentDomain.BaseDirectory; to find the root and then navigate to my "Images" ...

How do I update an IValueConverter on CollectionChanged?

Here's a basic example to explain my problem. Let's say I have ObservableCollection<int> Numbers {get; set;} and an IValueConverter that returns the sum of Numbers. Normally what I'd do is changed the IValueConverter into an IMultiValueConverter and bind a second value to Numbers.Count like this <MultiBinding Converter="{StaticRes...

Best practice on repurposing button in WPF?

I have a relatively simple case where I want to repurpose a "Start" button with an "Abort" button after it is first clicked. I'm wondering what is the best way to implement this button repurposing using XAML, hopefully declaratively rather than with a code-behind hack: <DockPanel> <Button x:Name="btnStart">Start</Button> </DockPanel>...

ListView.ItemContainerGenerator.ContainerFromItem(item) return null after 20 items

hi first of all, I want to explain what I'm treating to do. I have a ListView in a usercontrol with a DataTemplate define like a resource. I want to hide a button inside the DataTemplate. Sounds easy, but .... the code i'm using is <StackPanel Margin="0" Width="1135"> ...

WPF Document: Getting the Table Cell borders right

I created this pic in MS Word and I am trying to replicate the style in my WPF app using the Documents. First the 'from': Next my attempt to replicate: My question is probably rather obvious. What am I doing wrong? I can't find a padding property on the rowgrouping or the row. Below is my code: public override FlowDocument Cre...

In WPF is there a way to change the position of a tooltip?

I just want the tooltip to appear above the control instead of below. What would be the best way to do this? Thanks! ...

How to specify WPF Theme in c#?

Hi ! I found out that I can use a different theme in an C# WPF Application by adding the theme .xaml-file to the project and add to App.xaml as a Resource. see http://wpf.codeplex.com/wikipage?title=WPF%20Themes for a more detailed description. Can I do this as well at runtime in C#? Is it possible to specify a different theme for d...

WPF MediaElement ActualWidth and ActualHeight is always zero

For some unknown reason I cannot get my MediaElement to show up when I use it in a ControlTemplate. I have installed snoop and I have determined that the ActualWidth and AcutalHeight is always zero, if I put the same media element on the main window just randomly placed, it does show. So, why the heck would it always be zero?? This is ...

White lines around round border at high zoom level

If I zoom large enough in xamlpadx (500%) I see while lines around the inside of the border. In my app this even happens at normal zoom level in some controls. Why is that and more important, what can I do about it? This is my XAML code: <Border Background="#000000" BorderBrush="#000000" BorderThickness="4" CornerRadius="4"> <...

Problem with WPF graph control

hi guys, I've developed a graph control in GDI+ and used a timer in it.. now i'm converting it to WPF. but when i went on and search for a timer there is no timers in WPF... how can i resolve this problem?any alternative to use? regards, rangana. ...

What's the best method for drawing overlay graphics on Windows?

I'm working with a Win32 application that needs to create a variety of custom window types. In particular, these windows are often non-rectangle, have shadows, or are mostly transparent. I'm currently using WS_EX_LAYERED with UpdateLayeredWindow to create transparent windows that I can then draw my arbitrary graphics on. However, I fin...

Inserting a tab into a WPF RichTextBox when AllowTab is set to false

I am trying to work out how to insert a tab character into a WPF RichTextBox when the AllowTab attribute is set to false. Is there a shortcut key that allows this? I would rather not have to resort to adding a special button to the toolbar or telling users that they must copy and paste one in ... ...

What is the best method to load Views dynamically from a Navigation control in Prism

I've implemented navigation through my application using a Menu control which publish an event using EventAggregator on click of menu item. Something like as shown below, this.eventAggregator.GetEvent<ViewRequestedEvent>() .Publish(new BusinessObject.Model.MenuModel { Modu...

how to show status bar in ribbon window wpf c#

I would like to use the ribbon bar like MS Office 2007 (and greater) in my own applications. Could anyone please provide me with links or references about how I can do this? EDIT: Actually I am using Microsoft's Ribbon Control Library but could not found way to add status bar like MS Word. ...

Transforming coordinates from an image control to the image source in WPF

I'm trying to learn WPF, so here's a simple question, I hope: I have a window that contains an Image element bound to a separate data object with user-configurable Stretch property <Image Name="imageCtrl" Source="{Binding MyImage}" Stretch="{Binding ImageStretch}" /> When the user moves the mouse over the image, I would like to deter...

WPF - How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question: How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I'm after: when an item appears in my ListBox, it should flash for a few moments if the item is 'Critical' then it should remain highlighted Currently I have a DataTemplate t...

Composite WPF and AvalonDock

Hi All, Has anybody tried PRISM and AvalonDock (latest release with DocumentSource property) together? I already had a look at http://www.youdev.net/post/2009/07/17/AvalonDock-Documents.aspx but it just briefs on how to use documentsource property. Please help, if anybody has tried this. I Would like to know 1.How to associate Docume...

How can I turn on (change color) of a single pixel by coordinates in WPF.

Hello.I have seen similar questions on here but haven't found an answer.I'm taking a computer graphics course in college and we are taught different algorithms that are used to display shapes.My assignment is to choose any development platform and implement these algorithms.Since I have experience developing in WPF, I want to use it for ...