wpf

How to animate visibility of a StackPanel in Silverlight to expand and collapse?

In my case, I would like the expand/collapse to happen from left to right and right to left respectively. The animation should happen when the visibility changes. Thank you. ...

Can't use WPF designer because can't find custom base window type in XAML, but code behind is fine

I am using a base Window class in a WPF project. In the code behind C# file the assembly to the base type is referenced and fine. In the XAML is looks like this: <MyNamespace:WindowBase x:Class="MyNamespace.Applications.UserInterface.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ...

Accordion control hides behind another control, how to bring it to front?

How can I get the accordion control which is defined in Grid row 0 go ON TOP of another panel which is defined in Grid row 1..... <Grid x:Name="MainGrid" Background="White"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition /> <RowDefinition Height="Auto" /> </Grid.R...

How do I recover after problem in WPF OnRender

Just had an interesting problem, caused by the following sequence of events: Code called from a WPF OnRender override threw an exception (there's no mystery in this - it's a trivial bug in some viewmodel code) The exception was unhandled, so was picked-up by our DispatcherUnhandledException handler. The DispatchedUnhandledException han...

x:Type and arrays--how?

Long story short, I need to do this: ExpressionType="{x:Type sys:Byte[]}" In other words, I need to do this: foo.ExpressionType=typeof(byte[]); Wat do? Update: Its a bug in the 2010 design surface. It works fine at runtime. ...

WPF Image Formats and Binding

I have a project which requires be to convert an in memory System.Drawing.Bitmap into an in memory BitmapImage so I can bind the BitmapImage to an Image control via XAML. The problem I am running into is during the conversion the original bitmap gets shrunk and is very blurry. This is very bad because the original bitmap is a bar code ...

Grouping prevents Virtualizing?

Is it correct, that using the grouping functionality of a ListView (through CollectionView) will prevent virtualization of the items in the ListView (.net4). ...

WPF FrameworkElement not receiving Mouse input

Trying to get OnMouse events appearing in a child FrameworkElement. The parent element is a Panel (and the Background property is not Null). class MyFrameworkElement : FrameworkElement { protected override void OnMouseDown(MouseButtonEventArgs e) { // Trying to get here! base.OnMouseDown(e); } } public clas...

How can I prevent WPF UserControl elements from being visible outside of my desired view range?

Hello all, I am trying to convert my WPF application into a WPF UserControl. In the original application, I had intentionally modified the margins of certain elements so that their edges were not within the bounds of the window. I did this in order to hide undesirable borders that I could not get rid of without having to write my own ...

WPF listview drag without deselect

I have a listview object containing files in the program. The default listview behavior allows me to do all the select operations on the list (click+shift to select a block, click+ctrl for individually selecting members of a group of items, and click to select a single item). I want to begin dragging these items with a click and hold o...

How to get the binding UI to see my Objects in VS 2010

I have a Silverlight object (call it QuestionAsker.xaml) and another object I use as the data context for that silver light page/object (call it QuestionAskerVM.cs) My QuestionAskerVM instance is called QuestionAskerViewModel and is defined in QuestionAsker.xaml.cs. My QuestionAsker.xaml looks like this: <UserControl x:Class="IsAProgr...

Programmatically add to Window.Resources in WPF

Is there a way to add a ResourceDictionary at the Window level instead of the Application level? I see many examples for something like this: Application.Current.Resources.MergedDictionaries.Add(myResourceDictionary); However, nothing like what I would expect there to be, such as: Window.Resources.MergedDictionaries.Add(myResourceDi...

Providing external dependencies to a WPF Custom UserControl

Hello: I'm attempting to create a simple WPF UserControl beginning with the default constructor. public partial class MyControl : UserControl { InitializeComponent(); } Now MyControlwill require access to my database and that connection is initialized and managed externally. What is the best way to provide an external dependent res...

Display a ListBox with a List of enums

Hi. I'm trying to display a ListBox inside of a GridViewColumn that needs to bind to a List of enums (List<ResourceType> Cost). The GridViewColumn's ListView is already bound to a collection of objects and I'm not really sure the best way to go about displaying the ListBox. Any suggestions? ...

WPF TextBlock requirement

I have a requirement for my textblock to have a character gap of 75 and a border line of 2 pixel. How would I achieve this? ...

C# WPF Encryption.

I want to encrypt passwords using the C# WPF. what is the best algorithm (and easy to implement) to use? and I want some example about how to use it ... ...

How to detect two image linked by a line image if using drag and drop these three images?

How to detect two image linked by a line image if using drag and drop these three images? Drag and drop two image and use an image representing a line placing between them How to make the two image knowing that they are connected together ...

WPF - Best way to remove an item from the ItemsSource

Hi, I'm writing a custom ItemsControl (a tabbed document container), where each item (tab) can remove itself from the UI when the user closes it. However, I can't remove it directly from the ItemsControl.Items collection, because the items can be databound. So I have to remove it from the ItemsSource, which can be anything (ICollection,...

Binding a custom attached property and OnSetPropertyCallback

Hello. A window has a MenuItem binded to a collection, the MenuItem has ItemTemplate, which contains another MenuItem with an attached property using binding: <Menu Background="Transparent"> <MenuItem ItemsSource="{Binding SomeThings}" Header="Menu"> <MenuItem.ItemTemplate> <DataTemplate> ...

WPF Update from datagrid

I have a datagrid in a WPF populated from a csv file. This is done with Linq and populating the datagrid via CollectionViewSource.Source. The requirement is for any updates/changes made to the data in the datagrid to then be saved back into the csv. I need to know how to save any changes to the data? I've been playing around with some...