wpf

wpf user control

Hi all, I have a wpf application that has a number of user controls defined. For one of these controls (a login screen) I want to be able to hide the login user control and then display the registration user control. In the code behind file for the login I have tried the following Registration reg = new Registration(); reg.Visibility...

What file type do you recommend I use for playing a really small video?

I'm going to be playing a small video of a videogame. It's going to be maximum about 2-4 seconds each file. I need them to playback inside of my WPF Form desktop application and they need to be relatively small because I'm going to be including them in the donwload size (they are going to be part of the .exe file) Should I use GIF? Or ...

WPF - error while cloning objects and putting them into XPS document

Here's the bottom line: I'm trying to avoid using RDLC/SSRS and instead create XPS files from my XAML. I've combined pieces of code from various articles here and I am (1) cloning the XAML objects I need from my page and (2) passing those to a new page in an XPS object This process seems to work just fine with non data-bound objects th...

C# WPF - custom resizing

I am needing to make a custom window with WindowStyle.None, AllowsTransparency = true, etc. One requirement is a custom ResizeGrip control. I have this working with ResizeMode.CanResizeWithGrip, taking some code from an open source project found here: Fluid Kit See the "GlassWindow" class if you're interested. To do the work, I'm cal...

WPF Waving images animations

Hi All, I need to create at runtime a series of images on the screen, these images are all letters of the alphabet (PNG, 32x32), these images must look like they are "waving" up and down and rotating slightly too. (Almost like a Mexican wave) The issue is that the images are NOT all added one after another at start up, but rather when ...

Updating relative time with WPF DataTemplate

Hi! I'm using a DataTemplate to show items (from a class via data binding) in a listbox. This class also contains date and time, and I'm using a converter to convert this date/time to relative time (xx minutes ago), which is then displayed in a TextBlock. So far everything is great. The problem is that I don't know how to keep this rela...

Display a Default value for a Databound WPF ComboBox

I have a databound WPF comboxbox where I am using the SelectedValuePath property to select a selected value based on something other than the object's text. This is probably best explained with an example: <ComboBox ItemsSource="{Binding Path=Items}" DisplayMemberPath="Name" SelectedValuePath="Id" SelectedV...

WPF - Refresh contents of a DataTemplate

I have a tab that has its content set to an object (a TFS WorkItem). I have a DataTemplate for the WorkItem type. When I set the object to the tab it displays nicely. However, when I update one of the collections on the object (the list of links) this change is not refreshed to the view. I have tried making my WorkItem a DependencyPr...

Making URLs on a textblock clickable

Hello, Im programming a little Twitter Client just for fun. I have the tweet's text on a textblock and I want to make the URLs clickable. I know that I have to parse the URLs with a regexp but... how I put text plus link on the textblock? I can't have a string like: Hello check my blog at <Hyperlink>http​://myblogurl.com</Hyperlink> be...

WPF Editable Combobox IsFocused problem

I am developing a Watermarked Combobox by modifying Combobox Control template. everything is fine when combo box is not in editable mode. but when i change edit mode to True, isFocused property never set to True. this is because in edit mode, combo box is using a Text Box. This is exact copy of this StackOverflow question: . there are no...

Is there a way to follow a binding in code?

If i have a Binding which has a property path and the data source can i execute it in code, to find the value? The path that i am trying to follow can be quite complicated, including collection lookup and multiple levels. there is a hack : create a content control use BindingOperations.SetBinding() then retrieve the content is there...

Checkbox not removing items if unchecked - C# WPF

The CheckBox in my form won't remove items from the listbox at all if it is unchecked, even though I have it in the correct events private void WWW_checkbox_Checked(object sender, RoutedEventArgs e) { packagelist_listbox.Items.Remove(SelectaCategory_listbox); LoadPackageList.Load("www.xml"); XmlNodeList WWWPackageList = Load...

Animation with MVVM pattern

Hello, What is the best way to trigger an animation while using the MVVM pattern? More specifically, I have a form which has several fields. When a user click's the save button, I would like to show an animation. I have been able to achieve this by exposing a property ShowMessage and setting it to True and a DataTrigger picks up this va...

Binding does not have a Clone method, whats an effective way to copy it

I wish to copy a binding, this is so i can set a different source property on it without affecting the original binding. Is this just a case of setting all of the properties on the new binding to be the same as the old? ...

WPF Can you clear video memory?

I have a very rich media based application built in WPF, and Im using lots and lots of different PNG images to add animations and materials to 3D objects, as well as 2D animations. I have noticed that quickly the video memory fills up, and Im looking into trying to clear it. I don't seem to be able to do anything through C# to force th...

Prevent scrollbars with WPF WebBrowser displaying content

I'm using the WPF WebBrowser component to display some very simple HTML content. However, since I don't know the content size in advance, I'm currently getting scrollbars on the control when I load certain datasets. Basically, how can I force (or otherwise effect the equivalent of forcing) the WebBrowser to expand in size so that all c...

Context-sensitive layout - change visibility of set of WPF tools based on a combobox

I have a UI issue with layered editing where a different set of tools needs to be visible depending on the Combobox selecting the layer and am stewing over the idiom to use. The tools should not be in a visible container. The Combobox selection is bound to a simple integer property in the ViewModel. The alternatives I've been consideri...

WPF and LINQ/SQL - how and where to keep track of changes?

I have a WPF application built using the MVVM pattern: My Models come from LINQ to SQL. I use the Repository Pattern to abstract away the DataContext. My ViewModels have a reference to a Model. Setting a property on the ViewModel causes that value to be written through to the Model. As you can see, my data is stored in my Model, and ...

WPF - ToggleButton not unchecking when clicked

I have a ToggleButton that is malfunctioning. As I understand it, a ToggleButton should go checked when clicked then unchecked when clicked again. The ToggleButton in this example does not. Clicking it just sets it to checked again. Any Ideas why? <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="htt...

System.Windows.Media in ASP.NET MVC

Can I use the " System.Windows.Media" in the ASP.NET MVC application. Because I need to draw image using this. Is it possible or we need to use System.Drawing only for the Web Application ? ...